|
<?xml version="1.0" encoding="UTF-8"?> |
|
<beans xmlns="http://www.springframework.org/schema/beans" |
|
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" |
|
xmlns:int="http://www.springframework.org/schema/integration" |
|
xmlns:context="http://www.springframework.org/schema/context" |
|
xmlns:task="http://www.springframework.org/schema/task" |
|
xsi:schemaLocation="http://www.springframework.org/schema/integration http://www.springframework.org/schema/integration/spring-integration.xsd |
|
http://www.springframework.org/schema/task http://www.springframework.org/schema/task/spring-task.xsd |
|
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd |
|
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd"> |
|
|
|
<int:gateway id="gateway" |
|
service-interface="foo.Sample$MyGateway" |
|
default-reply-channel="reply" |
|
default-request-channel="input"/> |
|
|
|
<int:channel id="reply" /> |
|
|
|
<!-- use a pub-sub channel to insert aggregation headers --> |
|
|
|
<int:publish-subscribe-channel id="input" apply-sequence="true" task-executor="exec" /> |
|
|
|
<task:executor id="exec" pool-size="5" /> |
|
|
|
<!-- First error-handling gateway --> |
|
|
|
<int:service-activator ref="service1gw" input-channel="input" output-channel="agg" /> |
|
|
|
<int:gateway id="service1gw" default-request-channel="input1" error-channel="ec" /> |
|
|
|
<!-- Second error-handling gateway --> |
|
|
|
<int:service-activator ref="service2gw" input-channel="input" output-channel="agg" /> |
|
|
|
<int:gateway id="service2gw" default-request-channel="input2" error-channel="ec" /> |
|
|
|
<!-- Error flow ("catch" block) --> |
|
<int:channel id="ec" /> |
|
|
|
<int:transformer input-channel="ec" ref="foo" method="errorHandler" /> |
|
|
|
<!-- Resequence so we have deterministic results for tests --> |
|
|
|
<int:resequencer input-channel="agg" output-channel="agg2"/> |
|
|
|
<!-- Aggregates returned results from the error handling gateways --> |
|
|
|
<int:aggregator input-channel="agg2" ref="foo" method="aggregate" output-channel="reply" /> |
|
|
|
<int:channel id="input1" /> |
|
|
|
<int:channel id="input2" /> |
|
|
|
<int:service-activator id="service1" input-channel="input1" |
|
ref="foo" method="service" /> |
|
|
|
<int:service-activator id="service2" input-channel="input2" |
|
ref="foo" method="service" /> |
|
|
|
<!-- bean with methods for services and transformer --> |
|
|
|
<bean id="foo" class="foo.Sample"/> |
|
|
|
</beans> |