I have a task to create a Spring-integration TCP client which should connect to a server and receive messages from it:
As I understand, TcpNetClientConnectionFactory
opens a connection only upon sending a message. Is there any way to open a connection without sending any data (something like SocketFactory.createSocket(host, port)
does) and maintain it?
Please, investigate a TcpReceivingChannelAdapter
and let us know why it doesn't work for you:
https://docs.spring.io/spring-integration/docs/current/reference/html/ip.html#tcp-adapters