minghuaw / azservicebus Goto Github PK
View Code? Open in Web Editor NEWUnofficial Azure Service Bus SDK over AMQP 1.0 for rust
Unofficial Azure Service Bus SDK over AMQP 1.0 for rust
https://learn.microsoft.com/en-us/rest/api/servicebus/enumeration
How to perform that operation using this library?
When peeking on an empty queues it awaits for some time and gives the following error
warning: `rust_lib_azure` (lib test) generated 2 warnings (run `cargo fix --lib -p rust_lib_azure_bus --tests` to apply 2 suggestions)
Finished `test` profile [unoptimized + debuginfo] target(s) in 2.44s
Running unittests src\lib.rs (target\debug\deps\rust_lib_azure_bus-b9a918f953b77c77.exe)
running 1 test
test api::reciever::test::test_peek_messages ... ok
successes:
---- api::reciever::test::test_peek_messages stdout ----
Err(Error decoding from message
Caused by:
Error decoding from message)
successes:
api::reciever::test::test_peek_messages
test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 12.79s
as you can see 12.79s is quite long. is it possible to return early before it tries to decode the message?
Any chance ServiceBusSender
and ServiceBusReceiver
could be Sync
? Or should we just Arc<Mutex<>>
it? feels weird since there are already some Arc
s internally and I think this is a common enough requirement that the crate could support it (?). I could try to tackle this if it makes sense
This is a new feature stabilized in 1.75, and other crates have observed performance improvement by adopting this feature (eg. async-graphql
reported almost 20% performance gain )
See the changelog of the dotnet SDK (https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/servicebus/Azure.Messaging.ServiceBus/CHANGELOG.md)
i read that and i think that doesnt give us an api to update the application properties? or should we create a raw amqp message for it?
registry\src\index.crates.io-6f17d22bba15001f\azservicebus-0.20.1\src\primitives\service_bus_peeked_message.rs:344:22:
internal error: entered unreachable code: Expecting a Long
I dont know what additional details that i can give, but i can follow instructions to give you more information.
The message was created using web azure service bus explorer from the azure portal. and when i peek that same message from the web i do see the active state as well
use azservicebus::{
ServiceBusClient, ServiceBusClientOptions, ServiceBusReceiverOptions, ServiceBusSenderOptions,
};
#[tokio::main]
async fn main() -> Result<()> {
let connection_string = "Endpoint=sb://<namespace>.servicebus.windows.net/;SharedAccessKeyName=RootManageSharedAccessKey;SharedAccessKey=<your shared access key>".to_owned();
let topic_name = "test".to_owned();
let subscription_name = "DSResult".to_owned();
let mut client = ServiceBusClient::new_from_connection_string( connection_string,
ServiceBusClientOptions::default(),
)
.await.unwrap();
let mut sender = client
.create_sender(&topic_name, ServiceBusSenderOptions::with_subscriber(&subscription_name))
.await.unwrap();
// Send one message
sender.send_message("Hello World").await.unwrap();
sender.dispose().await.unwrap();
client.dispose().await.unwrap();
Ok(())
}
The crate itself is already dedicated to service bus, so there is probably no need to name the client type ServiceBusClient
. This should be extended to other types as well.
The Change Log url is still pointing to the old repo
All AMQP request-response currently uses the try_timeout
parameter defined in the service bus client. The user should be able to set this parameter to a different value if needed
The Azure SDK guideline suggests NOT to define a prelude mod (https://azure.github.io/azure-sdk/rust_introduction.html#rust-general-prelude)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.