I'm using channel-adapters (not gateways) to send data with MessagingTemplate's sendAndReceive from spring integration server to a connected nonspring client (or just telnet).
After receiving the data in the client, somewhen I want to reply data to the server and resolve that sendAndReceive-Waiting. I still want to be able to send other data to the server.
How will sendAndReceive detect a response? Right now I can send whatever I want to the server, it will assume it as a new incoming message.
Is there a predefined way, like prefixing a messageid or do I have to implement it manually by interpreting the incoming messages and somehow "resolve" the sendAndReceive-blocker?
MessagingTemplate.sendAndReceiveis based on theTemporaryReplyChannelwhich is placed to theMessageHeadersand afterward someAbstractReplyProducingMessageHandlerjust uses that header to send reply back.Yes, the sending Thread is blocked to wait for the reply throughout that
TemporaryReplyChannel.Hope that can help you a bit.
All other your comment regarding TCP/IP isn't clear for me yet...