INT-3540: Add <scatter-gather> to the <chain>

JIRA: https://jira.spring.io/browse/INT-3540
This commit is contained in:
Artem Bilan
2014-10-30 15:07:43 +02:00
parent 542fc4fb5e
commit 9e468e520a
3 changed files with 18 additions and 0 deletions

View File

@@ -1731,6 +1731,7 @@
<xsd:element name="claim-check-in" type="claimCheckInTypeChain"/>
<xsd:element name="claim-check-out" type="claimCheckOutTypeChain"/>
<xsd:element name="control-bus" type="control-bus-type"/>
<xsd:element name="scatter-gather" type="scatter-gather-type"/>
<xsd:element name="chain">
<xsd:complexType>
<xsd:sequence>

View File

@@ -58,4 +58,9 @@
<gatherer release-strategy-expression="^[payload gt 5] != null or size() == 3"/>
</scatter-gather>
<chain input-channel="scatterGatherWithinChain" output-channel="output">
<scatter-gather scatter-channel="auctionChannel"/>
<splitter/>
</chain>
</beans:beans>

View File

@@ -55,6 +55,9 @@ public class ScatterGatherTests {
@Autowired
private RequestReplyExchanger gateway;
@Autowired
private MessageChannel scatterGatherWithinChain;
@Test
public void testAuction() {
this.inputAuction.send(new GenericMessage<String>("foo"));
@@ -83,4 +86,13 @@ public class ScatterGatherTests {
assertThat(((List<?>) payload).size(), greaterThanOrEqualTo(1));
}
@Test
public void testWithinChain() {
this.scatterGatherWithinChain.send(new GenericMessage<String>("foo"));
for (int i = 0; i < 3; i++) {
Message<?> result = this.output.receive(10000);
assertNotNull(result);
}
}
}