Giter Club home page Giter Club logo

azservicebus's Issues

Peeking on an empty Queue. Is it possible to return early

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?

Unable to get the state of a messae

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

Unable to deliver message to service bus subscription

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(())

}

Rename `ServiceBusClient` to `Client`

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.