camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Willem jiang <willem.ji...@gmail.com>
Subject Re: read xml file to be sent to a queue
Date Thu, 27 Dec 2012 01:33:57 GMT
Hi you are using the vm transport, which means the JMS broker doesn't store the message into
persistent storage.
When the JVM is exit, the message which is stored into the JMS broker will gone.

I think you can take a look at the camel-example-spring-jms[1].

[1]https://svn.apache.org/repos/asf/camel/trunk/examples/camel-example-spring-jms  

--  
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 Thursday, December 27, 2012 at 2:55 AM, cpach 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 (http://Nabble.com).




Mime
View raw message