camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cpach <cp...@terra.cl>
Subject read xml file to be sent to a queue
Date Wed, 26 Dec 2012 18:55:20 GMT
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.

Mime
View raw message