KIP-1222 (Apache Kafka 4.2) added AcknowledgeType.RENEW — a fourth ack type that extends the acquisition lock on a record when processing takes longer than group.share.record.lock.duration.ms (default 30s). Without it, long-running records time out and are redelivered to another consumer.
ShareAcknowledgment exposes acknowledge() (ACCEPT), release() (RELEASE), and reject() (REJECT). AcknowledgeType.RENEW is not wired through currently.
Changes needed
- Add
renew() to ShareAcknowledgment
- Add the corresponding override in
ShareConsumerAcknowledgment mapping to AcknowledgeType.RENEW
- Update
ShareAcknowledgment Javadoc to list RENEW
RENEW is non-terminal — it resets the lock timer but a terminal ack (ACCEPT, RELEASE, or REJECT) is still required afterward. acknowledgeInternal() currently uses compareAndSet(null, type) which prevents any second call on the same record. This needs to allow RENEW followed by a terminal acknowledgment.
KIP-1222 (Apache Kafka 4.2) added
AcknowledgeType.RENEW— a fourth ack type that extends the acquisition lock on a record when processing takes longer thangroup.share.record.lock.duration.ms(default 30s). Without it, long-running records time out and are redelivered to another consumer.ShareAcknowledgmentexposesacknowledge()(ACCEPT),release()(RELEASE), andreject()(REJECT).AcknowledgeType.RENEWis not wired through currently.Changes needed
renew()toShareAcknowledgmentShareConsumerAcknowledgmentmapping toAcknowledgeType.RENEWShareAcknowledgmentJavadoc to listRENEWRENEWis non-terminal — it resets the lock timer but a terminal ack (ACCEPT,RELEASE, orREJECT) is still required afterward.acknowledgeInternal()currently usescompareAndSet(null, type)which prevents any second call on the same record. This needs to allowRENEWfollowed by a terminal acknowledgment.