仅使用 spring cloud stream kafka streams binder 自动创建生产者主题

Only auto-create producer topics using spring cloud stream kafka streams binder

是否可以仅针对应用程序生成的主题在 application.yml 中启用 spring.cloud.stream.kafka.streams.binder.auto-create-topics,而不是自动创建应用程序使用的主题?我希望我的制作人只负责创建主题。我正在使用 spring-cloud-streams 和 kafka-streams 活页夹。

从更一般的意义上讲,这是创建 kafka 主题的正确方法吗?

它是活页夹,不是绑定,属性所以,不是。

但是,您可以使用多绑定程序支持并根据需要定义 2 个 属性 设置的 kafka 绑定程序,一个用于生产者绑定,另一个用于消费者绑定。

https://docs.spring.io/spring-cloud-stream/docs/3.0.10.RELEASE/reference/html/spring-cloud-stream.html#multiple-binders

我建议您在针对活页夹的 GitHub 问题中打开一个新功能建议,允许活页夹 属性 在绑定级别被覆盖。

https://github.com/spring-cloud/spring-cloud-stream-binder-kafka/issues