2

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.

Evgeni Dimitrov
  • 21,976
  • 33
  • 120
  • 145
  • 1
    Yes, it's possible, but you need to provide more context - what starts the flow etc. Show your configuration. Edit your question, it won't render well in a comment. – Gary Russell Jul 04 '15 at 18:05

0 Answers0