@streamlistener在applicationrunner运行execute之前开始使用

p1tboqfb  于 2021-07-08  发布在  Java
关注(0)|答案(1)|浏览(303)

我们正在使用SpringCloud来消费来自kafka的消息。在@streamlistener开始读取消息之前,我们需要在实现applicationrunner的类中发出http请求。在这个类中,我们停止bindingsendpoint.changestate的绑定,发送请求,然后启用绑定。
但是,消息甚至在应用程序启动之前就被消耗掉了。
如何让@streamlistener在applicationrunner之后工作?
或者在@streamlistener之前还有其他方法发出http请求?

jv2fixgn

jv2fixgn1#

设置消费者 autoStartup 将属性绑定到 false 防止它在跑步者之前启动。

相关问题