저는 스프링 통합 및 스프링 통합 AMQP를 처음 사용했습니다.스프링 통합 - 헤더 손실
<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" />
셋업은 다음과 같다 :
나는 다음과 같은 코드가
모든 제외하고 잘 작동하는 메시지가 인바운드에 의해 포착 될 때 헤더가 손실되는 - 채널 어댑터.
아웃 바운드 채널 어댑터를 사용하여 메시지를 교환기로 보낼 때 마찬가지로 "저장소"라고도 불리는 헤더가 손실됩니다.
같은 메시지가 (어떤 헤더를 알 수 없음) 전체 과정을 돌보는 방법 이것은
:이 메시지가 인바운드 채널 어댑터에 의해 선택되기 전에 찾고 어떻게
당신은 그냥 기본적인 스프링 구성입니다 마법 아무것도 –
을 코드 예제를 추가하지시겠습니까하지만 난 당신이 원하는에 근접해야 뭔가를 추가 – Vidya
또한 매핑 할 수 있습니다.. -의뢰- adapapter의 headers = "*". –