【发布时间】:2014-07-04 13:10:19
【问题描述】:
我有一个生产者(用 CPP 编写)将二进制数据发送到“spring-integration server”。 它可以正常工作: 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"/>
我还有一个自定义序列化器,问题是我的 spring 集成服务器没有发送回复。
我需要回复执行:
@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?)
}
然后将消息发送给每个消息的生产者。
谢谢。
【问题讨论】:
标签: java spring spring-integration