title: Camel JMS : how to configure custom message listener when connecting to a topic
body: <p>I need to define a route which reads message (has an xml) from a Topic and unmarshals it to a java bean.</p>
  
  <p>Earlier i was using spring JmsTemplate for managing connectionFactory for the topic and my route looked something like this (and it worked fine)
  The message converter essetially returns the <code>TextMessage</code> instance in the <code>fromMessage()</code> method</p>
  
  <pre><code>JaxbDataFormat dataFormat = new JaxbDataFormat();
  dataFormat.setContextPath("com.somepath.xml");
  
  from("jms:topic:myTopic?transacted=true&amp;connectionFactory=myJmsConnectionFactory&amp;messageConverter=#myMessageConverter")
   .transacted()
   .unmarshal(dataFormat)
   .routeId("myRouteId")
  </code></pre>
  
  <p>Now, instead of a JmsTemplate, i am using <code>org.springframework.jms.listener.DefaultMessageListenerContainer</code> to connect to this durable topic.</p>
  
  <p>(Also because it supports asynchronous mode)</p>
  
  <p>For this i wrote my own message listener which implements <code>javax.jms.MessageListener</code> and i read the message in <code>onMessage()</code>. But i cannot return a TextMessage from here like the way i used to do when is used JmsTemplate.</p>
  
  <p>I don't know how can i configure this in the route definition so that it still supports unmarshalling?</p>