spring-projects / spring-integration-samples

You are looking for examples, code snippets, sample applications for Spring Integration? This is the place.

Home Page:http://www.springsource.org/spring-integration

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

What is required to make DynamicTcpClientApplication also return data with the send interface?

Syrou opened this issue · comments

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 garyrussell@901363d

  .   ____          _            __ _ _
 /\\ / ___'_ __ _ _(_)_ __  __ _ \ \ \ \
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
 \\/  ___)| |_)| | | | | || (_| |  ) ) ) )
  '  |____| .__|_| |_|_| |_\__, | / / / /
 =========|_|==============|___/=/_/_/_/
 :: 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