使用Spring Cloud Stream Kafka的编程方式读取消息。

huangapple go评论64阅读模式
英文:

Programmatic way to read message using spring cloud stream kafka

问题

我有一个主题和与之关联的DLQ。我正在使用@StreamListener处理这个主题。
我想要使用控制器端点按需从DLQ中读取/处理消息。
是否可以使用Spring Cloud Stream Kafka来实现这一点。
在生产环境中,我们没有使用执行器(actuator)。因此无法使用/bindings端点。

英文:

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.

is it possible to do this using spring cloud stream Kafka.

We are not using actuator in production. So can not use /bindings endpoints.

答案1

得分: 1

你不需要通过网络启用执行器,但需要将执行器启动器添加到类路径中;然后,您可以使用此问题的答案中提到的技术:https://stackoverflow.com/questions/58795176/stop-consume-message-for-stream-listener

正如在那里的评论中指出的那样,存在一个未解决的问题,即将这个功能与执行器分开。

英文:

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: https://stackoverflow.com/questions/58795176/stop-consume-message-for-stream-listener

As noted in the comments there, there is an open issue to separate the functionality from the actuator.

huangapple
  • 本文由 发表于 2020年9月7日 22:18:36
  • 转载请务必保留本文链接:https://go.coder-hub.com/63779394.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定