apache-camel

how to use xpath in camel-context.xml to check if a particular node is exist or not

痴心易碎 提交于 2019-12-04 10:24:11
I am trying to develop a content-based routing camel application. This application will look at the folder src/data to see if there is a SOAP request file that has node <e2d:getOrderDetaiRequest> , then that file will be copy into target/message, otherwise the file will be copy to target/other. Do you know how to use xpath(or any other tools ) to check that condition (i prefer using camel-context.xml file)? Here is my camel-context <route> <from uri="file://c:/src/data?noop=true"/> <choice> <when> <xpath>**???????????????????????????**</xpath> <to uri="file://c:/target/message"/> </when>

Camel - Stream cache not caching / can't convert?

邮差的信 提交于 2019-12-04 10:02:01
I seem to be losing my 'in' body after reading it once. Note that I am using Camel's stream caching, and that the input is a json file from the http component. I have a processor with the following code. log.debug("Body Type: " + exchange.getIn().getBody().getClass().getCanonicalName()); log.debug("In msg1:" + exchange.getIn().getBody(String.class)); log.debug("In msg2:" + exchange.getIn().getBody(String.class)); What I'd expect to see here is that msg1 and msg2 are the same output, However msg2 returns a blank string (not null). Here are the logs at TRACE level. 1- DEBUG com.mycompany

Setting custom Soap-Header to pojo-message in Camel-CXF

心已入冬 提交于 2019-12-04 09:49:48
I have a Problem with cxf soap-headers. I set up an cxf-project with the Contract-firs-development method. I want to call a web-service with an cxf-component, which looks like this. <cxf:cxfEndpoint id="ICCSCustomerService" address="http://localhost:8080/iccs-xsoap/CustomerService/updateCustomer" serviceClass="de.iccs.xsoap.customer.v1.CustomerServiceImpl" > </cxf:cxfEndpoint> I want to send an pojo-message throw an direct-component as an request for the ws. My route looks like this: <route id="CustomerServiceUpdateCustomerTest"> <camel:from uri="direct:iccsUpdateCustomerRequest"/> <camel

How can I validate xsd using apache camel?

久未见 提交于 2019-12-04 09:44:05
问题 I'm using apacheservicemix and I try to validate a xml document with apache camel. I have this route called students_route.xml : <?xml version="1.0" encoding="UTF-8"?> <blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation=" http://www.osgi.org/xmlns/blueprint/v1.0.0 http://www.osgi.org/xmlns/blueprint/v1.0.0/blueprint.xsd"> <camelContext xmlns="http://camel.apache.org/schema/blueprint"> <route> <from uri="file

What is the difference between “seda + concurrentConsumers” and “direct + threads”

穿精又带淫゛_ 提交于 2019-12-04 09:04:18
Apache Camel provide two solutions for using thread pool: from("seda:stageName?concurrentConsumers=5").process(...) and from("direct:stageName").thread(5).process(...) I would like to know, what is the difference between the two solutions ? Is it just two kind of write the same thing or not ? What are the use cases ? SEDA Component The seda: component provides asynchronous SEDA behavior so that messages are exchanged on a BlockingQueue and consumers are invoked in a separate thread to the producer. Direct Component The direct: component provides direct, synchronous invocation of any consumers

Camel- Split List<MyObj> and process each java object - XML Config

。_饼干妹妹 提交于 2019-12-04 08:40:13
I am unable to split Java objects that are in a List. How I can tokenize / convert Body to to single java objects? <route id="cleanupMigratedFiles" autoStartup="true"> <from uri="timer://kickoff?period=5s" /> <bean ref="migrationProcessor" method="getCacheDeleteObjects" /> <!-- this gives me a List-of-CacheMigr --> <log message="\n\t########\n\tCleanupMigrated file: ${body}" /> <pipeline> <split> <tokenize /> <!-- How to tokenize a List-of-CacheMigr --> <convertBodyTo type="era.oddw.entity.CacheMigr" /> <!-- Do I need this? --> <log message="\n\t########\n\tCleanupMigrated file: ${body}" /> <

Apache Camel timer: “period” vs “fixedRate”

五迷三道 提交于 2019-12-04 08:33:24
What is the exact use of "period" and "fixedRate" together ? does it really make sense because if i specified the "period" value then anyways timer will trigger after that interval. So what is the exact use of "fixedRate" flag ? I am confused please help me out ! You can read the javadoc api of the java.util.Timer at: http://docs.oracle.com/javase/7/docs/api/java/util/Timer.html They explain the difference between fixed rate and delayed. 来源: https://stackoverflow.com/questions/17786173/apache-camel-timer-period-vs-fixedrate

Implement Request-Reply pattern using ActiveMQ, Camel and Spring

本小妞迷上赌 提交于 2019-12-04 06:50:48
I am trying to implement the following functionality: Read CSV file line-by-line then for every line: Build request based on the values that the line contains Send the request to the message queue Other component needs to pick up the message, process the request and send the response to another message queue (known to producer, so the producer could pick up the response). I believe that the request-reply pattern fits the bill. I installed ActiveMQ, downloaded camel and tried to use their jms project. After configuring the component, the queue and testing connection (worked), I tried to figure

LinkageError when calling webservice method

旧城冷巷雨未停 提交于 2019-12-04 06:40:06
问题 I have an apache servicemix (camel 2.9) route which calls a bean, that in turn makes a SOAP request. The SOAP code is generated via wsdl2java and works fine (cxf 2.4.0). The problem i have is when a SOAP fault is thrown, i get the following issue: Caused by: java.lang.LinkageError: loader constraint violation: loader (instance of <bootloader>) previously initiated loading for a different type with name "javax/xml/soap/SOAPFault" at javax.xml.ws.soap.SOAPFaultException.<init>

Initializing camel from Spring annotation config

青春壹個敷衍的年華 提交于 2019-12-04 06:05:51
I am trying to learn Spring and understand how it works. I have followed some tutorials in setting up Spring and Camel, and have had it working using default setups. I am now attempting to convert as much as possible of my configuration XML-files to Java-classes. So far I have been successful in creating the camel-routes in a Java-class (extending SpringRouteBuilder and implementing configure() ), and all the beans from my spring-configuration file (Bean->Function with @Bean). The only part I am missing is the camelContext definition (?) that starts my camel routes (I think...): <camel