对于最新稳定版本,请使用spring-cloud-stream 5.0.1spring-doc.cadn.net.cn

自定义AdminClient配置项

与上面的消费者和生产者配置自定义一样,应用程序也可以通过提供一个AdminClientConfigCustomizer来自定义管理客户端的配置。 管理员ClientConfigCustomizer的configure方法提供了对管理员客户端属性的访问,可以使用这些属性定义进一步自定义。 Binder的Kafka主题提供程序对通过此自定义程序给出的属性具有最高优先级。 下面是一个提供此自定义程序 bean 的示例。spring-doc.cadn.net.cn

@Bean
public AdminClientConfigCustomizer adminClientConfigCustomizer() {
    return props -> {
        props.put(CommonClientConfigs.SECURITY_PROTOCOL_CONFIG, "SASL_SSL");
    };
}