title: ActiveMQ, Camel, Spring, simple route not working
body: <p>I am having some trouble with a simple camel route that should be grabbing a message from an ActiveMQ topic that I have and then printing out the contents of the messages to the console through the use of log. </p>
  
  <p>Right now all that it is is the camel-context.xml, and a java class that is producing the topic in ActiveMQ and adding a simple string message to the queue. I am using the ActiveMQ interface to check to see if the topic is being created, and it is, but my message is not being added to the topic nor is it being routed through the camel route. Running main I can get the output of my sys out to the console, and I see that 1 message is "enqueued" and 1 message is "dequeued" in the activemq interface. I just do not get any output to the console from the "log message" in my route.</p>
  
  <p>Any help or tips would be greatly appreciated since I am new to all 3 of these technologies, and I just want to get this simple "Hello World" working. </p>
  
  <p>Thank you! The two files are found below:</p>
  
  <p>After further testing I think that it just has something to do with the way that I am trying to log the contents of the message, because I know that it is picking up my camel route because I added a second topic and told the camel route to route the messages to it like the following:</p>
  
  <p>to uri="activemq:topic:My.SecondTestTopic"</p>
  
  <p>and I am able to see if being redirected to that queue in the activeMQ interface.</p>
  
  <hr>
  
  <h2>TestMessageProducer.java</h2>
  
  <pre><code>package com.backend;
  
  import javax.jms.*;
  
  import org.apache.activemq.ActiveMQConnection;
  import org.apache.activemq.ActiveMQConnectionFactory;
  
  public class TestMessageProducer {
  
   private static String url = ActiveMQConnection.DEFAULT_BROKER_URL;
  
      public static void main(String[] args) throws JMSException {
  
          ConnectionFactory connectionFactory = new ActiveMQConnectionFactory(url);
          Connection connection = connectionFactory.createConnection();
          connection.start();
  
  
          Session session = connection.createSession(false,
                  Session.AUTO_ACKNOWLEDGE);
  
          Topic topic = session.createTopic("My.TestTopic");
  
          MessageProducer producer = session.createProducer(topic);
  
          TextMessage message = session.createTextMessage();
  
          message.setText("THIS IS A TEST TEXT MESSAGE BEING SENT TO THE TOPIC AND HOPEFULLY BEING PICKED UP BY THE" +
                  "CAMEL ROUTE");
  
          producer.send(message);
          System.out.println("Sent message '" + message.getText() + "'");
  
          connection.close();
      }
  </code></pre>
  
  <p>}</p>
  
  <hr>
  
  <h2>Camel-context.xml</h2>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  
  &lt;spring:beans xmlns:spring="http://www.springframework.org/schema/beans"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xmlns="http://camel.apache.org/schema/spring"
  xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
  xmlns:alch="http://service.alchemy.kobie.com/"
  xsi:schemaLocation="http://www.springframework.org/schema/beans classpath:META-INF/spring/spring-beans.xsd 
      http://camel.apache.org/schema/spring classpath:META-INF/spring/camel-spring.xsd"&gt;
  
  &lt;!-- load properties --&gt;
  &lt;spring:bean
      class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"&gt;
      &lt;spring:property name="locations" value="file:backend.properties" /&gt;
  &lt;/spring:bean&gt;
  
  &lt;spring:bean id="properties"
      class="org.apache.camel.component.properties.PropertiesComponent"&gt;
      &lt;spring:property name="location" value="file:backend.properties" /&gt;
  &lt;/spring:bean&gt;
  
  &lt;spring:bean id="jmsConnectionFactory" 
      class="org.apache.activemq.ActiveMQConnectionFactory"&gt;
      &lt;spring:property name="brokerURL" value="tcp://0.0.0.0:61616?useLocalHost=true" /&gt;
  &lt;/spring:bean&gt;
  
  &lt;spring:bean id="pooledConnectionFactory" 
      class="org.apache.activemq.pool.PooledConnectionFactory"&gt;
      &lt;spring:property name="maxConnections" value="8" /&gt;
      &lt;spring:property name="maximumActive" value="500" /&gt;
      &lt;spring:property name="connectionFactory" ref="jmsConnectionFactory" /&gt;
  &lt;/spring:bean&gt;
  
  &lt;spring:bean id="jmsConfig" 
      class="org.apache.camel.component.jms.JmsConfiguration"&gt;
      &lt;spring:property name="connectionFactory" ref="pooledConnectionFactory"/&gt;
      &lt;spring:property name="transacted" value="false"/&gt;
      &lt;spring:property name="concurrentConsumers" value="1"/&gt;
  &lt;/spring:bean&gt;
  
  &lt;spring:bean id="activemq" 
      class="org.apache.activemq.camel.component.ActiveMQComponent"&gt;
      &lt;spring:property name="configuration" ref="jmsConfig"/&gt;
  &lt;/spring:bean&gt;
  
  
  &lt;!-- camel configuration --&gt;
  
   &lt;camelContext xmlns="http://camel.apache.org/schema/spring"&gt;
  &lt;route&gt;
    &lt;from uri="activemq:topic:My.TestTopic"/&gt;
    &lt;log message="Output of message from Queue: ${in.body}"/&gt;
    &lt;to uri="activemq:topic:My.SecondTestTopic" /&gt;
  &lt;/route&gt;
  </code></pre>
  
  <p>
    </p>