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.

Reply via email to