Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Producer flow control is necessary to stop clients from overwhelming a broker if messages are not being consumed fast enough, this is filed in Jira as QPID-942. To implement this, the following changes are necessary:

Client:
send() needs to become potentially blocking, if the producer has been flow controlled then send() should not return until the message has been delivered to the brokereither throw an exception (which will be the default behaviour), or it will block until the producer has been unflowed (this will only occur of a system property has been set).

BrokerBroker:
When a message has been enqueued, the broker should check if the producer is publishing to a queue which has violated it's policy, if so then the producer will be flow controlled. When a consumer has had a message delivered, if the queue is no longer violating it's policy then producers will be unflow controlled. This check will occur after enqueing so as not to slow down the broker.

...

The management console will also gain a "stop all producers" connect option button to enable immediate throttling of runaway producers.throttling of arbitary queues, and a "start all producers" button which will start all flowed producers.

Disadvantages of this approach

The producer will not be flowed until they publish to a queue which is violating it's policy, so if you have N producers each publishing to a queue, you will get N messages on top of the one that pushes the queue into a delinquent state.