Re: Closed (removed) StreamCache when doing a Wiretap

2015-04-23 Thread Claus Ibsen
On Wed, Apr 22, 2015 at 10:17 AM, Franz Paul Forsthofer emc2...@googlemail.com wrote: Hello Claus and Henryk, my original proposal to copy the stream cache file is not the optimal solution. A better solution would be to have only one stream cache file and to delete this file only when all

Re: Closed (removed) StreamCache when doing a Wiretap

2015-04-22 Thread Henryk Konsek
Hi, You can also use Wiretap's onPrepareRef option and use custom processor to copy the content of the cached body. Franz, would you be so kind and create a pull request with your fix? Somebody will review it and merge. Thanks in advance! Cheers! wt., 21.04.2015 o 16:25 użytkownik Franz Paul

Re: Closed (removed) StreamCache when doing a Wiretap

2015-04-22 Thread Franz Paul Forsthofer
Hello Claus and Henryk, my original proposal to copy the stream cache file is not the optimal solution. A better solution would be to have only one stream cache file and to delete this file only when all exchanges which need this file are done. This does mean we have to register listeners to the

Re: Closed (removed) StreamCache when doing a Wiretap

2015-04-22 Thread Geert Vanheusden
Hi guys, Thanks for your help. We currently use the suggested workaround with onPrepareRef. Should I still create a ticket in Jira with the test and the suggested fix? Kind regards, Geert On Wed, Apr 22, 2015 at 9:47 AM, Claus Ibsen claus.ib...@gmail.com wrote: Hi Yeah we should likely

Re: Closed (removed) StreamCache when doing a Wiretap

2015-04-22 Thread Geert Vanheusden
Hi Franz, I would certainly prefer this approach. In our case we are handling large files so doing a copy means unnecessary delays and storage usage. Regards, Geert On Wed, Apr 22, 2015 at 10:17 AM, Franz Paul Forsthofer emc2...@googlemail.com wrote: Hello Claus and Henryk, my original

Re: Closed (removed) StreamCache when doing a Wiretap

2015-04-22 Thread Claus Ibsen
Hi Yeah we should likely have a StreamCacheHelper or introduce a copy(boolean clone) method that takes a boolean (with a better name) that indicate it does a indpendenent copy. Then we can keep the inner details how this copy does in those stream cache implementations. The wire tap already does

Re: Closed (removed) StreamCache when doing a Wiretap

2015-04-21 Thread Franz Paul Forsthofer
Hello Geert, there is no solution yet for your problem. Currently the stream cache file is removed at the end of the route which created the file. In your case the stream cache file is deleted when the direct:start route is finished. The wire tap runs in a separate thread and therefore it can

Re: Closed (removed) StreamCache when doing a Wiretap

2015-04-21 Thread Geert Vanheusden
Hi Franz, is this something that will be fixed in an upcoming release? Is it a bug or does it work as designed? Can we use a workaround to avoid this behaviour, for example by not deleting the temp files? Kind regards, Geert On Tue, Apr 21, 2015 at 10:37 AM, Franz Paul Forsthofer

Re: Closed (removed) StreamCache when doing a Wiretap

2015-04-21 Thread Franz Paul Forsthofer
Hi Geert, it is a bug. You can try as a workaround to set the threshold (streamCachingStrategy.setSpoolThreshold(huge_number);) to a huge number; then the body will be kept in memory. Alternatively, you can modify the code of the Camel class org.apache.camel.processor.WireTapProcessor. You have

Closed (removed) StreamCache when doing a Wiretap

2015-04-17 Thread Geert Vanheusden
Hi, I noticed a bug where the body (StreamCache) was already removed before the exchange reached the end (in the Wiretap route). I found the following ticket https://issues.apache.org/jira/browse/CAMEL-8386 and code