You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by Marco Crivellaro <mc...@optasportsdata.com> on 2011/03/07 14:18:29 UTC

camel caching producers

Hi all,
having a look the to memory usage of my camel based application; I've found
out camel is caching producers.
I am running a huge amount of deliveries to distinct endpoints, is there a
way to limit the amount of producers cached?

--
View this message in context: http://camel.465427.n5.nabble.com/camel-caching-producers-tp3412417p3412417.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: camel caching producers

Posted by Marco Crivellaro <mc...@optasportsdata.com>.
thank you.

Is there any way I can access the list of producers and stop them at the end
of the route?
In such a way I will ensure I won't risk a high memory consumption if the
route will server thousands of distinct ftp servers (which could be the case
in the future)

--
View this message in context: http://camel.465427.n5.nabble.com/camel-caching-producers-tp3412417p3415537.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: camel caching producers

Posted by Claus Ibsen <cl...@gmail.com>.
On Mon, Mar 7, 2011 at 5:35 PM, Marco Crivellaro
<mc...@optasportsdata.com> wrote:
> thanks,
> the temporary file name we use is also dinamic, which is the Exchange header
> to set the tempFileName uri property?
>

There is no header for that option. But the tempFileName can be set
using simple expression, eg tempFileName=${file:name.noext}.tmp

And hence it can be the same for them all.


> --
> View this message in context: http://camel.465427.n5.nabble.com/camel-caching-producers-tp3412417p3412698.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>



-- 
Claus Ibsen
-----------------
FuseSource
Email: cibsen@fusesource.com
Web: http://fusesource.com
Twitter: davsclaus
Blog: http://davsclaus.blogspot.com/
Author of Camel in Action: http://www.manning.com/ibsen/

Re: camel caching producers

Posted by Marco Crivellaro <mc...@optasportsdata.com>.
thanks,
the temporary file name we use is also dinamic, which is the Exchange header
to set the tempFileName uri property?

--
View this message in context: http://camel.465427.n5.nabble.com/camel-caching-producers-tp3412417p3412698.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: camel caching producers

Posted by Claus Ibsen <cl...@gmail.com>.
On Mon, Mar 7, 2011 at 5:13 PM, Marco Crivellaro
<mc...@optasportsdata.com> wrote:
> problem is I am using a recipientList to serve our endpoints as we are not
> serving only FTP endpoints.
> any way to limit LRU cache?
>

Just send to a bean or whatever instead of directly to ftp. Then in
the bean you can set the filename as a header, instead from the url,
and use the re-usable ftp endpoint.

This has been discussed before on the forum, so you could maybe google
and read some of those threads.

>
> --
> View this message in context: http://camel.465427.n5.nabble.com/camel-caching-producers-tp3412417p3412665.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>



-- 
Claus Ibsen
-----------------
FuseSource
Email: cibsen@fusesource.com
Web: http://fusesource.com
Twitter: davsclaus
Blog: http://davsclaus.blogspot.com/
Author of Camel in Action: http://www.manning.com/ibsen/

Re: camel caching producers

Posted by Marco Crivellaro <mc...@optasportsdata.com>.
problem is I am using a recipientList to serve our endpoints as we are not
serving only FTP endpoints.
any way to limit LRU cache?


--
View this message in context: http://camel.465427.n5.nabble.com/camel-caching-producers-tp3412417p3412665.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: camel caching producers

Posted by Claus Ibsen <cl...@gmail.com>.
On Mon, Mar 7, 2011 at 5:02 PM, Marco Crivellaro
<mc...@optasportsdata.com> wrote:
> that means that if I need to deliver to 1000 distinct ftp servers I should
> expect space to be allocated even if they are used just once? Isn't there a
> way to get the garbage collected?
>

The cache is LRU based so they will be discarded when it hit its limit.

You can always just create a one time use producer, use it, and then stop it

Producer producer = ... create producer using Camel API
producer.start
... // process (= send) the message using the producer
producer.stop



> --
> View this message in context: http://camel.465427.n5.nabble.com/camel-caching-producers-tp3412417p3412643.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>



-- 
Claus Ibsen
-----------------
FuseSource
Email: cibsen@fusesource.com
Web: http://fusesource.com
Twitter: davsclaus
Blog: http://davsclaus.blogspot.com/
Author of Camel in Action: http://www.manning.com/ibsen/

Re: camel caching producers

Posted by Marco Crivellaro <mc...@optasportsdata.com>.
that means that if I need to deliver to 1000 distinct ftp servers I should
expect space to be allocated even if they are used just once? Isn't there a
way to get the garbage collected?

--
View this message in context: http://camel.465427.n5.nabble.com/camel-caching-producers-tp3412417p3412643.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: camel caching producers

Posted by Claus Ibsen <cl...@gmail.com>.
For FTP set the filename as a header and reuse the endpoint uri if possible.
That's the way to reuse ftp endpoints.


On Mon, Mar 7, 2011 at 4:56 PM, Marco Crivellaro
<mc...@optasportsdata.com> wrote:
> even setting cache limit to 10 and disabling camel JMX support
> (-Dorg.apache.camel.jmx.disabled=true)
> I can see the number of FTPClient, FTPConfiguration, FTPOperations,
> FTPEndpoint and ListenerList growing constantly.
>
> Each exchange I run has a distinct endpoint URI
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/camel-caching-producers-tp3412417p3412637.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>



-- 
Claus Ibsen
-----------------
FuseSource
Email: cibsen@fusesource.com
Web: http://fusesource.com
Twitter: davsclaus
Blog: http://davsclaus.blogspot.com/
Author of Camel in Action: http://www.manning.com/ibsen/

Re: camel caching producers

Posted by Marco Crivellaro <mc...@optasportsdata.com>.
even setting cache limit to 10 and disabling camel JMX support
(-Dorg.apache.camel.jmx.disabled=true)
I can see the number of FTPClient, FTPConfiguration, FTPOperations,
FTPEndpoint and ListenerList growing constantly.

Each exchange I run has a distinct endpoint URI

--
View this message in context: http://camel.465427.n5.nabble.com/camel-caching-producers-tp3412417p3412637.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: camel caching producers

Posted by Marco Crivellaro <mc...@optasportsdata.com>.
thanks a lot!

--
View this message in context: http://camel.465427.n5.nabble.com/camel-caching-producers-tp3412417p3412449.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: camel caching producers

Posted by Claus Ibsen <cl...@gmail.com>.
See
http://camel.apache.org/how-do-i-configure-the-default-maximum-cache-size-for-producercache-or-producertemplate.html


On Mon, Mar 7, 2011 at 2:18 PM, Marco Crivellaro
<mc...@optasportsdata.com> wrote:
> Hi all,
> having a look the to memory usage of my camel based application; I've found
> out camel is caching producers.
> I am running a huge amount of deliveries to distinct endpoints, is there a
> way to limit the amount of producers cached?
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/camel-caching-producers-tp3412417p3412417.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>



-- 
Claus Ibsen
-----------------
FuseSource
Email: cibsen@fusesource.com
Web: http://fusesource.com
Twitter: davsclaus
Blog: http://davsclaus.blogspot.com/
Author of Camel in Action: http://www.manning.com/ibsen/