问题
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:
I think Retry best fits to your requirements:
To retry deliveries, convenient listener adapters -
RetryingMessageListenerAdapterandRetryingAcknowledgingMessageListenerAdapterare provided, depending on whether you are using aMessageListeneror anAcknowledgingMessageListener.
来源:https://stackoverflow.com/questions/41346179/kafkamessagelistenercontainer-reprocess-a-message-if-there-is-servicedown-except