3
Can not send response for UDP message 과 비슷하지만 TCP가 필요합니다. 따라서 클라이언트는 메시지를 보내고 TCP 서버는 OK와 같은 응답을 다시 보낼 수 있습니다. TCP socket-expression = "@ inbound.socket"및 destination-expression = "headers [ 'ip_packetAddress']"는 사용할 수 없습니다. 당신이 Inbound Gateway을 사용할 수 있기 때문에 TCP의 경우TCP 요청에 대한 응답을 보내는 방법 (스프링 통합)?
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:int="http://www.springframework.org/schema/integration"
xmlns:int-ip="http://www.springframework.org/schema/integration/ip"
xmlns:int-event="http://www.springframework.org/schema/integration/ip"
xmlns:context="http://www.springframework.org/schema/context"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd
http://www.springframework.org/schema/integration http://www.springframework.org/schema/integration/spring-integration.xsd
http://www.springframework.org/schema/integration/ip http://www.springframework.org/schema/integration/ip/spring-integration-ip.xsd">
<int:channel id="tcpSend"/>
<int-ip:tcp-connection-factory id="client" type="client"/>
<int-ip:tcp-connection-factory id="server" type="server" host="localhost" port="1234"/>
<int-ip:tcp-outbound-channel-adapter id="tcpOutbound" channel="tcpSend"
connection-factory="client"/>
<int-ip:tcp-inbound-channel-adapter id="tcpInbound" channel="tcpReceive"
connection-factory="server"/>
<int:service-activator id="tcpHandler" input-channel="tcpReceive" output-channel="tcpSend"
ref="listener"/>
</beans>