使用Kafka Streams绑定器和Function Style Processor处理Spring Cloud Streams中的异常处理示例 [英] Example on handling processing exception in Spring Cloud Streams with Kafka Streams Binder and the functional style processor
问题描述
我将Spring Cloud Streams与Kafka Streams绑定器一起使用,功能 样式处理器API和多处理器。
以这种方式配置一个具有多个处理器和多个Kafka主题的处理应用程序,并使用/Actuator、WebClient等方式保持在Spring Boot领域,这真的很酷。事实上,我更喜欢它,而不是使用纯阿帕奇Kafka Streams。
但是:我希望为处理器内发生的异常集成异常处理,并将这些无法处理的消息发送到DLQ。我已经为反序列化错误设置了DLQ,但除了在类似问题上的sobychacko's answer之外,我找不到任何关于实现这一点的好建议。但这只是一个片段!有谁有更详细的例子吗?我问这个是因为Spring Cloud Stream documentation on branching looks quite different。
推荐答案
很高兴听到您将Spring Cloud Stream与Kafka Streams配合使用的消息。
您提到的参考文档来自旧版本。请从此页面导航到较新的文档:https://spring.io/projects/spring-cloud-stream#learn
这个问题以前就提过。看看这些对您的用例是否有帮助:
Error handling in Spring Cloud Kafka Streams
How to stop sending to kafka topic when control goes to catch block Functional kafka spring
这篇关于使用Kafka Streams绑定器和Function Style Processor处理Spring Cloud Streams中的异常处理示例的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!