如果 autoStartup 设置为 false,如何手动启动 Spring Cloud Stream Binders [英] How do I start Spring Cloud Stream Binders manually if autoStartup is set to false

查看:36
本文介绍了如果 autoStartup 设置为 false,如何手动启动 Spring Cloud Stream Binders的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用 spring-cloud-starter-stream-kafka 创建一个 Kafka 消费者绑定并且我已经配置了 spring.cloud.stream.bindings.input.consumer.autoStartupfalse

I'm using spring-cloud-starter-stream-kafka to create a Kafka consumer binding and I've configured spring.cloud.stream.bindings.input.consumer.autoStartup to false

(https://cloud.spring.io/spring-cloud-static/spring-cloud-stream/2.2.0.RELEASE/spring-cloud-stream.html#_consumer_properties).

我想知道我必须在什么时候注入什么才能启动活页夹(例如通过属性启用的配置).我找不到任何关于此的文档.

I want to know what I have to inject at which time to start the binder (for example through a configuration which is enabled by property). I was not able to find any documentation about this.

谢谢.

推荐答案

使用 BindingsEndpoint bean 更改状态.

Use the BindingsEndpoint bean to change the state.

查看我对这个问题的回答.

目前,执行器必须在类路径上.

Currently, the actuator has to be on the class path.

这篇关于如果 autoStartup 设置为 false,如何手动启动 Spring Cloud Stream Binders的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆