2016-07-22 6 views
1

私は最近、Spring Integration 4.1.3から4.2.6にアップデートし、http:inbound-gatewayから500応答を取得し始めたことに気付きました。調査の際 これは空の応答によるものであったとMessagingGatewaySupportSpringインテグレーションhttp:inbound-channel-adapterエラーチャネル

にタイムアウトとして
if (reply == null && this.errorOnTimeout) { 

これを解釈するゲートウェイは、これは理にかなっているので、私はhttp:inbound-channel-adapterにこれを変更し、それがこの問題を解決したが、その後エラー処理」はdoesnの期待どおりに動作しません。

私は、以前

<int-http:inbound-gateway id="inboundGateway" request-channel="httpInChannel" reply-channel="httpResponseChannel" path="/**/status*" supported-methods="POST" error-channel="httpErrorChannel"/> 
<int:chain input-channel="httpInChannel" output-channel="serviceChannel"> 
... 
</int:chain> 
<int:chain input-channel="httpErrorChannel"> 
    <int:header-enricher> 
     <int:header name="http_statusCode" value="500" /> 
    </int:header-enricher> 
    <int:transformer expression="payload.localizedMessage" /> 
</int:chain> 
<int:service-activator input-channel="serviceChannel" ref="someController" method="someVoidMethod"/> 

としていたし、ゲートウェイ上の誤りチャンネル私はそれが動作しないことが疑われるが、私は今、それは通常、有効なために正常に動作します

<int-http:inbound-channel-adapter id="inboundAdapter" channel="httpInChannel" path="/**/status*" supported-methods="POST" error-channel="httpErrorChannel"/> 
<int:chain input-channel="httpInChannel" output-channel="serviceChannel"> 
    ... 
</int:chain> 
<int:chain input-channel="httpErrorChannel"> 
    <int:header-enricher> 
     <int:header name="http_statusCode" value="500" /> 
    </int:header-enricher> 
    <int:transformer expression="payload.localizedMessage" /> 
</int:chain> 
<int:service-activator input-channel="serviceChannel" ref="someController" method="someVoidMethod"/> 

にわずかにこれを修正私は無効なメッセージを送信する場合、私は応答で完全なエラースタックと500の応答を取得する(ヘッダーの豊富な状態コードも変更しようとしました)。エラーは、(それがドキュメントのいずれかhttp://docs.spring.io/spring-integration/docs/4.3.0.RELEASE/reference/htmlsingle/#http-response-statuscodeでないが)error-channel出力を持たないように理にかなって

org.springframework.messaging.core.DestinationResolutionException: no output-channel or replyChannel header available 

あります。 インバウンドアダプタのエラー応答をゲートウェイと同様の方法で変更する方法はありますか?

答えて

1

私はバグだと思うので、JIRA Issueを開いてください。

周りの仕事として

、メインフローに、単にアダプタの後、半ばフローゲ​​ートウェイを追加...

<int:service-activator ref="gw" input-channel="httpInChannel" > 

<int:gateway id="gw" error-channel="httpErrorChannel" 
    default-request-channel="nextChannelInMainFlow" default-reply-timeout="0" /> 

ゲートウェイは、流れの周りにtry/catchブロックのようなものです。

返信を期待していないので、返信のタイムアウトは重要です。

関連する問題