Я создал конфигурацию Splitter Aggregator, которая будет разбивать сообщения, и каждое сообщение будет направляться конкретному активатору службы.Внутри каждого активатора службы он будет вызывать шлюз, который вызывает службу SOAP с использованием CXF.Я попытался поместить тайм-аут ответа в шлюзы SOAP, но он не работает и все еще продолжает ожидать службы и собирает сообщение.То, что я сейчас сделал в своем коде, помещает тайм-аут ответа в шлюз сообщений.
Но проблема в том, что в случае сбоя одного сервиса из-за тайм-аута остальная часть сообщения, которое отправится в агрегатор, также будетошибка, потому что они принадлежат к одной и той же группе сообщений.
Я также попытался добавить send-частичный результат-на-expiry = "true" в мой агрегатор, но он все еще возвращает ошибку тайм-аута.
Есть ли способ установить таймаут в активаторе канала или службы?или в SOAP шлюзах?так что, если одно сообщение не получится из-за тайм-аута, оно не повлияет на успешное?
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns=".....">
<context:component-scan base-package="com.t460.wilkins.services.impl"/>
<!--The gateways and service activators that will call a designated SOAP service using CXF-->
<int:gateway id="FirstGateway" default-request-channel="firstChannel" service-interface="com.t460.wilkins.gateways.FirstGateway"/>
<int:gateway id="SecondGateway" default-request-channel="secondChannel" service-interface="com.t460.wilkins.gateways.SecondGateway"/>
<int:gateway id="ThirdGateway" default-request-channel="thirdChannel" service-interface="com.t460.wilkins.gateways.ThirdGateway"/>
<int:channel id="firstChannel"/>
<int:service-activator input-channel="firstChannel" ref="firstService" />
<int:channel id="secondChannel"/>
<int:service-activator input-channel="secondChannel" ref="secondService" />
<int:channel id="thirdChannel"/>
<int:service-activator input-channel="thirdChannel" ref="thirdService" />
<!--Configuration for the Splitter Aggregator-->
<!-- The gateway that will invoke the Splitter Aggregator. The gateway that will pass the initial message
and gather the aggregated message-->
<int:gateway id="MessageGateway" service-interface="com.t460.wilkins.gateways.MessageGateway" default-request-channel="asyncSenderChannel" default-reply-channel="asyncSenderChannel" default-reply-timeout="5000"/>
<int:channel id="asyncSenderChannel"/>
<int:channel id="asyncReceiverChannel"/>
<!-- Splitter-->
<int:splitter input-channel="asyncSenderChannel" output-channel="routingChannel" id="messageSplitter" ref="messageSplitter" />
<int:channel id="routingChannel"/>
<!-- Router -->
<int:recipient-list-router id="recipientWithSelector" input-channel="routingChannel">
<int:recipient channel="firstSplitChannel" selector-expression="headers.msgType eq 'First'"/>
<int:recipient channel="secondSplitChannel" selector-expression="headers.msgType eq 'Second'"/>
<int:recipient channel="thirdSplitChannel" selector-expression="headers.msgType eq 'Third'"/>
</int:recipient-list-router>
<int:channel id="firstSplitChannel">
<int:queue/>
</int:channel>
<int:channel id="secondSplitChannel">
<int:queue/>
</int:channel>
<int:channel id="thirdSplitChannel">
<int:queue/>
</int:channel>
<!-- These are the service activators where the splitted messages will be routed. Inside their classes, they each invoke the
an appropriate gateway listed above to get a data from a SOAP service using cxf-->
<int:service-activator input-channel="firstSplitChannel" output-channel="aggregateChannel"
ref="firstSoapActivator">
<int:poller receive-timeout="1000" task-executor="taskExecutor" fixed-rate="5"/>
</int:service-activator>
<int:service-activator input-channel="secondSplitChannel" output-channel="aggregateChannel"
ref="secondSoapActivator">
<int:poller receive-timeout="1000" task-executor="taskExecutor" fixed-rate="5"/>
</int:service-activator>
<int:service-activator input-channel="thirdSplitChannel" output-channel="aggregateChannel"
ref="thirdSoapActivator">
<int:poller receive-timeout="1000" task-executor="taskExecutor" fixed-rate="5"/>
</int:service-activator>
<!--Aggregator-->
<int:channel id="aggregateChannel"/>
<int:aggregator input-channel="aggregateChannel" output-channel="asyncReceiverChannel" id="aggregator"
ref="componentsAggregator" correlation-strategy="componentsCorrelationStrategy"
release-strategy="componentsReleaseStrategy" expire-groups-upon-completion="true" send-partial-result-on-expiry="true"/>
<!--Task Executor-->
<task:executor id="taskExecutor" pool-size="10-1000"
queue-capacity="5000"/>
--- ОБНОВЛЕНИЕ ----
Я попытался удалитьтайм-аут ответа шлюза сообщений и вместо этого укажите активаторы отправки send-timeout = "5000", но агрегатор все еще ожидает прибытия всех сообщений.
Я также попытался установить тайм-аут ответа на шлюзах SOAP«FirstGateway», «SecondGateway», «ThirdGateway», но он все еще проталкивается и ждет всех сообщений.