Spring Cloud Stream kafka生产者,生产动态kafka主题

问题描述 投票:0回答:1

我想使用Spring Cloud Stream框架创建一个kafka端点,它将在/{topic_name}上添加一个http post api。如何动态更改spring.cloud.stream.bindings.<channelName>.destination={topic_name}属性

我可以使用confluent Kafka REST Proxy实现来实现上述功能,但想知道是否有可能在春季进行开发。

spring-cloud-stream
1个回答
0
投票

这里是一个示例,演示了这些类型的用例,其中基于HTTP触发器使用动态目标。看一下代码和自述文件。

https://github.com/spring-cloud/spring-cloud-stream-samples/tree/master/source-samples/dynamic-destination-source-kafka

© www.soinside.com 2019 - 2024. All rights reserved.