-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Description
Expected Behavior
I need capability for TcpOutboundGateway to support also single way communication that comes from tcp server without any request from client.
Current Behavior
If i am correct according to my experience on TcpOutboundGateway, it is working two direction that is request/response but also in some use cases server should send to client periodical arbitrary data but without any request if server sends data to client, client generates error like "ERROR 54816 --- [pool-2-thread-1] o.s.i.ip.tcp.TcpOutboundGateway : Cannot correlate response - no pending reply for ::58628:62fd67b6-af2d-42f1-9c4d-d232fbe9c8ca".
If this capability is supported by TcpOutboundGateway than it will not generate any Error then server can send data to connected client so both "request/response" type of communication and "only push message" from server type of communication can be supported.
Context
How has this issue affected you?
I could not receive push (arbitrary) messages from server with using TcpOutboundGateway and this issue forced me to use adapters but message correlation in adapters is complicated if tcp server is not allowed to support such an extension. In my case tcp server was already written and is a a black box product. When i try adapters, I lost req/resp capability because as i understand adapters working asynchronous.
What are you trying to accomplish?
I tried to accomplished that both i have to use req/resp type of communication between client and server but also incase of any push message comes from server, that client should receive it.
What other alternatives have you considered?
To be honest, i did not have other alternative but i am totally open to hear other alternatives.
Are you aware of any workarounds?
@garyrussell supported me to extend TcpOutboundGateway to inject message channel for receive push messages from server and also he supported me to use adapters but also he mentioned that message correlation is complicated if tcp server is intelligent.
Here some links about this topic
https://stackoverflow.com/questions/62702192/spring-integration-gateway-vs-adapters
https://stackoverflow.com/questions/46021319/how-to-extend-tcp-outbound-gateway-to-just-receive-messages-in-spring-integratio?rq=1
https://stackoverflow.com/questions/33902543/spring-integration-tcp-server-push-to-client