简体   繁体   中英

TCP session with Spring Integration framework

I'm trying to create an iso8385 TCP server using Spring Integration. A typical scenario would be the following:

  • a client connects to the server and deposits an ISO8385 message
  • the server processes the message
  • the server formulates a response and closes the connection

I want to keep track of each new TCP connection, and create an identifier for it, in order to associate each processing to the connected client. But I don't know how to do that. The idea would be to have:

  • a tcp inbound adapter, that transforms ISO8385 into a java class
  • a service activator which will process the message
  • a tcp outbound adapter, that transforms a java class into an ISO8385 message
  • a channel (but where ?)
  • a identifier for a TCP session that is shared between all of these

Does anyone know how to perform this ?

Actually <int-tcp:tcp-inbound-gateway> does the stuff for you:

  • you configure <int-tcp:tcp-connection-factory type="server">
  • inject it into the <int-tcp:tcp-inbound-gateway>
  • all other correlation logic is encapsulated in the last one

I have some experience with iso8385 , but I don't think that there is a reason to get deal here with MCC or terminalId to correlate messages.

Would be more interest to provide some routing logic for ISO message types . But it is a different story...

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM