title: Spring Integration - header lost
body: <p>I'm new to Spring Integration and Spring Integration AMQP.</p>
  
  <p>I have the following code:</p>
  
  <pre><code>&lt;bean id="enricher" class="soft.Enricher"/&gt;
  
  &lt;amqp:inbound-channel-adapter queue-names="QUEUE1" channel="amqpInboundChannel"/&gt;
  
  &lt;int:channel id="amqpInboundChannel"&gt;
      &lt;int:interceptors&gt;
          &lt;int:wire-tap channel="logger"/&gt;
      &lt;/int:interceptors&gt;
  &lt;/int:channel&gt;
  
  &lt;int:header-enricher input-channel="amqpInboundChannel" output-channel="routingChannel"&gt;
          &lt;int:header name="store" value="sj" /&gt;
  &lt;/int:header-enricher&gt;
  
  &lt;int:channel id="routingChannel" /&gt;
  
  &lt;int:header-value-router input-channel="routingChannel" header-name="store"&gt;
      &lt;int:mapping value="sj" channel="channelSJ" /&gt;
      &lt;int:mapping value="jy" channel="channelJY" /&gt;
  &lt;/int:header-value-router&gt;
  
  &lt;amqp:outbound-channel-adapter channel="channelSJ" exchange-name="ex_store" routing-key="sj" amqp-template="rabbitTemplate"/&gt;
  &lt;amqp:outbound-channel-adapter channel="channelJY" exchange-name="ex_store" routing-key="jy" amqp-template="rabbitTemplate"/&gt;
  
  &lt;int:channel id="channelSJ" /&gt;
  &lt;int:channel id="channelJY" /&gt;
  
  &lt;int:logging-channel-adapter id="logger" level="ERROR" /&gt;
  </code></pre>
  
  <p>The setup is the following:</p>
  
  <p><img src="https://i.stack.imgur.com/Svw3x.png" alt="My Setup"></p>
  
  <p>Everything is working fine except that headers are lost when a message is picked up by the inbound-channel-adapter.</p>
  
  <p>Likewise the header being enriched called "store" is also lost when the message is being send to the exchange using the outbound-channel-adapter.  </p>
  
  <p>This is how a message is looking before being picked up by the inbound-channel-adapter:</p>
  
  <p><img src="https://i.stack.imgur.com/4CQ6u.png" alt="Before"></p>
  
  <p>This is how the same message is looking after the whole process (notice no headers)</p>
  
  <p><img src="https://i.stack.imgur.com/KMdoB.png" alt="After"></p>