You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by J_Racker <jo...@rackspace.com> on 2010/02/22 18:17:04 UTC
Potential Memory Leak with Dynamic Routes Specified via
RecipientList
Hi,
I'm seeing an issue when using an dynamic route specified via a recipient
list. I'm running Camel 2.1.0 and my route looks like the following:
from(outQueue).to("bean:messageValidator").setHeader("CamelFileName",
getFileNameXpath()).recipientList(getResponseEndpoint());
where getResponseEndpoint() looks something like this:
private Expression getResponseEndpoint() {
Expression rootDirectoryEndpoint =
ExpressionBuilder.simpleExpression(getRootDirectoryEndpoint());
Expression tempFileOption =
ExpressionBuilder.simpleExpression("?tempFileName=");
Expression tempFileName =
FileLanguage.file("${file:onlyname.noext}.tmp");
Expression fileOptions = ExpressionBuilder.append(tempFileOption,
tempFileName);
Expression fileEndpoint =
ExpressionBuilder.append(rootDirectoryEndpoint, new
XPathBuilder(MGMT_GROUP_XPATH));
return ExpressionBuilder.append(fileEndpoint, fileOptions);
}
I'm trying to route the message to a file in a directory based on the
evaluation of an xpath expression on the message itself. This all works
great. The problem I'm seeing is with the MBean Server.
When I profile my activeMQ broker that is running with YourKit, I see a
giant hashmap start to grow with every message I send through this route
with with at least one entry for each file. The entries look like this:
key java.lang.String
"context=myServer/camel,name="file:///myFile",type=endpoints"
value com.sun.jmx.mbeanserver.NamedObject
Am I using the RecipientList incorrectly? Is there some setting I can set
to throw these references away once the route is complete? Any help is
appreciated.
John Madrid
--
View this message in context: http://old.nabble.com/Potential-Memory-Leak-with-Dynamic-Routes-Specified-via-RecipientList-tp27690762p27690762.html
Sent from the Camel - Users mailing list archive at Nabble.com.
Re: Potential Memory Leak with Dynamic Routes Specified via
RecipientList
Posted by Claus Ibsen <cl...@gmail.com>.
HI
Yeah its a known issue with the recipent list. Its fixed in 2.3-SNAPSHOT.
https://issues.apache.org/activemq/browse/CAMEL-2484
On Mon, Feb 22, 2010 at 6:17 PM, J_Racker <jo...@rackspace.com> wrote:
>
> Hi,
>
> I'm seeing an issue when using an dynamic route specified via a recipient
> list. I'm running Camel 2.1.0 and my route looks like the following:
>
> from(outQueue).to("bean:messageValidator").setHeader("CamelFileName",
> getFileNameXpath()).recipientList(getResponseEndpoint());
>
> where getResponseEndpoint() looks something like this:
>
> private Expression getResponseEndpoint() {
> Expression rootDirectoryEndpoint =
> ExpressionBuilder.simpleExpression(getRootDirectoryEndpoint());
> Expression tempFileOption =
> ExpressionBuilder.simpleExpression("?tempFileName=");
> Expression tempFileName =
> FileLanguage.file("${file:onlyname.noext}.tmp");
>
> Expression fileOptions = ExpressionBuilder.append(tempFileOption,
> tempFileName);
>
> Expression fileEndpoint =
> ExpressionBuilder.append(rootDirectoryEndpoint, new
> XPathBuilder(MGMT_GROUP_XPATH));
>
> return ExpressionBuilder.append(fileEndpoint, fileOptions);
> }
>
> I'm trying to route the message to a file in a directory based on the
> evaluation of an xpath expression on the message itself. This all works
> great. The problem I'm seeing is with the MBean Server.
>
> When I profile my activeMQ broker that is running with YourKit, I see a
> giant hashmap start to grow with every message I send through this route
> with with at least one entry for each file. The entries look like this:
>
> key java.lang.String
> "context=myServer/camel,name="file:///myFile",type=endpoints"
> value com.sun.jmx.mbeanserver.NamedObject
>
> Am I using the RecipientList incorrectly? Is there some setting I can set
> to throw these references away once the route is complete? Any help is
> appreciated.
>
> John Madrid
>
>
> --
> View this message in context: http://old.nabble.com/Potential-Memory-Leak-with-Dynamic-Routes-Specified-via-RecipientList-tp27690762p27690762.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>
>
--
Claus Ibsen
Apache Camel Committer
Author of Camel in Action: http://www.manning.com/ibsen/
Open Source Integration: http://fusesource.com
Blog: http://davsclaus.blogspot.com/
Twitter: http://twitter.com/davsclaus
Re: Potential Memory Leak with Dynamic Routes Specified via
RecipientList
Posted by J_Racker <jo...@rackspace.com>.
Thanks for the fast reply. I'll check it out. Love the direction this
project is taking. I'm a huge camel fan.
John
J_Racker wrote:
>
> Hi,
>
> I'm seeing an issue when using an dynamic route specified via a recipient
> list. I'm running Camel 2.1.0 and my route looks like the following:
>
> from(outQueue).to("bean:messageValidator").setHeader("CamelFileName",
> getFileNameXpath()).recipientList(getResponseEndpoint());
>
> where getResponseEndpoint() looks something like this:
>
> private Expression getResponseEndpoint() {
> Expression rootDirectoryEndpoint =
> ExpressionBuilder.simpleExpression(getRootDirectoryEndpoint());
> Expression tempFileOption =
> ExpressionBuilder.simpleExpression("?tempFileName=");
> Expression tempFileName =
> FileLanguage.file("${file:onlyname.noext}.tmp");
>
> Expression fileOptions = ExpressionBuilder.append(tempFileOption,
> tempFileName);
>
> Expression fileEndpoint =
> ExpressionBuilder.append(rootDirectoryEndpoint, new
> XPathBuilder(MGMT_GROUP_XPATH));
>
> return ExpressionBuilder.append(fileEndpoint, fileOptions);
> }
>
> I'm trying to route the message to a file in a directory based on the
> evaluation of an xpath expression on the message itself. This all works
> great. The problem I'm seeing is with the MBean Server.
>
> When I profile my activeMQ broker that is running with YourKit, I see a
> giant hashmap start to grow with every message I send through this route
> with with at least one entry for each file. The entries look like this:
>
> key java.lang.String
> "context=myServer/camel,name="file:///myFile",type=endpoints"
> value com.sun.jmx.mbeanserver.NamedObject
>
> Am I using the RecipientList incorrectly? Is there some setting I can set
> to throw these references away once the route is complete? Any help is
> appreciated.
>
> John Madrid
>
>
>
--
View this message in context: http://old.nabble.com/Potential-Memory-Leak-with-Dynamic-Routes-Specified-via-RecipientList-tp27690762p27692441.html
Sent from the Camel - Users mailing list archive at Nabble.com.