1

I use Spring KafKa anf I set ackMode to MANUAL_IMMEDIATE

props.setAckMode(AbstractMessageListenerContainer.AckMode.MANUAL_IMMEDIATE);

the scenario is that for some reason my app could not acknowledge (acknowledgment.acknowledge()) and just miss it without exception.

1- How can I set consumer retry for missed message 2- How configure to call a function after max retry count that I configured reached

mohsenJsh
  • 2,048
  • 3
  • 25
  • 49

1 Answers1

1

See the documentation about SeekToCurrentErrorHandlers.

When the listener throws an exception, the error handler will perform the necessary seeks and re-fetch the record. You can set the number of attempts before giving up.

There is also a DeadLetterPublishingRecoverer which can be used to send the failed record to another topic.

krishnakumarp
  • 8,967
  • 3
  • 49
  • 55
Gary Russell
  • 166,535
  • 14
  • 146
  • 179
  • thanks for answer, is there any way that without throwing exception (after a timeout without acknowledgment) listener retry – mohsenJsh Feb 05 '19 at 13:37