Spring integration Spring集成tcp网关异常
我们正在使用SpringIntegration2.2.3 如果Tcp网关异常Spring integration Spring集成tcp网关异常,spring-integration,Spring Integration,我们正在使用SpringIntegration2.2.3 如果Tcp网关异常[java.net.ConnectException:连接被拒绝],它只打印堆栈跟踪,流继续处理 我们需要在遇到ConnectException时停止执行。 是否有任何方法可以处理/捕获异常 下面是我们的配置片段: <ip:tcp-connection-factory id="xClient" type="client" host="${SERVER_HOST}" port="${SERVER_P
[java.net.ConnectException:连接被拒绝]
,它只打印堆栈跟踪,流继续处理
我们需要在遇到ConnectException时停止执行。
是否有任何方法可以处理/捕获异常
下面是我们的配置片段:
<ip:tcp-connection-factory id="xClient" type="client" host="${SERVER_HOST}"
port="${SERVER_PORT}" single-use="true" deserializer="connectionSerializeDeserialize"/>
<ip:tcp-connection-factory id="yClient" type="client" host="${SERVER_HOST}"
port="${SERVER_PORT}" single-use="true" deserializer="connectionSerializeDeserialize"/>
<int:gateway id="xGateway" service-interface="com.pac.xGateway">
<int:method name="fetchXData" request-channel="XDataRequestChannel" reply-channel="XDataResponseChannel"/>
<int:method name="getYData" request-channel="YDataRequestChannel" reply-channel="YDataResponseChannel"/>
</int:gateway>
<ip:tcp-outbound-gateway id="serverGateway" request- channel="queryRequestChannel" reply-channel="queryResponseChannel" connection-factory="xClient" reply-timeout="300000" request- timeout="300000"/>
<ip:tcp-outbound-gateway id="serverSGateway" request-channel="querySRequestChannel" reply-channel="querySResponseChannel" connection-factory="yClient" reply-timeout="300000" request-timeout="300000"/>
我们收到Tcp网关异常。
java.net.ConnectException
但执行仍在继续,不会停止
请建议捕获此异常的方法。是的,这是可能的,但您需要提供更多的上下文-启动流程的内容等。显示您的配置。编辑你的问题,它不会在评论中很好地呈现。