title: How to implement an event-driven consumer in Apache Camel and get JMS Message
body: <p>Hi I'm struggling with Apache Camel,</p>
  
  <p>i want the "real" javax.jms.TextMessage in my custom Consumer-Bean. But all I get is the Message-Text as String.   </p>
  
  <p>Config: </p>
  
  <pre><code>     &lt;camelContext xmlns="http://camel.apache.org/schema/spring"&gt; 
       &lt;route id="route_dispatching"&gt; 
          &lt;from uri="activemq:queue:queue.dispatcher.replyqueue"/&gt; 
          &lt;to uri="bean:dispatcherbean"/&gt;
         &lt;/route&gt;
       &lt;/camelContext&gt;
       &lt;bean id="dispatcherbean" class="com.company.Dispatcher"/&gt;
  </code></pre>
  
  <p>Code of Dispatcher Bean:</p>
  
  <pre><code>     public class Dispatcher{
             private static final Log LOG = LogFactory.getLog(Dispatcher.class);
            public void handleEvent(Object eventPayload) throws Exception
            {  
                  LOG.info("got an event"); 
            }
       }
  </code></pre>
  
  <p>The eventPayload Object is of type String and not javax.jms.TextMessage. 
  I tried to change uri="activemq:queue to uri="jms:queue, but then I get some Errors about missing Connection Factories :-( </p>
  
  <p>Hope someone may help? </p>
  
  <p>Regards, Tobi </p>