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
[Service Bus] Make use of sendable event when sending messages #4764
Comments
When attempting to send over 100000 messages continuously, Based on this sample, the error was getting thrown at instances when total number of messages sent were 20000, 40000, 70000. These message count markers are consistent across multiple runs. Also, the MaxListenersExceededWarning is showing up as well - so in case we are working on updating the implementation to use the new |
Hi @chradek, we deeply appreciate your input into this project. Regrettably, this issue has remained inactive for over 2 years, leading us to the decision to close it. We've implemented this policy to maintain the relevance of our issue queue and facilitate easier navigation for new contributors. If you still believe this topic requires attention, please feel free to create a new issue, referencing this one. Thank you for your understanding and ongoing support. |
In the service-bus package, we perform a check to see if the sender has credits to send messages via the
sendable()
method:azure-sdk-for-js/sdk/servicebus/service-bus/src/core/messageSender.ts
Line 265 in 56bd4aa
If the sender isn't ready to send messages, we force a retry to give the service a chance to give us more credits:
azure-sdk-for-js/sdk/servicebus/service-bus/src/core/messageSender.ts
Lines 380 to 389 in 56bd4aa
The rhea sender emits a
sendable
event once more credits are allocated by the service (receiver).https://github.com/amqp/rhea#sendable-1
Instead of throwing an error, we could attach an event listener for the
sendable
event and attempt to send the message if it gets triggered. We would still have a timeout that would force a retry as we do for the normal path today. This would allow us to send messages more quickly rather than waiting for the retry delay to complete before checking if the sender is sendable again.The text was updated successfully, but these errors were encountered: