我是Spring Integration和Spring Integration AMQP的新手。Spring集成 - 标题丢失
我有以下代码:
<bean id="enricher" class="soft.Enricher"/>
<amqp:inbound-channel-adapter queue-names="QUEUE1" channel="amqpInboundChannel"/>
<int:channel id="amqpInboundChannel">
<int:interceptors>
<int:wire-tap channel="logger"/>
</int:interceptors>
</int:channel>
<int:header-enricher input-channel="amqpInboundChannel" output-channel="routingChannel">
<int:header name="store" value="sj" />
</int:header-enricher>
<int:channel id="routingChannel" />
<int:header-value-router input-channel="routingChannel" header-name="store">
<int:mapping value="sj" channel="channelSJ" />
<int:mapping value="jy" channel="channelJY" />
</int:header-value-router>
<amqp:outbound-channel-adapter channel="channelSJ" exchange-name="ex_store" routing-key="sj" amqp-template="rabbitTemplate"/>
<amqp:outbound-channel-adapter channel="channelJY" exchange-name="ex_store" routing-key="jy" amqp-template="rabbitTemplate"/>
<int:channel id="channelSJ" />
<int:channel id="channelJY" />
<int:logging-channel-adapter id="logger" level="ERROR" />
的设置如下:除了
一切正常,当由入站捡到一个邮件头都将丢失声道适配器。
同样,使用出站通道适配器将消息发送到交换机时,名为“store”的头部也会丢失。
这是一个消息是如何通过入站通道适配器被拾起之前寻找:
这是如何在同一消息的整个过程后寻找(注意没有报头)
请您添加的代码示例 –
这仅仅是基本的Spring配置没有什么神奇的,但我说的东西,应该接近你想要什么 – Vidya
您还可以使用映射?。 -请求-在adapapter上的标题=“*”。 –