we are using Spring integration 2.2.3.
In case of Tcp Gateway Exception [java.net.ConnectException :Connection refused]
, it just prints the stack trace and the flow continues Processing.
We need the execution should stop once ConnectException is encountered. Is there any way to handle/catch the Exception.
Below is snippet of our configuration:
<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"/>
we are getting Tcp Gateway Exception.
java.net.ConnectException
but the execution still continues and doesnt stop.
Kindly, suggest way to catch this Exception.