Hello,

We are using Camel 2.2.0 with Spring 3.0.1.RELEASE in the context of a web
service.

We've been using @EndpointInject to inject ProducerTemplates into our beans. 
Some of our beans are request scoped, and so a new ProducerTemplate is
created and injected on each request.

After more study this seems to run counter to the idea of ProducerTemplate,
which appears to have been conceived as a long-lived object rather than
transient.  It seems perhaps the documentation of @EndpointInject might
point this out; injecting into singletons makes perfect sense but injecting
into request-scoped beans may be undesirable.

Specifically, the issue we found is that each ProducerTemplate creates a
Producer which then is registered with JMX.  Eventually we wind up with
thousands of Producers referenced by JMX (but otherwise garbage) resulting
in OOM errors.

It seems like a bug that Camel's JMX integration prevents producers from
being eligible for GC.  But how best to proceed with making a
ProducerTemplate available to request scoped beans?

Thanks!

Matt
-- 
View this message in context: 
http://old.nabble.com/Injecting-ProducerTemplates%2C-scoping%2C-and-JMX-memleak-tp28219199p28219199.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Reply via email to