Http Inbound Gateway Problem
Hi,
I've a SI project with the following composition:
Code:
<int-http:inbound-gateway
request-channel="requestChannel"
name="/req"
supported-methods="GET"
mapped-request-headers="*"
reply-channel="responseChannel"/>
<int:channel id="requestChannel"/>
<int:channel id="responseChannel"/>
<int:chain input-channel="requestChannel" output-channel="messageSubscriber">
<int:transformer ref="requestTransformer" />
<int:header-enricher >
<int:header name="ad_correlation_id" expression="T(java.util.UUID).randomUUID().toString()" />
</int:header-enricher>
</int:chain>
<int:publish-subscribe-channel id="messageSubscriber" task-executor="executor" />
<task:executor id="executor" pool-size="6" />
<int:service-activator input-channel="messageSubscriber"
output-channel="channelPreAggregation"
ref="service1"/>
<int:service-activator input-channel="messageSubscriber"
output-channel="channelPreAggregation"
ref="service2"/>
<int:channel id="channelPreAggregation"/>
<int:chain input-channel="channelPreAggregation" output-channel="responseChannel">
<int:aggregator correlation-strategy-expression="headers.get('ad_correlation_id')" release-strategy-expression="size() == 2" />
<int:transformer ref="toStringlTransformer" />
</int:chain>
Everything seem to be working perfectly, no error and the expected message is arriving to my last toString transformer and is sent to the final response channel. The weird thing is that the gateway sometimes doesn't return the message, I get a 200 OK but nothing in the payload despite I can see in log file and debugging that I'm sending to the final response channel the right information.
This only happens sometimes (always in the first call when I start the server), the rest of the times everything works fine.
The problem seems to be in the task executor, because if I remove it, everything run ok, but I would like to call to the two services activator at the same time, not sequentially, so I need the task executor (or is there other possibility???).
Any idea?? Maybe a problem with threads??
Thanks in advance.