Re: Cached temp files not deleted when StreamCaching is enabled

2014-08-06 Thread Chirag Dewan
I am running on Linux(red hat). From: Claus Ibsen To: "users@camel.apache.org" Sent: Wednesday, 6 August 2014 7:20 PM Subject: Re: Cached temp files not deleted when StreamCaching is enabled What OS are you using? Are you running on window or something els

Re: How to relay different parts of message to different endpoints

2014-08-06 Thread Paul McCulloch
I guess you could return a List of pairs (fieldcount,byte[]), then split & then use the CBR to look at the field count & dispatch accordingly. A simpler approach would be to do what the MySplitterBean example does in http://camel.apache.org/splitter.html. In your case return the byte[] in each of

Re: Java 8 support and (separately) is Github the best place to submit code improvements?

2014-08-06 Thread rickaroni
Tremendous, and many thanks! -- View this message in context: http://camel.465427.n5.nabble.com/Java-8-support-and-separately-is-Github-the-best-place-to-submit-code-improvements-tp5754864p5754866.html Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Java 8 support and (separately) is Github the best place to submit code improvements?

2014-08-06 Thread Claus Ibsen
Hi You can find details about the upcoming releases at the section _releases in progress_ at http://camel.apache.org/download And for code contributions see http://camel.apache.org/contributing.html If you are familiar with github and want to do it that way, then just do it the usual github way.

Java 8 support and (separately) is Github the best place to submit code improvements?

2014-08-06 Thread rickaroni
Hiya, I've just taken the Camel sources from GitHub here: https://github.com/apache/camel This seems to be work towards a 2.14-SNAPSHOT release. Is Java 8 be support planned for 2.14? Spring 4? Separately, is that github repository above the best place to submit code improvement ideas? There

Re: How to relay different parts of message to different endpoints

2014-08-06 Thread dermoritz
process() is a void method but do you mean instead of a byte[] i just List into "exchange.getOut().setBody(returnVal)? The split would then automatically split into 2 byte[]? but how to know the number of fields in each one? -- View this message in context: http://camel.465427.n5.nabble.com/Ho

Re: How to relay different parts of message to different endpoints

2014-08-06 Thread Paul McCulloch
If your processor does something like byte[] a = ... byte[] b = ... List returnVal = new ... returnVal.add(a); returnVal.add(b); return returnVal Then you can use split(body()) to get one message for each of your byte[] On 6 August 2014 14:49, Paul McCulloch wrote: >

Re: Cached temp files not deleted when StreamCaching is enabled

2014-08-06 Thread Claus Ibsen
What OS are you using? Are you running on window or something else? On Wed, Aug 6, 2014 at 12:47 PM, Chirag Dewan wrote: > Hi Claus, > > I have stopped my application,thus stopping CamelContext. But still I can see > the Spool directory. > > > Dont know if I am doing something wrong. Can this be

Re: How to relay different parts of message to different endpoints

2014-08-06 Thread Paul McCulloch
If your processor does: On 6 August 2014 14:45, dermoritz wrote: > How to do this? The 2 byte[] are created into a processor. I have to > create 2 > byte[] from one byte[] and i don't want to read the input byte[] twice. > > In meantime i found: > > http://camel.apache.org/how-do-i-write-a-cus

Re: How to relay different parts of message to different endpoints

2014-08-06 Thread dermoritz
How to do this? The 2 byte[] are created into a processor. I have to create 2 byte[] from one byte[] and i don't want to read the input byte[] twice. In meantime i found: http://camel.apache.org/how-do-i-write-a-custom-processor-which-sends-multiple-messages.html with this i think i can create 2

Re: Polling a directory for inner directories

2014-08-06 Thread Claus Ibsen
On Wed, Aug 6, 2014 at 12:03 PM, jkir wrote: > Ok thank you Claus, do you happen to know why this isn't supported? It seems > like it should be fairly simple to enable support for and I imagine it's a > pretty common use case. If there's nothing preventing it from being included > then I could hop

Re: How to relay different parts of message to different endpoints

2014-08-06 Thread Paul McCulloch
Use split() to turn your 2 byte[] in to two messages? On 6 August 2014 14:08, dermoritz wrote: > From unmarshal().gzip() comes a byte[] (with mixed number of fields in each > line). > > My processor scans the byte[] line by line some lines have 35 ',' some have > 65 ',' and i want to scan each

Re: How to relay different parts of message to different endpoints

2014-08-06 Thread dermoritz
>From unmarshal().gzip() comes a byte[] (with mixed number of fields in each line). My processor scans the byte[] line by line some lines have 35 ',' some have 65 ',' and i want to scan each byte[] only once. So i create 2 byte arrays one with 35er lines and one with 65er lines. My question is wha

Re: How to relay different parts of message to different endpoints

2014-08-06 Thread Walzer, Thomas
You don´t have to unmarshal the csv. As long as your processor sets the header („numberOfFields“) correctly (eg by counting the number of “,“) you can afterwards use choice to route to the appropriate endpoints. No need to create 2 byte[]. Your processor emits everything and you filter afterwards

Re: How to relay different parts of message to different endpoints

2014-08-06 Thread dermoritz
Thanks, in my case i don't want to use unmarchal().csv() because i don't need the lines to be split (complet csv lines will be sent to "to"). So my route i something like this: from("file:src/test/resources/?fileName=foo.csv&noop=true"). unmarshal().gz(). // body is byte[] at the moment my

Writing camel test cases for existing service without changing its endpoint to mock manually

2014-08-06 Thread Amar
Hi, I have created CXF webservice as route using Talend ESB tool and published it. Now i want to test it using camel test cases. I gone through couple of examples of using camel test cases API but there i manually included the route by changing the endpoint to mock. I want to test the existing

Re: How to relay different parts of message to different endpoints

2014-08-06 Thread Paul McCulloch
How about something along the lines of: from("file:src/test/resources/?fileName=foo.csv&noop=true"). unmarshal().csv(). split(body()). setHeader("numberOfFields", bean("FieldCounter")). choice(). when(header("numberOfFields").isEqualTo(34) .to("direct:a"

Re: How to relay different parts of message to different endpoints

2014-08-06 Thread dermoritz
Thanks for this hint but how to implement the processor that splits to 2 types: if i scan through the file i'll end up with 2 messages/blocks (1 for each content type). So how to implement the splitting - create 2 exchanges (for each content type) from on exchange (1 csv file). Is there a way that

Re: Cached temp files not deleted when StreamCaching is enabled

2014-08-06 Thread Chirag Dewan
Hi Claus, I have stopped my application,thus stopping CamelContext. But still I can see the Spool directory. Dont know if I am doing something wrong. Can this be a permissions issue? Would it help if I configure my Spool diectory to somewhere other than tmp ? Thanks! Chirag _

Re: Polling a directory for inner directories

2014-08-06 Thread akoufoudakis
I might be wrong, but "File" in terms of enterprise integration patterns is not a directory. It is a piece, which contains information inside, which can be processed. A file is a kind of a message (people more experienced with EIP might want to kill me for the last statement). Since, Camel is an in

Re: Polling a directory for inner directories

2014-08-06 Thread jkir
Ok thank you Claus, do you happen to know why this isn't supported? It seems like it should be fairly simple to enable support for and I imagine it's a pretty common use case. If there's nothing preventing it from being included then I could hopefully get round to writing a patch for it. I guess i

Re: How to relay different parts of message to different endpoints

2014-08-06 Thread Paul McCulloch
Perhaps, rather than filtering, your processor could just add a header which states the number of fields in the file. You could then use Filter & Content Based Router to send the messages to the appropriate place? On 6 August 2014 10:18, dermoritz wrote: > I have to handle csv (gz compressed) f

Re: Polling a directory for inner directories

2014-08-06 Thread Claus Ibsen
This is by design the file component is for consuming *files*, not directories. On Wed, Aug 6, 2014 at 10:58 AM, jkir wrote: > Unfortunately, after digging through the source code for the FileConsumer, it > seems that although most of the framework is there for matching the > directories themse

How to relay different parts of message to different endpoints

2014-08-06 Thread dermoritz
I have to handle csv (gz compressed) files that contain lines with different number of fields. at the moment i am only interested in lines with 35 fields (contain 34 ','). I wrote a processor that filters those lines. after the processor the exchange is multicasted to some endpoints. Now i also ne

Re: Cached temp files not deleted when StreamCaching is enabled

2014-08-06 Thread Claus Ibsen
The spool directory is only removed when CamelContext is stopped. See documentation at http://camel.apache.org/stream-caching.html You can turn this off with removeSpoolDirectoryWhenStopping On Wed, Aug 6, 2014 at 10:25 AM, Chirag Dewan wrote: > Hi Claus, > > Sorry for the delay to try the fi

Re: Polling a directory for inner directories

2014-08-06 Thread jkir
Unfortunately, after digging through the source code for the FileConsumer, it seems that although most of the framework is there for matching the directories themselves, there appears to be one area preventing it from adding the directory itself to the files list for further processing. Taken from

Re: errorHandler and onException

2014-08-06 Thread apanday
Edit: Ok, the first file doesn't really vanish, it is moved to a ".camel" directory under the input directory. So the proper interpretation is probably that the first file is "waiting" to be deliverable to the rabbit, and since there can be only one, the second file gets an actual error. As for

Re: Cached temp files not deleted when StreamCaching is enabled

2014-08-06 Thread Chirag Dewan
Hi Claus, Sorry for the delay to try the fix and revert. I actually upgraded the camel to 2.13.0. And switched from hdfs2 to file component(cannot try with log as you suggested,as that would require a lot of changes) the issue is still there. The only difference I can observe is that,the cache

How to release lock of file to move it on exception (corrupted gz file)

2014-08-06 Thread dermoritz
I need to implement a handler that reacts on ZipException to move away corrupted gz files, otherwise the route will endlessly retry to unmarshal the gz. The problem is that at the moment the exception is thrown there is a lock on this file (on linux "canWrite()" returns fals) and ther is the camel