空の結果があり、ハングアップしていると思われるゲートウェイサービスへのサービスアクティベータコールがあるバネ統合フローがあります。それはチェーンの残りの部分を続行しません。スレッドの実行を継続するためにゲートウェイ呼び出しからの結果の返り値が返ってくるとは思っていません。私はvoidメソッドの宣言をしています。春の統合チェーンフロー - 無効なゲートウェイコールの処理
サービス
package foo;
import org.springframework.messaging.handler.annotation.Header;
import org.springframework.messaging.handler.annotation.Payload;
public interface myService {
void capitalString(String inputString) ;
}
春の統合フロー
<import resource="classpath:META-INF/spring/integration/spring-integration-database-context.xml"/>
<context:property-placeholder location="classpath:META-INF/spring/integration/testApp.properties"/>
<!-- INTEGRATION FLOW - START -->
<int-file:inbound-channel-adapter
directory="file:${baseFilePath}\input"
id="filesInAdapter"
channel="inputChannel"
auto-startup="true">
<int:poller fixed-delay="5000" />
</int-file:inbound-channel-adapter>
<int:channel id="inputChannel"/>
<int:chain input-channel="inputChannel" >
<int:header-enricher id="fileNameHeaderEnricher" >
<int:header name="fileName" expression="payload.getName()"></int:header>
</int:header-enricher>
<int:service-activator id="serviceActivator" ref="myServiceGateway" method="capitalString" />
<!--write out the filename to the output file since void returns empty payload-->
<int:transformer id="payloadAppender" expression="headers['fileName']"/>
<int-file:outbound-channel-adapter id="filesOut" directory-expression=" '${defaultDirPath}' + 'Output\'" filename-generator-expression="'Output.txt'" /></int:chain>
<!-- INTEGRATION FLOW - END -->
<int:channel id="capitalStringStoredChannel" />
<int:gateway
id="myServiceGateway"
default-request-timeout="5000"
default-reply-timeout="5000"
default-request-channel="capitalStringStoredChannel"
service-interface="foo.CaptialStringService"
error-channel="errorsProc">
<int:method name="executeFoo" request-channel="capitalStringStoredChannel" />
</int:gateway>
<!-- LOOK HERE MY GATEWAY -->
<int-jdbc:stored-proc-outbound-gateway
id="outbound-gateway-enroll"
request-channel="capitalStringStoredChannel"
data-source="dataSource"
stored-procedure-name="CAPITALIZE_STRING"
>
<int-jdbc:parameter name="INOUTSTRING" expression="new java.lang.String(payload.split(',')[1])" />
</int-jdbc:stored-proc-outbound-gateway>
<!-- <int:logging-channel-adapter id="loggit" log-full-message="true"/>-->
デバッグログは、 - それは返事を送るようにそれは正しく見えます。私のファイルアダプタは呼び出されないようです。
11:46:19.830 DEBUG [task-scheduler-1][org.springframework.integration.handler.ServiceActivatingHandler] handler 'ServiceActivator for [org.spr[email protected]c406eb8a] (org.springframework.integration.handler.MessageHandlerChain#0$child.serviceActivator)' produced no reply for request Message: GenericMessage [payload=00111,123, headers={sequenceNumber=1, sequenceSize=0, correlationId=fa3a8e43-49b2-fd90-9aaa-ed02e15b260e, FILE_NAME=file1_01.txt, timestamp=1488987979508}]
11:46:19.830 DEBUG [task-scheduler-1][org.springframework.integration.channel.DirectChannel] postSend (sent=true) on channel 'inputChannel', message: GenericMessage [payload=filename.txt, headers={id=904ee554-638d-eddf-efb5-7d4de30f4882, timestamp=1488987979489}]
チェーン内にいるためには、すべてに返信が必要です。 voidメソッドの実行後にチェーンのpostSendをチャネルに送信すると、チェーンが破損して終了しているのでしょうか?後は何も無視します。 – haju
ゲートウェイの下流のすべてが同じスレッド( 'DirectChannel's)で実行されている場合は、デフォルトの応答タイムアウトを0に設定することができ、ヌル結果はチェーンを直ちに終了し、スレッドは呼び出し元に戻ります。スレッドがゲートウェイに戻るまで、タイマーは開始されていないので、応答が受信されたときに条件を害することはありません。 –