title: Spring AMQP Outbound Adapter behavior when exchange not found
body: <p>I have a spring integration code that connects a JMS listener (that listens to a mq series local queue) </p>
  
  <pre><code>    &lt;int-jms:message-driven-channel-adapter&gt;
  </code></pre>
  
  <p>and forwards the message to a rabbitmq (not controlled by me) via a </p>
  
  <pre><code>    &lt;int-amqp:outbound-channel-adapter&gt;
  </code></pre>
  
  <p>I am trying to keep this transactional meaning that if the rabbitmq did not receive the message I want to keep it in the MQ series local queue.
  However I noticed that if the exchange that was mentioned in the rabbitmq configurations did not exist I see in my logs this line:</p>
  
  <pre><code>ERROR (CachingConnectionFactory.java:292)     - Channel shutdown: channel error; protocol method: #method&lt;channel.close&gt;(reply-code=404, reply-text=NOT_FOUND - no exchange 'xxx' in vhost 'xxx', class-id=60, method-id=40)
  </code></pre>
  
  <p>But my message disappears for the mq series local queue.</p>
  
  <p>What shall i do do make it retry to send the message if the rabbitmq broker fails or if the exchange does not exists?</p>
  
  <p>Thanks for your help,
  My configuration:</p>
  
  <pre><code>   &lt;int-jms:message-driven-channel-adapter
          id="x.y.z" channel="channel-in"
          error-channel="errorChannel" header-mapper="jmsIntegrationHeaderMapper"
          acknowledge="transacted" destination-name="a.b.c" /&gt;
  
      &lt;int:channel id="channel-in"&gt;
  
      &lt;/int:channel&gt;
  
      &lt;int:header-enricher input-channel="channel-in"
          output-channel="channel-out"&gt;
          &lt;int:header name="url"
              expression="'amqp://${amqp.user}@${amqp.host}:${amqp.port}/${amqp.vhost}'"&gt;&lt;/int:header&gt;
      &lt;/int:header-enricher&gt;
  
  
      &lt;int:channel id="channel-out"&gt;
      &lt;/int:channel&gt;
  
      &lt;int-amqp:outbound-channel-adapter
          channel="channel-out" amqp-template="amqpTemplate"
          routing-key="crd" mapped-request-headers="*" exchange-name="${amqp.exchange}"&gt;
      &lt;/int-amqp:outbound-channel-adapter&gt;
  
  
      &lt;rabbit:connection-factory id="amqpConnectionFactory" addresses="${amqp.host}:${amqp.port}"
                             cache-mode="CONNECTION"
                             channel-cache-size="25"
                             username="${amqp.user}"
                             password="${amqp.pass}"
                             virtual-host="${amqp.vhost}"/&gt;
  
      &lt;rabbit:template id="amqpTemplate"
                   connection-factory="amqpConnectionFactory" mandatory="true" channel-transacted="true"/&gt;
  </code></pre>