Skip to content
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

Closed
chradek opened this issue Aug 14, 2019 · 2 comments
Closed

[Service Bus] Make use of sendable event when sending messages #4764

chradek opened this issue Aug 14, 2019 · 2 comments
Labels
Client This issue points to a problem in the data-plane of the library. Service Bus

Comments

@chradek
Copy link
Contributor

chradek commented Aug 14, 2019

In the service-bus package, we perform a check to see if the sender has credits to send messages via the sendable() method:

If the sender isn't ready to send messages, we force a retry to give the service a chance to give us more credits:

// let us retry to send the message after some time.
const msg =
`[${this._context.namespace.connectionId}] Sender "${this.name}", ` +
`cannot send the message right now. Please try later.`;
log.error(msg);
const amqpError: AmqpError = {
condition: ErrorNameConditionMapper.SenderBusyError,
description: msg
};
reject(translate(amqpError));

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.

@chradek chradek added Client This issue points to a problem in the data-plane of the library. Service Bus labels Aug 14, 2019
@ramya-rao-a ramya-rao-a added this to the Sprint 157 milestone Aug 15, 2019
@ramya0820
Copy link
Member

When attempting to send over 100000 messages continuously, SenderBusyError used to get thrown repeatedly and further messages were not getting sent even when re-tried infinitely.
Thus, needed to catch this error and then re-establish the sender links such as at - https://github.com/ramya0820/azure-sdk-for-js/blob/service-bus-track-1-1.0.3/sdk/servicebus/service-bus/test/customer_issues/1389/1.0.2/send.ts

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 AwaitableSender, that might potentially help resolve multiple issues at once.

Copy link

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.

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Mar 25, 2024
@github-actions github-actions bot locked and limited conversation to collaborators Mar 25, 2024
@xirzec xirzec removed this from the Backlog milestone May 7, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Client This issue points to a problem in the data-plane of the library. Service Bus
Projects
Status: Done
Development

No branches or pull requests

4 participants