Skip to content

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

Description

@RKushnir

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions