【问题标题】:Multiple service activators of same input channel in spring integrationSpring集成中相同输入通道的多个服务激活器
【发布时间】:2016-05-30 18:32:42
【问题描述】:

我需要以两种不同的方式异步处理请求的相同信息。我在我的项目中使用弹簧集成。
我可以让两个服务激活器从以下相同的输入通道读取吗?我将通过适配器从队列中获取数据并转发到通道。

<int:channel id="dataChannel" />

<service-activator input-channel="dataChannel" ref="serviceA" method="method1">

<service-activator input-channel="dataChannel" ref="serviceB" method="method2">

<bean id="serviceA" class="a.b.test.ServiceA">

<bean id="serviceB" class="a.b.test.ServiceB">

【问题讨论】:

    标签: java spring spring-integration


    【解决方案1】:

    dataChannel改为

    <int:publish-subscribe-channel id=`dataChannel` task-executor="exec" />
    

    (声明&lt;task:executor ... /&gt;)。

    【讨论】:

      猜你喜欢
      • 2018-09-14
      • 1970-01-01
      • 1970-01-01
      • 2013-01-08
      • 2019-12-28
      • 1970-01-01
      • 1970-01-01
      • 2013-02-02
      • 2018-05-21
      相关资源
      最近更新 更多