HI Frank,

Try with this :

from("timer:foo?period=1s").setBody(body().append("Message at
${date:now:yyyy-MM-dd HH:mm:ss}")).to("|activemq:|activemq/queue/TestQueue
");


activemq:
http://camel.apache.org/activemq.html


On 3/02/2015 9:30, frank1970 wrote:
Hi all!
I'm trying to route some messages to an ActiveMQ server. Basically I'd need
to rewrite the tomcat-active-example to use Camel Java API and run in on
another application server.
So I have started ActiveMQ on my machine and defined a queue named
"activemq/queue/TestQueue".
Next I have coded as follows the connection to ActiveMQ:

CamelContext context = new DefaultCamelContext();
ConnectionFactory connectionFactory = new ActiveMQConnectionFactory(
                                "tcp://0.0.0.0:61616");
context.addComponent("jms",
                                
JmsComponent.jmsComponentAutoAcknowledge(connectionFactory));
context.addRoutes(new RouteBuilder() {
        public void configure() {
                from("timer:foo?period=1s").setBody(body().append("Message at
${date:now:yyyy-MM-dd HH:mm:ss}")).to("jms:activemq:/queue/TestQueue");
                        }
                });

The application executes without any error, however surfing on the ActiveMQ
console I can see no messages have been received by any consumer. Any idea
what's wrong with it?
Thanks
Frank



--
View this message in context: 
http://camel.465427.n5.nabble.com/Routing-messages-to-ActiveMQ-queue-tp5762345.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Reply via email to