camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Morgan Hautman <morgan.haut...@gmail.com>
Subject Re: Routing messages to ActiveMQ queue
Date Tue, 03 Feb 2015 08:43:53 GMT
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.


Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message