0

私は SI は初めてですが、今ではたくさん読んでいます。すでに実装されているフローからもう 1 つ呼び出す必要があります。この呼び出しをブロックしないようにする必要があるため、チェーンはその実行を待機しません。別のシステムに送信され、ダウンしている可能性があります。

2 つのチャネルにメッセージを送信する必要があるため、recipient-list-router を無条件で使用しました。

<int:recipient-list-router id="processEngineRouter" input-channel="newApplicationChannel">
    <int:recipient channel="finishFlowChannel"/>
    <int:recipient channel="processEngineChannel"/>
</int:recipient-list-router>

が終了するfinishFlowChannelと、processEngineChannelが呼び出されます。これは問題ありませんが、問題は、非同期である必要がある Executor チャネルを使用している場合でも、入力newApplicationChannelが終了するまで待機することです。processEngineChannel

<int:channel id="finishFlowChannel"/>
<int:chain input-channel="finishFlowChannel" output-channel="apiReplyChannel">
    <!-- create response -->
    <int:transformer ref="xxToYYTransformer"/>
</int:chain>

<int:channel id="processEngineChannel">
    <int:dispatcher task-executor="taskExecutor"/>
</int:channel>
<int:chain input-channel="processEngineChannel">

    <!-- transform x to y -->
    <int:transformer ref="xToYTransformer"/>

    <!-- call PE -->
    <int:gateway request-channel="peRCh"/>
</int:chain>

プレフィックスはhttp://www.springframework.org/schema/task/spring-task.xsd バージョン 3.1 のもので、他の設定はありませ<task:executor id="taskExecutor"/>ん。task

ルーターの入力チャンネルは

<int:channel id="newApplicationChannel"/>
<int:channel id="naRequestChannel"/>
<int:chain input-channel="naRequestChannel" output-channel="newApplicationChannel">

    <int:transformer>
        ...
    </int:transformer>

    <si-xml:unmarshalling-transformer unmarshaller="xxMarshaller"/>

    <!-- enrich header with necessary data -->
    <int:header-enricher>
        ...
    </int:header-enricher>

    <!-- transform xx to yy -->
    <int:transformer ref="xxToYyTransformer"/>

    <!-- call yyy service -->
    <int:gateway request-channel="yyyServiceRequestChannel"/>

</int:chain>

をチェーンに追加するとうまくいきましたdelayerが、それはあまり良い解決策ではありません。

私の質問は、 taskExecutor を間違って使用していますか? 他にどのように呼び出しを非同期にすることができますか? イベントを繰り返しポーリングする必要がないため、キューを使用したくありません。

http-apr-8080-exec-2 14:39:23,530 DEBUG DirectChannel:224 - preSend on channel 'apiRequestChannel'
http-apr-8080-exec-2 14:39:23,534 DEBUG MessageHandlerChain:67 - org.springframework.integration.handler.MessageHandlerChain#4
http-apr-8080-exec-2 14:39:23,535 DEBUG MessageTransformingHandler:67 - org.springframework.integration.transformer.MessageTransformingHandler#4ac5c32e
http-apr-8080-exec-2 14:39:23,557 DEBUG MessageTransformingHandler:156 - handler 'org.springframework.integration.transformer.MessageTransformingHandler#4ac5c32e' sending reply 
http-apr-8080-exec-2 14:39:23,557 DEBUG HeaderValueRouter:67 - (inner bean)#16 received message: 
http-apr-8080-exec-2 14:39:23,558 DEBUG DirectChannel:224 - preSend on channel 'naRequestChannel', message: 
http-apr-8080-exec-2 14:39:23,558 DEBUG MessageHandlerChain:67 - org.springframework.integration.handler.MessageHandlerChain#33 received message: 
http-apr-8080-exec-2 14:39:23,558 DEBUG MessageTransformingHandler:67 - org.springframework.integration.transformer.MessageTransformingHandler@3cbcf04e received message: 
http-apr-8080-exec-2 14:39:23,565 DEBUG MessageTransformingHandler:156 - handler 'org.springframework.integration.transformer.MessageTransformingHandler@3cbcf04e' sending reply 
http-apr-8080-exec-2 14:39:23,566 DEBUG MessageTransformingHandler:67 - org.springframework.integration.transformer.MessageTransformingHandler#6a5c2445 received message: 
http-apr-8080-exec-2 14:39:23,594 DEBUG MessageTransformingHandler:156 - handler 'org.springframework.integration.transformer.MessageTransformingHandler#6a5c2445' sending reply 
http-apr-8080-exec-2 14:39:23,595 DEBUG MessageTransformingHandler:67 - org.springframework.integration.transformer.MessageTransformingHandler#47516490 received message: 
http-apr-8080-exec-2 14:39:23,596 DEBUG MessageTransformingHandler:156 - handler 'org.springframework.integration.transformer.MessageTransformingHandler#47516490' sending reply 
http-apr-8080-exec-2 14:39:23,596 DEBUG MessageTransformingHandler:67 - org.springframework.integration.transformer.MessageTransformingHandler@2342f67d received message: 
http-apr-8080-exec-2 14:39:23,597 DEBUG MessageTransformingHandler:156 - handler 'org.springframework.integration.transformer.MessageTransformingHandler@2342f67d' sending reply 
http-apr-8080-exec-2 14:39:23,598 DEBUG RequestReplyMessageHandlerAdapter:67 - (inner bean)#231 received message: 
http-apr-8080-exec-2 14:39:23,600 DEBUG DirectChannel:224 - preSend on channel 'dossierAddEventRequestChannel', message: 
http-apr-8080-exec-2 14:39:23,601 DEBUG PayloadTypeRouter:67 - (inner bean)#250 received message: 
http-apr-8080-exec-2 14:39:23,602 DEBUG DirectChannel:224 - preSend on channel 'dossierAddEventRequestGenericChannel', message: 
http-apr-8080-exec-2 14:39:23,602 DEBUG MessageHandlerChain:67 - org.springframework.integration.handler.MessageHandlerChain#41 received message: 
http-apr-8080-exec-2 14:39:23,603 DEBUG MessageTransformingHandler:67 - org.springframework.integration.transformer.MessageTransformingHandler#23bdb02e received message: http-apr-8080-exec-2 14:39:23,603 DEBUG MessageTransformingHandler:156 - handler 'org.springframework.integration.transformer.MessageTransformingHandler#23bdb02e' sending reply http-apr-8080-exec-2 14:39:23,604 DEBUG MessageTransformingHandler:67 - org.springframework.integration.transformer.MessageTransformingHandler@54054c41 received message: http-apr-8080-exec-2 14:39:23,606 DEBUG MessageTransformingHandler:156 - handler 'org.springframework.integration.transformer.MessageTransformingHandler@54054c41' sending reply http-apr-8080-exec-2 14:39:23,606 DEBUG DirectChannel:237 - postSend (sent=true) on channel 'dossierAddEventRequestGenericChannel', message: http-apr-8080-exec-2 14:39:23,607 DEBUG DirectChannel:237 - postSend (sent=true) on channel 'dossierAddEventRequestChannel', message: 
http-apr-8080-exec-2 14:39:23,607 DEBUG GatewayProxyFactoryBean:134 - Unable to attempt conversion of Message payload types. Component 'org.springframework.integration.gateway.GatewayProxyFactoryBean#2e29d50d' has no explicit ConversionService reference, and there is no 'integrationConversionService' bean within the context.
http-apr-8080-exec-2 14:39:23,608 DEBUG RequestReplyMessageHandlerAdapter:156 - handler '(inner bean)#231' sending reply Message: http-apr-8080-exec-2 14:39:23,608 DEBUG MessageTransformingHandler:67 - org.springframework.integration.transformer.MessageTransformingHandler@3f03c0ad received message: 
http-apr-8080-exec-2 14:39:23,609 DEBUG MessageTransformingHandler:156 - handler 'org.springframework.integration.transformer.MessageTransformingHandler@3f03c0ad' sending reply http-apr-8080-exec-2 14:39:23,611 DEBUG RequestReplyMessageHandlerAdapter:67 - (inner bean)#232 received message: http-apr-8080-exec-2 14:39:23,612 DEBUG DirectChannel:224 - preSend http-apr-8080-exec-2 14:39:23,612 DEBUG ServiceActivatingHandler:67 - ServiceActivator for [org.springframework.integration.handler.MethodInvokingMessageProcessor@4149888e] received http-apr-8080-exec-2 14:39:23,614 DEBUG DirectChannel:224 - preSend on channel 'dossierServiceRequestRouter', message: http-apr-8080-exec-2 14:39:23,614 DEBUG PayloadTypeRouter:67 - (inner bean)#17 received message: 
http-apr-8080-exec-2 14:39:23,615 DEBUG DirectChannel:224 - preSend on channel 'dossierServiceJaxbRequestChannel', message: http-apr-8080-exec-2 14:39:23,616 DEBUG MessageHandlerChain:67 - org.springframework.integration.handler.MessageHandlerChain#5 received message: 
http-apr-8080-exec-2 14:39:23,616 DEBUG MessageTransformingHandler:67 - org.springframework.integration.transformer.MessageTransformingHandler#7d8e9adf received message: http-apr-8080-exec-2 14:39:23,634 DEBUG MessageTransformingHandler:156 - handler 'org.springframework.integration.transformer.MessageTransformingHandler#7d8e9adf' sending reply http-apr-8080-exec-2 14:39:23,635 DEBUG RequestReplyMessageHandlerAdapter:67 - (inner bean)#18 received message: [Payload=[#document: null]][Headers={timestamp=1372768763634, http-apr-8080-exec-2 14:39:23,636 DEBUG DirectChannel:224 - preSend on channel 'dossierServiceDocumentRequestChannel', message: 
http-apr-8080-exec-2 14:39:23,636 DEBUG SimpleWebServiceOutboundGateway:67 - org.springframework.integration.ws.SimpleWebServiceOutboundGateway#0 received message: http-apr-8080-exec-2 14:39:24,206 DEBUG DirectChannel:237 - postSend (sent=true) on channel 'dossierServiceDocumentRequestChannel', message: [Payload=[#document: null]][Headers={timestamp=1372768763636, id=a193877c-0faf-4573-b6b4-97ca3cd25f66, errorChannel=org.springframework.integration.core.MessagingTemplate$TemporaryReplyChannel@3875c597, xp_dossierEvent_operator_username=afs-process, xp_dossierEvent_name=NewApplication, replyChannel=org.springframework.integration.core.MessagingTemplate$TemporaryReplyChannel@3875c597, xp_dossierEvent_dateTime=2013-07-02T14:39:23, xp_dossierEvent_details=Nieuwe aanvraag aangemaakt, xp_dossierEvent_operator_name=AFS Proces, xp_endUser=nl.vwpfs.pos.bpf.EndUser@598ef578, xp_businessFunctionName=NewApplication}]
http-apr-8080-exec-2 14:39:24,206 DEBUG GatewayProxyFactoryBean:134 - Unable to attempt conversion of Message payload types. Component 'org.springframework.integration.gateway.GatewayProxyFactoryBean#1d59e6df' has no explicit ConversionService reference, and there is no 'integrationConversionService' bean within the context.
http-apr-8080-exec-2 14:39:24,207 DEBUG RequestReplyMessageHandlerAdapter:156 - handler '(inner bean)#18' sending reply Message: 
http-apr-8080-exec-2 14:39:24,207 DEBUG MessageTransformingHandler:67 - org.springframework.integration.transformer.MessageTransformingHandler#79444986 received message: http-apr-8080-exec-2 14:39:24,218 DEBUG MessageTransformingHandler:156 - handler 'org.springframework.integration.transformer.MessageTransformingHandler#79444986' sending reply http-apr-8080-exec-2 14:39:24,219 DEBUG DirectChannel:237 - postSend (sent=true) on channel 'dossierServiceJaxbRequestChannel', message: http-apr-8080-exec-2 14:39:24,219 DEBUG DirectChannel:237 - postSend (sent=true) on channel 'dossierServiceRequestRouter', message: 
http-apr-8080-exec-2 14:39:24,219 DEBUG GatewayProxyFactoryBean:134 - Unable to attempt conversion of Message payload types. Component 'dossierServiceGateway' has no explicit ConversionService reference, and there is no 'integrationConversionService' bean within the context.
http-apr-8080-exec-2 14:39:24,220 DEBUG ServiceActivatingHandler:156 - handler 'ServiceActivator for http-apr-8080-exec-2 14:39:24,220 DEBUG GatewayProxyFactoryBean:134 - Unable to attempt conversion of Message payload types. Component 'org.springframework.integration.gateway.GatewayProxyFactoryBean#5e970110' has no explicit ConversionService reference, and there is no 'integrationConversionService' bean within the context.
http-apr-8080-exec-2 14:39:24,221 DEBUG RequestReplyMessageHandlerAdapter:156 - handler '(inner bean)#232' sending reply Message: http-apr-8080-exec-2 14:39:24,221 DEBUG DirectChannel:224 - preSend on channel 'newApplicationChannel', message: 
http-apr-8080-exec-2 14:39:24,221 DEBUG RecipientListRouter:67 - org.springframework.integration.router.RecipientListRouter#0 received message: http-apr-8080-exec-2 14:39:24,222 DEBUG DirectChannel:224 - preSend on channel 'finishFlowChannel', message: http-apr-8080-exec-2 14:39:24,222 DEBUG MessageHandlerChain:67 - org.springframework.integration.handler.MessageHandlerChain#35 received message: [Payload=nl.vwpfs.pos.xmlcdm.dossier.service.CreateDossierResponse@6b37695c
http-apr-8080-exec-2 14:39:24,222 DEBUG MessageTransformingHandler:67 - org.springframework.integration.transformer.MessageTransformingHandler@57316e85 received message: http-apr-8080-exec-2 14:39:24,223 DEBUG MessageTransformingHandler:156 - handler 'org.springframework.integration.transformer.MessageTransformingHandler@57316e85' sending reply http-apr-8080-exec-2 14:39:24,224 DEBUG DirectChannel:224 - preSend on channel 'apiReplyChannel', message: http-apr-8080-exec-2 14:39:24,224 DEBUG MessageTransformingHandler:67 - http-apr-8080-exec-2 14:39:24,235 DEBUG DirectChannel:237 - postSend (sent=true) on channel 'apiReplyChannel', message: http-apr-8080-exec-2 14:39:24,236 DEBUG DirectChannel:237 - postSend (sent=true) on channel 'finishFlowChannel', message: 
http-apr-8080-exec-2 14:39:24,236 DEBUG ExecutorChannel:224 - preSend on channel 'processEngineChannel', message: 
http-apr-8080-exec-2 14:39:24,239 DEBUG ExecutorChannel:237 - postSend (sent=true) on channel 'processEngineChannel', message: 
taskExecutor-1 14:39:24,239 DEBUG MessageHandlerChain:67 - org.springframework.integration.handler.MessageHandlerChain#34 received message: 
http-apr-8080-exec-2 14:39:24,239 DEBUG DirectChannel:237 - postSend (sent=true) on channel 'newApplicationChannel', message: 
taskExecutor-1 14:39:24,240 DEBUG MessageTransformingHandler:67 - org.springframework.integration.transformer.MessageTransformingHandler@289f6ae received message: 
http-apr-8080-exec-2 14:39:24,240 DEBUG DirectChannel:237 - postSend (sent=true) on channel 'naRequestChannel', message: 
http-apr-8080-exec-2 14:39:24,241 DEBUG DirectChannel:237 - postSend (sent=true) on channel 'apiRequestChannel', message: 
taskExecutor-1 14:39:27,817 DEBUG MessageTransformingHandler:156 - handler 'org.springframework.integration.transformer.MessageTransformingHandler@289f6ae' sending reply Message: 
taskExecutor-1 14:39:27,819 DEBUG RequestReplyMessageHandlerAdapter:67 - (inner bean)#235 received message: 
taskExecutor-1 14:39:27,822 DEBUG DirectChannel:224 - preSend on channel 'sendToProcessEngineChannel', message: 
taskExecutor-1 14:39:27,822 DEBUG MarshallingWebServiceOutboundGateway:67 - org.springframework.integration.ws.MarshallingWebServiceOutboundGateway#0 received message: 
taskExecutor-1 14:39:28,094 DEBUG MarshallingWebServiceOutboundGateway:156 - handler 'org.springframework.integration.ws.MarshallingWebServiceOutboundGateway#0' sending reply 
taskExecutor-1 14:39:28,095 DEBUG DirectChannel:237 - postSend (sent=true) on channel 'sendToProcessEngineChannel', message: 
taskExecutor-1 14:39:28,095 DEBUG GatewayProxyFactoryBean:134 - Unable to attempt conversion of Message payload types. Component 'org.springframework.integration.gateway.GatewayProxyFactoryBean#762589c3' has no explicit ConversionService reference, and there is no 'integrationConversionService' bean within the context.
taskExecutor-1 14:39:28,095 DEBUG RequestReplyMessageHandlerAdapter:156 - handler '(inner bean)#235' sending reply Message: 
4

1 に答える 1