Hi

If you run from a java main then you need to keep your application
running, and also start spring etc.

See this FAQ
http://camel.apache.org/running-camel-standalone.html

and this link
http://camel.apache.org/running-camel-standalone-and-have-it-keep-running.html

On Wed, Dec 26, 2012 at 7:55 PM, cpach <cp...@terra.cl> wrote:
> Hi all,
> I need to read a 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. I am working with
> spring. this is file:
>
> <?xml version="1.0" encoding="UTF-8"?>
> <beans xmlns="http://www.springframework.org/schema/beans";
>         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
>         xsi:schemaLocation="http://www.springframework.org/schema/beans
>         http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
>         http://camel.apache.org/schema/spring
>         http://camel.apache.org/schema/spring/camel-spring.xsd";>
>
>         <bean id="jms" class="org.apache.camel.component.jms.JmsComponent">
>                 <property name="connectionFactory">
>                 <bean class="org.apache.activemq.ActiveMQConnectionFactory">
>                 <property name="brokerURL" value="vm://localhost" />
>                 </bean>
>                 </property>
>         </bean>
>
>         <bean id="downloadLogger" class="bbr_camel.bbr_camel.DownloadLogger"/>
>
>         <camelContext xmlns="http://camel.apache.org/schema/spring";>
>                 <route>
>                         <from uri="file:Inbox?noop=true"/>
>                         <process ref="downloadLogger"/>
>                         <to uri="jms:queue:ficha"/>
>                 </route>
>         </camelContext>
> </beans>
>
> call from a main,
>
> public class FileCopierWithCamel {
>
>            public static void main(String args[]) throws Exception{
> try {
>                                 final ApplicationContext context = new
> ClassPathXmlApplicationContext("context-jms.xml");
>                         } catch (Exception e) {
>                                 System.out.println("Ex: " + e);
>                                 e.printStackTrace();
>                         }
>            }
>         }
>
>
> but does not keep in line, no errors occur, eventually not work.
>
> anyone has any idea of the problem.
>
> Thank you.
>
>
>
>
> --
> View this message in context: 
> http://camel.465427.n5.nabble.com/read-xml-file-to-be-sent-to-a-queue-tp5724604.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
Claus Ibsen
-----------------
Red Hat, Inc.
FuseSource is now part of Red Hat
Email: cib...@redhat.com
Web: http://fusesource.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen

Reply via email to