camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From DominicTulley <dominic.tul...@telelogic.com>
Subject Re: Possible memory leak when using Camel in ActiveMQ
Date Wed, 29 Aug 2007 13:29:16 GMT

The route I am currently using is:

from("activemq:AnnotateQueue").setHeader("HasHandler",
hasHandlerExpression).to("activemq:TOOL.DEFAULT");;

where hasHandlerExpression is a class I have implemented.  It contains the
following method:

	public Object evaluate(Exchange exch) {
		Message msg = exch.getIn();
		String key = (String)msg.getHeader("DocGuid");
		
		// Odd numbered docs have a handler
		 
		String handlerStr = RoutingTable.getDestination(key);
		boolean hasHandler = (null != handlerStr) && handlerStr.equals("true");
		
		msg.setHeader("HasHandler", hasHandler);
		return "" + hasHandler;

Finally RoutingTable.getDestination is simply a static method doing a
hashmap.get.

Hope this helps.

-Dominic



What route were you using?  That will us focus and the possible leaks
better.


-- 
View this message in context: http://www.nabble.com/Possible-memory-leak-when-using-Camel-in-ActiveMQ-tf4346921s22882.html#a12387136
Sent from the Camel - Users mailing list archive at Nabble.com.


Mime
View raw message