title: spring-jms OutboundGateway does not pick up reply
body: <p>Maybe it's a stupid question and I'm missing something very simple, but I'm really stuck.
  I'm using ActiveMQ 5.5.1 and SI 2.1.4</p>
  
  <p>My configs snippets:</p>
  
  <p>---SERVER---</p>
  
  <pre><code>    &lt;beans:bean id="connectionFactory"   class="org.apache.activemq.ActiveMQConnectionFactory"&gt;
      &lt;beans:property name="brokerURL" value="tcp://localhost:61616" /&gt;
  &lt;/beans:bean&gt;
  
  
     &lt;beans:bean id="listQueue" class="org.apache.activemq.command.ActiveMQQueue"&gt;
          &lt;beans:constructor-arg name="name" value="LIST_QUEUE"/&gt;
      &lt;/beans:bean&gt;   
  
     &lt;beans:bean id="replyListQueue" class="org.apache.activemq.command.ActiveMQQueue"&gt;
          &lt;beans:constructor-arg name="name" value="REPLY_LIST_QUEUE"/&gt;
      &lt;/beans:bean&gt;             
  
      &lt;channel id="replyListChannel"/&gt; 
      &lt;channel id="listIn" /&gt;
      &lt;channel id="listDriver"/&gt;
      &lt;channel id="listStock"/&gt;    
  
  
      &lt;jms:inbound-channel-adapter id="listInJms"
          connection-factory="connectionFactory"
          destination="listQueue"
          channel="listIn"        
          auto-startup="true"&gt;
          &lt;poller fixed-rate="3000"/&gt;
      &lt;/jms:inbound-channel-adapter&gt;  
  
  
  
      &lt;header-value-router input-channel="listIn" header-name="List"
              default-output-channel="nullChannel"&gt;        
          &lt;mapping value="Driver" channel="listDriver" /&gt;
          &lt;mapping value="Stock" channel="listStock" /&gt;
      &lt;/header-value-router&gt;
  
      &lt;jms:outbound-channel-adapter connection-factory="connectionFactory"
          channel="replyListChannel"
          destination="replyListQueue"
          auto-startup="true"&gt;                 
      &lt;/jms:outbound-channel-adapter&gt;
  </code></pre>
  
  <p>---CLIENT---</p>
  
  <pre><code>&lt;beans:bean id="connectionFactory"  class="org.apache.activemq.ActiveMQConnectionFactory"&gt;
      &lt;beans:property name="brokerURL" value="tcp://localhost:61616" /&gt;
  &lt;/beans:bean&gt;      
  
  &lt;beans:bean id="requestListQueue" class="org.apache.activemq.command.ActiveMQQueue"&gt;
      &lt;beans:constructor-arg value="LIST_QUEUE"/&gt;
  &lt;/beans:bean&gt;         
  
  &lt;beans:bean id="replyListQueue" class="org.apache.activemq.command.ActiveMQQueue"&gt;
      &lt;beans:constructor-arg value="REPLY_LIST_QUEUE"/&gt;
  &lt;/beans:bean&gt; 
  
  
  &lt;channel id="requestListChannel"&gt;
      &lt;queue capacity="20"/&gt;
  &lt;/channel&gt;   
  
  &lt;channel id="listStockChannel"&gt;
      &lt;queue capacity="20"/&gt;
  &lt;/channel&gt;   
  
  &lt;channel id="listDriverChannel"&gt;
      &lt;queue capacity="20"/&gt;
  &lt;/channel&gt;       
  
  &lt;channel id="replyListChannel"/&gt;                
  
  &lt;jms:outbound-gateway id="outListGW"
      connection-factory="connectionFactory"
      request-destination="requestListQueue"
      request-channel="requestListChannel"
      reply-destination="replyListQueue"
      reply-channel="replyListChannel" 
      reply-timeout="20000"
      receive-timeout="20000"&gt;
      &lt;poller fixed-rate="5000" /&gt;
  &lt;/jms:outbound-gateway&gt;     
  
  
  &lt;header-value-router input-channel="replyListChannel" header-name="List"
          default-output-channel="nullChannel"&gt;        
      &lt;mapping value="Driver" channel="listDriverChannel" /&gt;
      &lt;mapping value="Stock" channel="listStockChannel" /&gt;
  &lt;/header-value-router&gt;
  </code></pre>
  
  <p>Then in some place in code I manually do the request and listen to the reply-channel:</p>
  
  <pre><code>    public static DriverList requestDriverList() {
  
      Message&lt;String&gt; ldrm = MessageBuilder.withPayload("DriverList request").
              setHeader("List", "Driver").build();            
      try {
          ApplicationContext ctx = 
          new ClassPathXmlApplicationContext("classpath:dmclnt/config/integ-context.xml");
          MessageChannel requestListChannel = 
                  ctx.getBean("requestListChannel", MessageChannel.class);
          QueueChannel listDriverChannel = 
                  ctx.getBean("listDriverChannel", QueueChannel.class);
  
  
          logger.info("Request for DriverList is sent to channel");
  
          Message dlm = listDriverChannel.receive(20000);
  
          String xmlDL = (String)dlm.getPayload(); 
  
          JAXBContext jaxbctx = JAXBContext.newInstance(DriverList.class);
          DriverList dl = (DriverList)jaxbctx.createUnmarshaller().
          unmarshal(newStringReader(xmlDL));
          logger.info("DriverList objct unmarshalled: "+dl.toString());
          return dl;            
      } catch (JAXBException e) {
          logger.error("Error converting xmlDriverList to DriverList object",e);
          return null;
      } catch (RuntimeException e){
          logger.error(e); 
          return null;
      } 
  }
  </code></pre>
  
  <p>But I receive </p>
  
  <pre><code>"MessageTimeoutException: failed to receive JMS response within timeout of: 20000ms"
  </code></pre>
  
  <p>all the time.
  When I look through server log I see that reply with correct payload was successfully sent from server to client and, moreover,
  the reply is placed into REPLY_LIST_QUEUE, as I can see in ActiveMQ admin console.
  And nothing more happens!
  Message in REPLY_LIST_QUEUE <strong>With_Correct_Payload</strong> resides in Pending and Enqueued state in this queue.
  No messages are Dequeued.
  It seems, JmsOutboundGateway does not pick up messages from reply-destination queue, despite receive-timeout="20000ms" delay is far more than enough to get the reply.
  What am I doing wrong?</p>