I have the spring integration XML config with following bean
<int-ip:tcp-outbound-channel-adapter id="outboundClient"
channel="input"
connection-factory="client"/>
I thought the equivalent in java config would be
@ServiceActivator(inputChannel = "input", requiresReply = "true")
public TcpSendingMessageHandler outboundClient() {
TcpSendingMessageHandler tcpSendingMessageHandler = new TcpSendingMessageHandler();
tcpSendingMessageHandler.setConnectionFactory(clientConnectionFactory());
tcpSendingMessageHandler.setRetryInterval(10000);
tcpSendingMessageHandler.setClientMode(true);
return tcpSendingMessageHandler;
}
However, in the log, I see
TcpListener exiting - no listener and not single use
and I can't receive the reply from server.
Any help is appreciated
The TcpSendingMessageHandler
is for one-way usage - just for sending messages to the TCP socket.
So, your config looks good and seems for me it should work.
TcpListener exiting - no listener and not single use
Is just DEBUG
message from the TcpNetConnection
which indicates that your component is one-way
.
Therefore it is normal that you can't receive a reply from the server. Because you only send message to there.
To have request/reply
scenarios consider to use TcpOutboundGateway
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With