0
votes

I have a problem with spring integration basically I'am trying to create chain which will invoke 1 of several services and returns result as reply to chain gateway for further processing.

<int:chain input-channel="inputChannel" output-channel="outputChannel">
    <int:header-enricher>
        <int:header name="temporalPayload" expression="payload"/>
        <int:header name="matcher" value="other" />
    </int:header-enricher>
    <int:gateway request-channel="routerChannel" reply-channel="replyChannel" error-channel="errorChannel"/>
    <int:transformer expression="headers.temporalPayload"/>
</int:chain>

<int:router input-channel="routerChannel" expression="headers.matcher.matches('(test)|(test2)')?headers.matcher:'other'" >
    <int:mapping value="test1" channel="channel1"/>
    <int:mapping value="test2" channel="channel2"/>
    <int:mapping value="other" channel="channel3" />
</int:router>

<int:service-activator input-channel="channel1" output-channel="replyChannel" ref="service1" method="handle"/>
<int:service-activator input-channel="channel2" output-channel="replyChannel" ref="service2" method="handle"/>
<int:service-activator input-channel="channel3" output-channel="replyChannel" ref="service3" method="handle"/>

Problem that gateway does not receive reply to channel "replyChannel" from service-activator. What I'am doing wrong?

1

1 Answers

0
votes

You can turn on DEBUG logging level for org.springframework.integration category and observe how your message travels.

On the other hand, in most cases you don’t need that reply-Channel on the gateway and just rely on the replyChannel header populated by the gateway. In this case you even have to remove the output-Channel on the service-activators.

There might be some subscriber for your repjyChannel who steals messages for the Gateway.

You can try without reply-Channel or investigate logs as I suggested above.