title: How do I get my converted object using @JmsListener
body: <p>I am using Spring and Jaxb to listen to a JMSQueue and then unmarshall the JMS message into a java object.  I am then expecting to get that Java Object on my @JmsListener endpoint.  But instead I'm getting a TextMessage object.  Using a debugger I can step through the code and see that the conversion to the java object is happening but it never makes it to my end point.  </p>
  
  <p>Here is my config:</p>
  
  <pre><code>@Bean
    public DefaultJmsListenerContainerFactory myContainerFactory() {
        DefaultJmsListenerContainerFactory factory =
                new DefaultJmsListenerContainerFactory();
        factory.setConnectionFactory(connectionFactoryProxy());
        factory.setDestinationResolver(destinationResolver());
        factory.setMessageConverter(messageConverter());
        factory.setConcurrency("1-1");
        return factory;
    }
  
    @Bean
    public MessageConverter messageConverter(){
      MarshallingMessageConverter converter = new MarshallingMessageConverter();
      Jaxb2Marhsaller jaxbMarshaller = new Jaxb2Marhsaller ();
      jaxbMarshaller.setPackagesToScan("mypackage.jms.model");
      converter.setUnmarshaller(jaxbMarshaller);
      converter.setMarshaller(jaxbMarshaller);
      return converter;
    }
  
  
  And my endpoint:
  
  @Component
  public class QueueMessageReceiver {
  
    @JmsListener(containerFactory = "myContainerFactory", destination = "jms/Queue")
    public void process(Message message) {
      try {
        System.out.println(message);
      }catch(Exception e){
        e.printStackTrace();
      }
  
    }
  
  }
  </code></pre>
  
  <p>The problem is that the QueueMessageReceiver.process method has a TextMessage and not the converted object.  Help would be greatly appreciated.</p>