Home:ALL Converter>Spring Integration TCP force reconnect from both sides

Spring Integration TCP force reconnect from both sides

Ask Time:2013-04-19T22:00:45         Author:Dennis Thrysøe

Json Formatter

I recently received an answer on how I could force a reconnect from the client side (Client mode TCP connection factory and adapters).

But I also need to be able to close a connection from the server side (Server TCP connection factory and non-client-mode adapters).

I need to support a situation where, if some custom correlation logic goes out of sync, the connection is closed, and both sides react to this by resetting their counters etc.

So I need to:

  1. Force a TCP disconnect from server
  2. Force a TCP reconnect from client
  3. Have the server code discover that the connection was closed from the client (is there an event or such?)
  4. Have the client code discover that the connection was closed from the server (event?)

Author:Dennis Thrysøe,eproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/16106444/spring-integration-tcp-force-reconnect-from-both-sides
yy