we are using kafka to implement a driven event application, and have a lot of rebalancing between the consumers in the group.
we are polling max 100 event each time and the event processing takes 2-10 minutes. we keep TTL for each message and after a while most of the messages are expired (it takes more than 1.5 hour until the message is being consumed) currently we have about 10000 messages to this topic in one hour and 3 consumers. The behavior that we see is that while producing 10000 in one hour we consume 25000 messages in this time, the same message is being consumed by more than one consumer. we are using the default commit strategy.
we get a lot of :
failed: Commit cannot be completed since the group has already rebalanced and assigned the partitions to another member. This means that the time between subsequent calls to poll() was longer than the configured max.poll.interval.ms, which typically implies that the poll loop is spending too much time message processing. You can address this either by increasing max.poll.interval.ms or by reducing the maximum size of batches returned in poll() with max.poll.records.
I found:
and I want to try it but I dont know how to configure the group.max.session.timeout.ms in the broker.
I also found:
Why can't I increase session.timeout.ms?
how can I get the ConsumerConfig content as described in this question?
Thanks, Eilon