使用spring cloud stream kafka读取消息的编程方式 [英] Programmatic way to read message using spring cloud stream kafka
问题描述
我有一个主题和与之相关的 DLQ.我正在使用@StreamListener 作为主题.我想使用控制器端点按需读取/处理来自 DLQ 的消息.
I have a topic and DLQ associated with it. I am using @StreamListener for the topic. I wanted to read/process the messages from the DLQ on demand using a controller endpoint.
是否可以使用 Spring Cloud Stream Kafka 来做到这一点.
is it possible to do this using spring cloud stream Kafka.
我们没有在生产中使用执行器.所以不能使用/bindings 端点.
We are not using actuator in production. So can not use /bindings endpoints.
推荐答案
您不需要通过 web 启用执行器,但需要将执行器启动器添加到类路径;那么你可以在这个问题的答案中使用该技术:停止使用流监听器的消息
You don't need to enable the actuators over web, but you need to add the actuator starter to the class path; then you can use the technique in the answer to this question: Stop consume message for Stream listener
如评论中所述,将功能与执行器分开存在一个未解决的问题.
As noted in the comments there, there is an open issue to separate the functionality from the actuator.
这篇关于使用spring cloud stream kafka读取消息的编程方式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!