Hi,
I have this route which uses a onCompletion processor. I recetnly run into
OutOfMemory issue after a week or so.
When profiling the memory dump, I see a lot of big instances in
ThreadLocalMap. Each big instance is refrenecing a onCompletionProcessor
thread. Please see the attached screenshot.
Is this multiple onCompletion threads causing the out of memory issue? And
is there a way I can restrict the # of onCompletion thread?

Thanks http://old.nabble.com/file/p28897414/outofmem.png 

onException(Exception.class).process(new Processor() {
            @Override
            public void process(Exchange ex) throws Exception
            {
                System.out.println("Exception: " + ex.getIn().getBody());
            }
        });
       
        from("quartz://mail/mailReminder?cron=0/30+*+*+*+*+?").process(new
Processor()
        {
            @Override
            public void process(Exchange ex) throws Exception
            {
                System.out.println("Polling Exchange Server WS");
                List<ItemType> items = poller.getMailItems();
                ProducerTemplate prod =
getContext().createProducerTemplate();
                for (ItemType item : items)
                {
                    prod.sendBody("seda:mail", item);
                }
            }
        });
       
        from("seda:mail")
            // on completion, delete that email from exchange server
            .onCompletion().onCompleteOnly()
            .process(new Processor()
            {
                @Override
                public void process(Exchange exchange) throws Exception
                {
                ItemIdType itemId = emailProcessor.deleteMessage(exchange);
                    poller.deleteItem(itemId);
                }
            })
            .end() http://old.nabble.com/file/p28897414/outofmem.PNG
outofmem.PNG 
            // this is the original route
            .process(
            new Processor()
            {
                @Override
                public void process(Exchange exchange) throws Exception
                {
                    emailProcessor.process(exchange);
                }
            }
        ).to("test-activemq:queue:" + queueName); 
-- 
View this message in context: 
http://old.nabble.com/Multiple-Threads-Created-WHen-Using-OnCompletion-tp28897414p28897414.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Reply via email to