简体   繁体   中英

Spring integration - managing the TCP connection

I've been looking at using Spring integration to manage connecting via TCP to a remote service and have a few questions...

I need to re-use the same connection for the duration of the communication until I know the sequence of messages have been completed. Is there a way to do this out of the box?

Eg a Client sends a message with txnId: 12345. Any subsequent messages from that client with the same txnId needs to use the same connection, until the final message is sent, at which point I would need to close the connection to the remote server.

I've had a bit of a play around and it looks like I would have to manually manage the connections to some extent?

I seems that you only need a List to store all sockets. config the list in the spring, and then inject the list to any object which need go through all sockets.

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