Hi  

As you are using the ActiveMQ vm transport, the broker will be exited when the 
camel context is stopped.
Because the broker is not use the persistent store, you will not found the jms 
message even you restart the broker again.

So please start the broker and use the persistent storage before you start the 
camel context.  

--  
Willem Jiang

Red Hat, Inc.
FuseSource is now part of Red Hat
Web: http://www.fusesource.com | http://www.redhat.com
Blog: http://willemjiang.blogspot.com (http://willemjiang.blogspot.com/) 
(English)
          http://jnn.iteye.com (http://jnn.javaeye.com/) (Chinese)
Twitter: willemjiang  
Weibo: 姜宁willem





On Monday, December 24, 2012 at 10:59 PM, cpach wrote:

> Hi all,
>  
> I need to read an XML file:
>  
> <? xml version = "1.0" encoding = "UTF-8">
> <data>
> <name> XXXXX </ name>
> <lastname> YYYYY </ lastname>
> <address> ZZZZZZ </ address>
> </ data>
>  
> This information needs to be stored in a queue ActiveMQ. This is the code,
> but it does not work, what could be wrong?  
>  
> public class FileCopierWithCamel {
>  
> public static void main(String args[]) throws Exception{
> CamelContext context = new DefaultCamelContext();
>  
> ConnectionFactory connectionFactory =
> new ActiveMQConnectionFactory("vm://localhost");  
>  
> context.addComponent("jms",
> JmsComponent.jmsComponentAutoAcknowledge(connectionFactory));
>  
> context.addRoutes(new RouteBuilder(){
> public void configure(){ from("file:Inbox?noop=true")
> .to("jms:queue:data");}
> });
> context.start();
> Thread.sleep(10000);
> context.stop();
> }
>  
> }
>  
>  
> Someone can help me.
>  
> Thank you.
>  
>  
>  
>  
> --
> View this message in context: 
> http://camel.465427.n5.nabble.com/read-xml-file-to-be-sent-to-a-queue-tp5724580.html
> Sent from the Camel Development mailing list archive at Nabble.com 
> (http://Nabble.com).



Reply via email to