spring-integration-samples
spring-integration-samples copied to clipboard
What is required to make DynamicTcpClientApplication also return data with the send interface?
I'm trying to wrap my head around how to make the DynamicTcpClientApplication also give back the response data sent with:
@MessagingGateway(defaultRequestChannel = "toTcp.input")
public interface ToTCP {
public void send(String data, @Header("host") String host, @Header("port") int port);
}
Just changing from void to byte[] is not enough. What is needed to make sure a client can get the response from a tcp request back through the interface?
Use gateways instead of channel adapters - see this commit https://github.com/garyrussell/spring-integration-samples/commit/901363d1796bd00fefcacd3a6073d79a4560b794
. ____ _ __ _ _
/\\ / ___'_ __ _ _(_)_ __ __ _ \ \ \ \
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
\\/ ___)| |_)| | | | | || (_| | ) ) ) )
' |____| .__|_| |_|_| |_\__, | / / / /
=========|_|==============|___/=/_/_/_/
:: Spring Boot :: (v2.4.0-SNAPSHOT)
FOO
FOO
Thanks, i'll be giving this a go in a week, i'll be getting back asap