Good evening!
Can you explain what is the reason to use some custom correlation?
Here is some snapshot of your flow:
HTML Code:
<gateway id="testGateway"
service-interface="org.springframework.integration.handler.PublishSubscribeAggregationTests$TestGateway">
<method name="gateway" request-channel="subscriber"/>
</gateway>
<publish-subscribe-channel id="subscriber" task-executor="executor" apply-sequence="true"/>
<task:executor id="executor" pool-size="6"/>
<service-activator input-channel="subscriber" output-channel="aggregation" expression="payload.toUpperCase()"/>
<service-activator input-channel="subscriber" output-channel="aggregation" expression="payload.toLowerCase()"/>
<aggregator input-channel="aggregation"/>
And the test class:
Code:
@ContextConfiguration
@RunWith(SpringJUnit4ClassRunner.class)
public class PublishSubscribeAggregationTests {
@Autowired
private TestGateway gateway;
@Test
public void testPublishSubscribeAggregation() {
String payload = "gGHdsdHrghdf";
for (int i = 0; i < 100; i++) {
List<String> result = gateway.gateway(payload);
assertEquals(2, result.size());
assertThat(result, Matchers.hasItems(payload.toUpperCase(), payload.toLowerCase()));
}
}
private static interface TestGateway {
List<String> gateway(String payload);
}
}
So, as Oleg said it seems like a problem of your services. Maybe it depends on request parameters which you are using in those services?
Can you simplify them as I've shown above and test again?
Cheers,
Artem