Inspirel banner

Programming Distributed Systems with YAMI4

4.3.18 Incoming Water Marks

The agent manages a single incoming message queue, where messages collected from all channels are stored until they are dispatched into user-provided message handlers.

If the program processes messages slower than they arrive from remote clients, the incoming message queue grows. In order to protect itself from overflowing this queue, the agent uses a flexible mechanism that allows to suppress the reception of incoming network packets in order to give the program enough time to cope with the work.

There are two values that manage the flow control for incoming messages - the high water mark and the low water mark.

The high water mark is an upper limit for the number of messages in the incoming message queue. If this limit is reached, the reception of incoming packets is suppressed (that is, the remote clients are forced to slow down) until the queue is consumed to the level defined by low water mark.

Property name: "incoming_high_water_mark".

Property type: integer, should be a non-negative number.

Default value: 100.

Property name: "incoming_low_water_mark".

Property type: integer.

Default value: 20, should be a non-negative number and not greater than high water mark.