KafkaMessageListenerContainer reprocess a message if there is servicedown exception

冷暖自知 提交于 2019-12-11 09:29:24

问题


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 - RetryingMessageListenerAdapter and RetryingAcknowledgingMessageListenerAdapter are provided, depending on whether you are using a MessageListener or an AcknowledgingMessageListener.



来源:https://stackoverflow.com/questions/41346179/kafkamessagelistenercontainer-reprocess-a-message-if-there-is-servicedown-except

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!