Distributed Message Service (Kafka)

Consumption Blocking and Message Accumulation

2024-05-09 08:49:08

Consumption accumulation is the most common issue for consumer clients. The issue may be caused by the following reasons:

(1) The consumption rate is lower than the production rate. In this case, you must increase the consumption rate. For more information, see the section of Increasing Consumption Rate.

(2) The consumer thread is blocked.

After a consumer receives a message, the consumer initiates remote calls to execute the consumption logic. If the consumer waits for the call result during this process, the consumer may keep waiting. This causes the consumption process to suspend.

A consumer must try to prevent the consumption thread from being blocked. If a consumer needs to wait for the call result, we recommend that you specify a timeout period for waiting. This way, if no result is returned after the timeout period elapses, the consumption is considered failed and the subsequent messages can continue to be consumed.


O7Gct63dncSn