I've been developing a project using spring framework 4. I'm trying to create a simple TCP client via spring-integration-ip
library. I've adjusted all configurations:
applicationContext.xml
...
<int:channel id="tcpChannel" />
<int-ip:tcp-outbound-channel-adapter id="outboundClient"
channel="tcpChannel"
connection-factory="tcpConnectionFactory"/>
...
bean configuration:
@Configuration
public class MyConfiguration{
@Bean
public AbstractClientConnectionFactory tcpConnectionFactory() {
return new TcpNetClientConnectionFactory("localhost", 2345);
}
}
I've read all documentations about spring tcp here.
I guess I must use tcp-outbound-channel-adapter
or gateway
to send messages. but I wonder how to use it; what method should I invoke. I'm not supposed to receive any messages from server.