apache-camel

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

主宰稳场 提交于 2019-12-06 05:03:07
问题 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>

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

送分小仙女□ 提交于 2019-12-06 04:42:16
问题 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

Unit testing FTP consumer with Apache Camel

本秂侑毒 提交于 2019-12-06 04:33:10
问题 I have the below route. In unit test, since I doesn't have the FTP server available, I'd like to use camel's test support and send an invalid message to "ftp://hostname/input" and verify that it failed and routed to "ftp://hostname/error" . I gone through the documentation which mainly talks about using the "mock:" endpoint but I am not sure how to use it in this scenario. public class MyRoute extends RouteBuilder { @Override public void configure() { onException(EdiOrderParsingException

how to set id of camel processor or other route ingredients

安稳与你 提交于 2019-12-06 04:27:55
Camel automatically generates id for processors and other stuff (processor1..processor25). Is there a way to set this name? We need to identify certain processors via jmx to get telemetry data. The names I want to set are given via properties - they are known on start time. So I need to set them when route is defined or within the processor (name is given via processors constructor, the string is also used for processing). Update Example: for a route from("some:where").process(myProcessor).to(no:where) i need to set the id of myProcessor. I need "ExchangesTotal" and other stuff from certain

How to mock multiple components in camel unit test?

旧巷老猫 提交于 2019-12-06 04:17:39
I'm using the CamelTestSupport in camel version 2.13.1. I'd like to do something like this to mock out two different components: @Override public String isMockEndpoints() { return "(activemq|exec)*"; } I can't just mock everything with "*" because I was getting errors from the activiti framework I'm using, which relies on the activiti component. Have any of you found a way to do something like this? You can use regular expression, so its something a like: return "(activemq.*|exec.*)" See bottom of this page http://camel.apache.org/intercept 来源: https://stackoverflow.com/questions/24458180/how

Apache Camel Loop does not stop on exception

余生颓废 提交于 2019-12-06 04:16:59
I have camel loop configured within the main route of camelContext.xml file that would invoke request processing route 3 times. I have also configured onException xml handler (set handled to true). However, when there is an exception on the first iteration the execution control goes to onException block but loop doesn't stop processing instead the other 2 iterations (2nd and 3rd) do happen too. I would like to have loop stopped as soon as exception occurs. Can anyone please help Thanks in advance Ramesh Ah its a bug in Apache Camel. I have logged a ticket and have a fix for this. https:/

Camel's CXF component not catching onException(Exception.class)

邮差的信 提交于 2019-12-06 04:14:44
问题 I have a camel-cxf webservice up. I use to handle all SOAP Faults in the CXF's SOAP Fault Interceptor mechanism. That is working well. I thought that its better to handle Exception thrown at the Camel layer at the same layer and wrote a simple onException scenario like this: onException(Exception.class). to("direct:MyWSExceptionHandler"); Whenever a custom exception is thrown, I was expecting the onException to kick in(Remember I also have a SOAP Fault Interceptor too), but it doesn't. The

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

本小妞迷上赌 提交于 2019-12-06 03:42:40
问题 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

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

元气小坏坏 提交于 2019-12-06 02:38:14
问题 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

Consumer Poll Rate with Akka, SQS, and Camel

浪尽此生 提交于 2019-12-06 01:48:36
问题 A project I'm working on requires the reading of messages from SQS, and I decided to use Akka to distribute the processing of these messages. Since SQS is support by Camel, and there is functionality built in for use in Akka in the Consumer class, I imagined it would be best to implement the endpoint and read messages this way, though I had not seen many examples of people doing so. My problem is that I cannot poll my queue quickly enough to keep my queue empty, or near empty. What I