我正在配置 Spring 集成设置。有两个 TCP 服务器,它是共享同一通道的出站通道。
我希望使用标头的值路由通道。我该如何解决这个问题?
<ip:tcp-connection-factory id="admMsgRcvServer"
type="server" port="#{afiProperties.admMsgRcvPort}" deserializer="byteArrayCharLengthSerializer"
serializer="byteArrayCharLengthSerializer" single-use="true" />
<ip:tcp-connection-factory id="simMsgSndClient"
type="client" host="#{afiProperties.msgSndHost}" port="#{afiProperties.msgSndPort}"
single-use="true" so-timeout="10000" deserializer="byteArrayCharLengthSerializer"
serializer="byteArrayCharLengthSerializer" />
<ip:tcp-outbound-channel-adapter id="msgSnd"
connection-factory="simMsgRcvServer" channel="afiHeadToHeaderChannel" />
<ip:tcp-outbound-channel-adapter id="simMsgSnd"
channel="afiHeadToHeaderChannel" connection-factory="simMsgSndClient" />