控制器 - >网关 - > {可选的过滤/转换} - > TCP出站网关
网关使用其服务注入到控制器-接口。
编辑:
如果现在还不清楚从样品,你需要定义SI流...
service-interface="org.springframework.integration.samples.tcpclientserver.SimpleGateway"
default-request-channel="input"/>
type="client"
host="localhost"
port="1234"
single-use="true"
so-timeout="10000"/>
request-channel="input"
reply-channel="clientBytes2StringChannel"
connection-factory="client"
request-timeout="10000"
remote-timeout="10000"/>
input-channel="clientBytes2StringChannel"
expression="new String(payload)"/>
并注入网关到您的@Controller ...
public interface SimpleGateway {
public String send(String text);
}
@Controller
public class MyController {
@Autowired
SimpleGateway gw;
...
}