KafkaMessageListenerContainer reprocess a message if there is servicedown exception

838 views Asked by At

We want to have a Spring Kafka listener configured in such a way that if any external service is down we don't want to loose the message that's consumed from Kafka. we want to revert it back till it is successfully processed.

could you please help with the configuration that I can use to achieve the same.

How can I handle it if I consume the message in batches.

We are using Kafka 0.9

1

There are 1 answers

2
Artem Bilan On

I think Retry best fits to your requirements:

To retry deliveries, convenient listener adapters - RetryingMessageListenerAdapter and RetryingAcknowledgingMessageListenerAdapter are provided, depending on whether you are using a MessageListener or an AcknowledgingMessageListener.