在 Spring Cloud Stream 中使用 Spring 集成样式有什么优势
What are the advantages of using Spring Integration style within Spring Cloud Stream
我的任务是使用 Spring Cloud Stream(带有 Kafka 绑定)。完成 Spring Cloud Stream 的 Quick Start and judging from the Config file it uses, LogSinkConfiguration, it seems the recommendation here is to use Spring Integration patterns, e.g. @ServiceActivator(inputChannel = Sink.INPUT)
to connect to the input channel. However all the tutorials I've found are using a different set of annotations from the Spring Cloud Stream library (vs Spring Integration), i.e. @StreamListener(Processor.INPUT)
in this 演练。
那么 better/newer/preferred 是什么(即 "best practice" 是什么)。我应该使用 S.I 吗?使用 @ServiceActivator(inputChannel = Sink.INPUT)
或替代方案 @StreamListener(Processor.INPUT)
配置接收器的方式。这两种连接水槽的方法是否几乎相同,或者使用一种方法比另一种方法有优势?
在 2.0 中,我们引入了 spring-cloud-function 支持,随着即将发布的 3.0,我们现在完全致力于对任何注释驱动的功能支持(包括 Spring 集成)。
因此,要回答您的问题,功能支持是首选方式。这是 link 以获取更多信息,欢迎随时提出更具体的问题。
我的任务是使用 Spring Cloud Stream(带有 Kafka 绑定)。完成 Spring Cloud Stream 的 Quick Start and judging from the Config file it uses, LogSinkConfiguration, it seems the recommendation here is to use Spring Integration patterns, e.g. @ServiceActivator(inputChannel = Sink.INPUT)
to connect to the input channel. However all the tutorials I've found are using a different set of annotations from the Spring Cloud Stream library (vs Spring Integration), i.e. @StreamListener(Processor.INPUT)
in this 演练。
那么 better/newer/preferred 是什么(即 "best practice" 是什么)。我应该使用 S.I 吗?使用 @ServiceActivator(inputChannel = Sink.INPUT)
或替代方案 @StreamListener(Processor.INPUT)
配置接收器的方式。这两种连接水槽的方法是否几乎相同,或者使用一种方法比另一种方法有优势?
在 2.0 中,我们引入了 spring-cloud-function 支持,随着即将发布的 3.0,我们现在完全致力于对任何注释驱动的功能支持(包括 Spring 集成)。
因此,要回答您的问题,功能支持是首选方式。这是 link 以获取更多信息,欢迎随时提出更具体的问题。