Abstract
Flow control ensures that the rate at which messages are transmitted from the publisher to the receiver is controlled. Back-pressure is exerted when the defined global memory threshold or message count threshold per connection is exceeded. At this point, message acceptance is blocked until the sender is notified of memory recovery. In the meantime, a background process constantly checks whether the memory is recovered, and when the memory is available the sender is notified and can resume sending messages to the server. Flow control configurations are defined in the <MB_HOME>/repository/conf/advanced/andes-config.xml
file.
Introduction
“Flow control” can generally be identified as a technique that is typically Flow control is typically employed in controlling fast producers from overloading slow consumers , in producer-consumer scenarios.There exists quite a few cases that might lead to There may be several reasons for a fast producer-slow consumer scenariosscenario. For example, if we consider an instance where the consumer is incapable of handling the rate of messages being produced due to various reasons such as, being on low resource footprint, etc, there could be a definite chance that the Message Brokerthe consumer can be on a low resource footprint; or the message broker, which lies in the middle of the producer and the consumer, gets may get overloaded at a particular moment as a result of due to message accumulation within the Broker broker itself. This can cause Message Broker message broker instances to run out of resources, such as memory, etc. Therefore, it’s required to have a mechanism in place which would prevent the fast publishers from overwhelming the Message Broker, in the presence of slow consumers as well as in many other scenarios if exerted, would overload the Message Broker.Implementation.
WSO2 Message Broker, primarily supports memory-based flow controlling.
...
You can configure an MB server instance using two parameters; <globalMemoryTreshold>
(default value is 0.4) and
...
<globalMemoryRecoveryThreshold>
(default value is 0.5)
...
. The global memory threshold is the memory threshold at which flow controlling is
...
enabled, whereas the global memory recovery threshold is the memory threshold at which flow controlling is disabled and
...
message publishing
...
is resumed. The rate at which messages are transmitted is controlled by exerting back-pressure when the defined global memory threshold or message count threshold per connection exceeds. At this point, message acceptance is blocked temporarily until the producer is notified of memory recovery. In the meantime, a background process constantly checks whether the memory is recovered, and when the memory is available, the producer is notified and can resume sending messages to the server. Flow control configurations are defined in the <MB_HOME>/repository/conf/advanced/andes-config.xml
file.
In an event where a message
...
is not
...
published within a configurable amount of time
...
(defined by the
...
qpid.flow_control_wait_failure
...
system property with a default value of 120s) at the client-end, the client
...
connection
...
established with the server for the task of message publishing is terminated and an error is thrown.
...
The qpid.flow_control_wait_notify_period
...
system property (default value is 5s) can effectively be used to print a log message periodically after the configured amount of time.