gpt4 book ai didi

java - Spring Service Activator - 我们可以对 Java 中的两个不同输入 channel 使用相同的方法和 ref 吗?

转载 作者:行者123 更新时间:2023-12-01 18:58:08 25 4
gpt4 key购买 nike

我们有一个通用代码来执行相同的逻辑,但输入 channel 会有所不同。请参阅示例

<int:service-activator input-channel="exampleChannel_1" ref="somePojo" method="someMethod"/>
<int:service-activator input-channel="exampleChannel_2" ref="somePojo" method="someMethod"/>

我们可以这样使用吗?我应该将 someMethod 作为同步方法吗?

最佳答案

是的,你可以做到。至于同步,这取决于服务激活器的实际实现以及是否存在任何并发问题。如果没有看到它,我们就无法回答这个问题。无论如何,同步问题与 spring-integration 无关。

关于java - Spring Service Activator - 我们可以对 Java 中的两个不同输入 channel 使用相同的方法和 ref 吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59658797/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com