-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Servicebus processor Client start/stop, any better way than this ? #29997
Comments
@yiliuTo could you please follow up with @jay-annapureddy on their question? |
Hi @jay-annapureddy though there are various solutions to add callback on Spring's bean level or context level, like using |
Hello @yiliuTo , the question of my collegue is in fact: in a spring boot application, it is the recommended way to start the processor manually, and let him run in the background by calling |
Hi @jbkervyn
To meet this requirement, your solution of using @PostConstruct and @PreDestroy is a common and convenient way to achieve that, which just hands over the management of your listener to Spring context in the background. |
Hello @yiliuTo , thanks a lot for your feedback ! This answers our question ! |
Hi, we're sending this friendly reminder because we haven't heard back from you in a while. We need more information about this issue to help address it. Please be sure to give us your input within the next 7 days. If we don't hear back from you within 14 days of this comment the issue will be automatically closed. Thank you! |
Hi @jbkervyn after the internal discussion, I would like to update our previous suggestion on the way to manually start/close the processor bean. The previous mentioned way of using Therefore, we recommand you to use the SmartLifecycle interface , which just like its name indicated, it binds the component's lifecyle with Spring application context intelligently. It starts the required component when the application is being refreshed which is after all the beans get loaded and initialized, which we think is much safer. And we prepare to enable this feature in the pr #30457, after it being released, you can remove your own customization to start/stop the processor manually, since our library will handle its lifecycle automatically. |
hi @yiliuTo That's great! Any idea in which version of spring-cloud-azure it will end up in? |
Hi @jbkervyn , we currently target to release it in the version of 4.4.0, and will notice you once it gets released or there are any other changes. |
Query/Question
Servicebus processor start/stop any better way than this ?
Why is this not a Bug or a feature Request?
From a springboot application, I am able to connect to Servicebus and process the messages but for this I am starting the processor client on PostConstruct and stopping it on PreDestroy. Is there any better way than this ? your help and suggestion is much appreciated.
I am using the following spring dependency and with the following application properties and java code.
Spring
The text was updated successfully, but these errors were encountered: