-
Notifications
You must be signed in to change notification settings - Fork 299
Closed
Labels
ClientThis issue points to a problem in the data-plane of the library.This issue points to a problem in the data-plane of the library.Service BusService BusService BusbugThis issue requires a change to an existing behavior in the product in order to be resolved.This issue requires a change to an existing behavior in the product in order to be resolved.
Description
I created a Service Bus Namespace with:
- One Queue :
dev
- One Topic :
test-topic
- One Subscription :
test-subscription
- One Subscription :
I also have a Sharred access Policies
on the Namespace level named common
But the topic client always receives a 401, when my QueueClient receives 204
Can you help me with this ? Is my code incorrect ?
Can it be linked to the ordering when creating things ?
I am using the latest 0.19 version of the sdk with rust 1.77.1
This is the result of this test program
INFO peeked message queue val=204
INFO send message to topic ko=Error { context: Simple(HttpResponse { status: Unauthorized, error_code: None }) }
INFO peeked message from subscription val=401
use azure_messaging_servicebus::service_bus::{QueueClient, TopicClient};
use reqwest::Client;
use std::sync::Arc;
use std::time::Duration;
use tracing::{info, subscriber::set_global_default};
#[tokio::main]
async fn main() {
// common conf
let namespace = "REDACTED";
let policy_name = "common";
let policy_key = "REDACTED";
// topic conf
let topic_name = "test-topic";
let subscription_name = "test-subscription";
// queue conf
let queue_name = "dev";
set_global_default(tracing_subscriber::fmt::Subscriber::new())
.expect("set tracing default subscriber");
let client = QueueClient::new(
Arc::new(Client::new()),
namespace,
queue_name,
policy_name,
policy_key,
)
.unwrap();
let val = client
.peek_lock_message2(Some(Duration::from_micros(1)))
.await
.unwrap();
info!(val = %val.status(), "peeked message queue");
let client = TopicClient::new(
Arc::new(Client::new()),
namespace,
topic_name,
policy_name,
policy_key,
)
.unwrap();
let val = client.topic_sender().send_message("msg").await;
match val {
Ok(_) => info!(ok = ?val.is_ok(), "send message to topic"),
Err(_) => info!(ko = ?val.unwrap_err(), "send message to topic"),
}
let val = client
.subscription_receiver(subscription_name)
.peek_lock_message2(Some(Duration::from_micros(1)))
.await
.unwrap();
info!(val = %val.status(), "peeked message from subscription");
}
Metadata
Metadata
Assignees
Labels
ClientThis issue points to a problem in the data-plane of the library.This issue points to a problem in the data-plane of the library.Service BusService BusService BusbugThis issue requires a change to an existing behavior in the product in order to be resolved.This issue requires a change to an existing behavior in the product in order to be resolved.