Git Product home page Git Product logo

Comments (5)

anuchandy avatar anuchandy commented on May 28, 2024 1

Hi @kensinzl, once you close an instance of ServiceBusSenderClient, you won't be able to use it further (i.e., you can't call send on the closed instance). What I meant earlier was, you can have a Sender instance in application’s global scope, but it should be closed when the application gets shutdown.

from azure-sdk-for-java.

joshfree avatar joshfree commented on May 28, 2024

@anuchandy @Azure/azsdk-sb-java could you please follow up with @kensinzl on these questions?

from azure-sdk-for-java.

anuchandy avatar anuchandy commented on May 28, 2024

The ServiceBusSenderClient object is reusable, on which application can call send() API multiple times.
It is recommended to close the client as part of the application shutdown.

Storage Queue and service bus uses different protocols and has different use cases.

https://learn.microsoft.com/en-us/azure/service-bus-messaging/service-bus-azure-and-service-bus-queues-compared-contrasted

There is no id available when sending to service bus, but only while receiving.

from azure-sdk-for-java.

github-actions avatar github-actions commented on May 28, 2024

Hi @kensinzl. Thank you for opening this issue and giving us the opportunity to assist. We believe that this has been addressed. If you feel that further discussion is needed, please add a comment with the text "/unresolve" to remove the "issue-addressed" label and continue the conversation.

from azure-sdk-for-java.

kensinzl avatar kensinzl commented on May 28, 2024

@anuchandy

Thank you so much for your explanation.

just double confirm

  • I used the ServiceBusSenderClient instance as an injection
  • create a simple function which uses the above ServiceBusSenderClient instance to send the message,
    eg: sudo code
@Inject ServiceBusSenderClient instance;


public void sendMessageToAzure(String meg) {
    instance.sendMessage(meg);
    instance.close();
}
  • so do you mean whenever hit the sendMessageToAzure I need to close the instance, but the ServiceBusSenderClient instance is reusable, I have no necessary to re-open it after close?

from azure-sdk-for-java.

Related Issues (20)

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.