Symptoms

When a consumer client uses the StickyAssignor policy to consume messages, multiple consumer threads consume the same partition. As a result, messages cannot be processed as expected.

Causes

The version of your client is earlier than 2.3. Clients whose version is earlier than 2.3 may assign the same partition to multiple consumption threads for consumption.

For more information, see Sticky assignor could assign a partition to multiple consumers (KIP-341).

Solutions

We recommend that you update the version of your client to 2.3 or later or use another partition assignment policy.

If you use the StickyAssignor policy, assignment issues such as the duplicate assignment of partitions can occur in some cases. We recommend that you do not use this assignment policy unless necessary.