0
我有一個生產者(寫在CPP)發送到「春季集成服務器」的二進制數據。 它的工作原理如下: spring integration time out clients春季集成發送使用網關
現在我必須發送一個回覆(如ACK)給製作人。
我已閱讀關於網關,但實際上我很困惑。 我的配置是:
<int-ip:tcp-connection-factory id="serverTcpConFact"
type="server"
port="5566"
using-nio="true"
single-use="false"
task-executor="myTaskExecutor"
deserializer="serializer"
serializer="serializer"/>
<int-ip:tcp-inbound-channel-adapter id="tcpInboundAdapter"
channel="tcpInbound"
connection-factory="serverTcpConFact" />
<int:channel id="tcpInbound" />
<int:service-activator
output-channel="tcpOutbound"
input-channel="tcpInbound"
ref="importService"
method="handler" />
<bean id="importService" class="my.ImportService" />
<int:channel id="tcpOutbound" />
<int:gateway id="mygateway"
service-interface="my.IpMyGatway"
default-request-channel="tcpInbound"
default-reply-channel="tcpOutbound"
default-reply-timeout="6000"/>
我也有一個自定義的serializator,問題是,我的春天集成服務器不發送答覆。
我需要回復執行:
@Override
public void serialize(MyMessage arg0, OutputStream outputStream) throws IOException {
// TODO Auto-generated method stub
logger.info("serialize messages");
// here I have to write my ACK ! (.. or not?)
}
然後將消息發送到生產者對每封郵件。
謝謝。
謝謝@Artem Bilan,但我不明白'reply message'是什麼意思。你可以更好地離開嗎? –
向答案添加了示例 –
好的,我不知道,謝謝我解決了。 –