This is a doubt about the answer posted
I have created an clientconnectionfactory and using it inside receivingchanneladapter i am getting an error that the tcpoutboundgateway can not be used again, as it was already used for client initiated messages,
I also have same requirement that the client initiated and sent and received and handled, but any unsolicited messages from server also needs to be received on client side and sent a reply for them.