Batch Listener(AckMode.MANUAL_IMMEDIATE) acks message even if acknowledgment.acknowledge() is not invoked #3982
Unanswered
HimanshuLakra
asked this question in
Q&A
Replies: 1 comment
-
Hi @artembilan @sobychacko, Could anyone please help with above query? Thanks |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi
I have a query regarding working of MANUAL_IMMEDIATE mode with BatchAcknowledgingMessageListener.
In the onMessage function if I do not invoke acknowledgment.acknowledge() the messages are still getting acked, is this expected?
Spring Kafka: 3.3.0
enable.auto.commit = false
AckMode: AckMode.MANUAL_IMMEDIATE
Below is my onMessage function of
public class KafkaMessageBatchManualModeListener implements BatchAcknowledgingMessageListener<String, Object>
`@Override
public void onMessage(List<ConsumerRecord<String, Object>> data, Acknowledgment acknowledgment) {
My expectation is if I do not invoke acknowledgment.acknowledge(index) function (ref: else block or catch block case)
then my messages should get redelivered in next poll, but they get acked.
To stop that ack I have to explicitly use nack
`if(ackIndex != null){
`
Beta Was this translation helpful? Give feedback.
All reactions