apache-camel

What does Camel Splitter actually do with XML Document when splitting with xpath?

柔情痞子 提交于 2019-12-25 03:15:23
问题 I have a document with an order and a number of lines. I need to break the order into lines so I have a camel splitter set to xpath with the order line as it's value. This works fine. However, what I get going forward is an element for the order line, which is what I want, but when converting it I need information from the order element - but if I try to get the parent element via xpath following the split, this doesn't work. Does Camel create copies of the nodes returned by the xpath

Apache Camel ZipInputStream closed with parallel processing

喜夏-厌秋 提交于 2019-12-25 02:52:30
问题 I am successfully using ZipSplitter() to process files inside a zip file. I would like to use parallel processing if possible, but calling parallelProcessing() results in the stream being closed prematurely. This results results in an IOException when the stream is being cached by DefaultStreamCachingStrategy . I note that when parallel processing is enabled, ZipIterator#checkNullAnswer(Message) is called which closes the ZipInputStream . Curiously, everything is dandy if I loiter on this

Global onException to handle multiple RouteBuilder classes

ⅰ亾dé卋堺 提交于 2019-12-25 02:15:09
问题 I need to make onException, to be global over the whole route builders I have in order not to rewrite the same line for every route builder I create . The current scope for my exception handler is a camel context for specific route builder . I need to make route builder classes ,r1 and r2, to use the same onException().process. The current working onException I use : def configure { onException(classOf[CustomException]).process(exceptionProcessor). process(doExtraProcess) from(address).

Enabling Replay mechanism with camel from messages from DB

痞子三分冷 提交于 2019-12-25 01:46:39
问题 Iam trying to implement replay mechanisam with camel ie., i will have to retrieve all the messages already persisted and forward to appropriate camel route to reprocess.This will be triggred by quartz scheduler. I achieved the same by using below. 1) once the quartz scheduler is triggered, fwd to processor which will query db and have the message as list and set the same in camel exchange properties as list. 2) Use the camel in which LoopProcessor will set appropriate xml in the iteration in

Camel JDBC StreamList query appears to load whole resultset before splitting

大憨熊 提交于 2019-12-24 19:29:34
问题 I'm running a SQL consumer to read changes from a table, which is all well and good. However, there are occasions where changes happen on mass, and then my query breaks with out of memory error, as you might expect. Unfortunately, I'm stuck on Camel 2.17.6, so the StreamList option for the SQL component isn't available. (Although according to Camel-SQL Why using StreamList seems to load all ResultSet? this doesn't work as a stream list due to Spring JDBC limitations.) So I've re-written my

Getting the exception 'Cannot find any routes with this RouteBuilder reference: RouteBuilderRef[routebuilderOne]'

孤街浪徒 提交于 2019-12-24 18:22:12
问题 I am getting the exception Cannot find any routes with this RouteBuilder reference: RouteBuilderRef[routebuilderOne] when I am trying to wire the route builder based on configuration. Class file of Route Builder 1 import org.apache.camel.spring.SpringRouteBuilder; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Component; @Component public class RoutebuilderOne extends

How Apache camel SEDA Component works

两盒软妹~` 提交于 2019-12-24 18:19:20
问题 How Apache Camel Seda Component works? 回答1: I did not find any question in your input. Therefore I guess you ask the ultimate question about Life, the Universe and Everything. So, the answer is: 42 ;-) 回答2: Let me explain you with the below code snippet a. from("direct:startProcess") b. .process(new TestProcessor()) c. .split(method(new BaseSplitter<Integer>())) d. .parallelProcessing() e. .to("seda:checkforCorrect"); f. from("seda:checkforCorrect?concurrentConsumers=25") g. …...processing

Camel HazelCast component throwing HazelcastSerializationException

ⅰ亾dé卋堺 提交于 2019-12-24 17:48:00
问题 I have the following route in Camel: <route> <from uri="servlet:///user?matchOnUriPrefix=true"/> <setHeader headerName="cachename"> <simple>${header.CamelHttpPath.split("/")[1]}</simple> </setHeader> <setHeader headerName="key1"> <simple>${header.CamelHttpPath.split("/")[2]}</simple> </setHeader> <to uri="direct:put"/> </route> <route> <from uri="direct:put" /> <!-- If using version 2.8 and above set headerName to "CamelHazelcastOperationType" --> <setHeader headerName=

Camel not recognizing ?lock=false as valid

笑着哭i 提交于 2019-12-24 15:36:43
问题 I've got a camel route reading from a file and it's not deleting the .CamelLock file after the route finishes so I wanted to turn lock off. The documentation for Camel-File says that the attribute is "lock" yet when I do <from uri="file:///data/in/?lock=false" /> I get: Caused by: org.apache.camel.ResolveEndpointFailedException: Failed to resolve endpoint: file:///data/in/?lock=false due to: Failed to resolve endpoint: file:///data/in/?lock=false due to: There are 1 parameters that couldn't

REST EndPoint for Apache Camel

本小妞迷上赌 提交于 2019-12-24 15:23:09
问题 I'm trying to create en REST endpoint with Apache Camel. I already have a REST service that return me JSON content and I want this endpoint to get it. My problem is that I don't know what's happening when my Camel route is built.. For the moment, it doesn't do anything. Here is my code : restConfiguration().component("servlet") .bindingMode(RestBindingMode.json) .dataFormatProperty("prettyPrint", "true").host("localhost") .port(9080); rest("/ContextServices/rest/contextServices/document")