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

How to provide backpressure when too many incoming messages? #145

Open
RKushnir opened this issue Feb 24, 2023 · 0 comments
Open

How to provide backpressure when too many incoming messages? #145

RKushnir opened this issue Feb 24, 2023 · 0 comments

Comments

@RKushnir
Copy link

Hi, thanks for making this package available to everyone.

I'd like your help to know what to do when my downstream service can't keep up with the rate of incoming messages. Tortoise.Handler.handle_message/3 is expected to always return :ok, so I can't signal an overflow this way. Some other things that came to my mind:

  • drop the messages (not great);
  • in the contrary to the recommendation, intentionally slow down handle_message by sleeping;
  • use QoS 1 and somehow not acknowledge message which I could not handle (I'm using QoS 0);
  • unsubscribe, using next_actions response from handle_message (how do I resubscribe later?)

I don't feel confident about any of the above ways. Is there another proper way to pause receiving messages? Thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant