camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Claus Ibsen <claus.ib...@gmail.com>
Subject Re: ProducerCache memory leak?
Date Wed, 04 Jan 2012 15:04:46 GMT
On Wed, Jan 4, 2012 at 2:05 PM, Claus Ibsen <claus.ibsen@gmail.com> wrote:
> Hi
>
> I found a glitch in the stopping logic when using the onException. I
> will dig a bit to get the producer cache to be removed.
>

Okay I have back ported a fix to the 2.8 branch. Can you try again.
You need to use route scoped onException.

And for the recipient list, you may need to use 2 x end to properly
end the onException from the route itself.



>
> On Wed, Jan 4, 2012 at 12:20 PM, suman <prashanth.shivakumar@gmail.com> wrote:
>> Hello,
>> Thanks for quick response.
>> I moved the exception clause to route scope but i get the following
>> exception while starting route.And this is because using recepientlist
>> within that exception handling.
>> ===================================
>>
>>
>> 2012-01-04 11:14:50,612 [                          main]
>> SportsBookRouteBuilder         ERROR Exchange[ExchangePattern:InOnly,
>> BodyType:String, Body:1000693194,
>> CaughtExceptionType:java.lang.UnsupportedOperationException,
>> CaughtExceptionMessage:null,
>> StackTrace:java.lang.UnsupportedOperationException
>>        at java.util.AbstractList.add(AbstractList.java:131)
>>        at java.util.AbstractList.add(AbstractList.java:91)
>>        at
>> org.apache.camel.model.OnExceptionDefinition.onException(OnExceptionDefinition.java:242)
>>        at
>> com.sbpushconversion.dynaroutebuilder.DynamicRouteStarter$1.configure(DynamicRouteStarter.java:45)
>>        at
>> org.apache.camel.builder.RouteBuilder.checkInitialized(RouteBuilder.java:322)
>>        at
>> org.apache.camel.builder.RouteBuilder.configureRoutes(RouteBuilder.java:277)
>>        at
>> org.apache.camel.builder.RouteBuilder.addRoutesToCamelContext(RouteBuilder.java:263)
>>        at
>> org.apache.camel.impl.DefaultCamelContext.addRoutes(DefaultCamelContext.java:603)
>>        at
>> com.sbpushconversion.dynaroutebuilder.DynamicRouteStarter.startRoute(DynamicRouteStarter.java:30)
>>        at
>> com.sbpushconversion.marcom.processor.KambiLiveEventProcessor.process(KambiLiveEventProcessor.java:32)
>>        at
>> org.apache.camel.impl.converter.AsyncProcessorTypeConverter$ProcessorToAsyncProcessorBridge.process(AsyncProcessorTypeConverter.java:50)
>>        at
>> org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:78)
>>        at
>> org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:98)
>>        at
>> org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:89)
>>        at
>> org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:78)
>>        at
>> org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:98)
>>        at
>> org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:89)
>>        at
>> org.apache.camel.processor.interceptor.TraceInterceptor.process(TraceInterceptor.java:90)
>>        at
>> org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:78)
>>        at
>> org.apache.camel.processor.RedeliveryErrorHandler.processErrorHandler(RedeliveryErrorHandler.java:318)
>>        at
>> org.apache.camel.processor.RedeliveryErrorHandler.process(RedeliveryErrorHandler.java:209)
>>        at
>> org.apache.camel.processor.DefaultChannel.process(DefaultChannel.java:306)
>>        at
>> org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:78)
>>        at org.apache.camel.processor.Pipeline.process(Pipeline.java:116)
>>        at org.apache.camel.processor.Pipeline.process(Pipeline.java:79)
>>        at
>> org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:78)
>>        at
>> org.apache.camel.processor.RedeliveryErrorHandler.processErrorHandler(RedeliveryErrorHandler.java:318)
>>        at
>> org.apache.camel.processor.RedeliveryErrorHandler.process(RedeliveryErrorHandler.java:209)
>>        at
>> org.apache.camel.processor.UnitOfWorkProcessor.processAsync(UnitOfWorkProcessor.java:139)
>>        at
>> org.apache.camel.processor.UnitOfWorkProcessor.process(UnitOfWorkProcessor.java:106)
>>        at
>> org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:78)
>>        at
>> org.apache.camel.processor.MulticastProcessor.doProcessSequential(MulticastProcessor.java:572)
>>        at
>> org.apache.camel.processor.MulticastProcessor.doProcessSequential(MulticastProcessor.java:505)
>>        at
>> org.apache.camel.processor.MulticastProcessor.process(MulticastProcessor.java:218)
>>        at org.apache.camel.processor.Splitter.process(Splitter.java:96)
>>        at
>> org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:78)
>>        at
>> org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:98)
>>        at
>> org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:89)
>>        at
>> org.apache.camel.processor.interceptor.TraceInterceptor.process(TraceInterceptor.java:90)
>>        at
>> org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:78)
>>        at
>> org.apache.camel.processor.RedeliveryErrorHandler.processErrorHandler(RedeliveryErrorHandler.java:318)
>>        at
>> org.apache.camel.processor.RedeliveryErrorHandler.process(RedeliveryErrorHandler.java:209)
>>        at
>> org.apache.camel.processor.DefaultChannel.process(DefaultChannel.java:306)
>>        at
>> org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:78)
>>        at org.apache.camel.processor.Pipeline.process(Pipeline.java:116)
>>        at org.apache.camel.processor.Pipeline.process(Pipeline.java:79)
>>        at
>> org.apache.camel.processor.UnitOfWorkProcessor.process(UnitOfWorkProcessor.java:111)
>>        at
>> org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:78)
>>        at
>> org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:98)
>>        at
>> org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:89)
>>        at
>> org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:69)
>>        at
>> org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:78)
>>        at
>> org.apache.camel.component.direct.DirectProducer.process(DirectProducer.java:61)
>>        at
>> org.apache.camel.processor.UnitOfWorkProcessor.processAsync(UnitOfWorkProcessor.java:139)
>>        at
>> org.apache.camel.processor.UnitOfWorkProcessor.process(UnitOfWorkProcessor.java:106)
>>        at
>> org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:104)
>>        at
>> org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:85)
>>        at
>> org.apache.camel.processor.UnitOfWorkProducer.process(UnitOfWorkProducer.java:63)
>>        at
>> org.apache.camel.impl.ProducerCache$2.doInProducer(ProducerCache.java:351)
>>        at
>> org.apache.camel.impl.ProducerCache$2.doInProducer(ProducerCache.java:323)
>>        at org.apache.camel.impl.ProducerCache.doInProducer(ProducerCache.java:222)
>>        at org.apache.camel.impl.ProducerCache.sendExchange(ProducerCache.java:323)
>>        at org.apache.camel.impl.ProducerCache.send(ProducerCache.java:168)
>>        at
>> org.apache.camel.impl.DefaultProducerTemplate.send(DefaultProducerTemplate.java:110)
>>        at
>> org.apache.camel.impl.DefaultProducerTemplate.sendBody(DefaultProducerTemplate.java:123)
>>        at
>> com.sbpushconversion.dynaroutebuilder.SportsBookRouteBootStrapperComponent.onApplicationEvent(SportsBookRouteBootStrapperComponent.java:21)
>>        at
>> com.sbpushconversion.dynaroutebuilder.SportsBookRouteBootStrapperComponent.onApplicationEvent(SportsBookRouteBootStrapperComponent.java:11)
>>        at
>> org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:97)
>>        at
>> org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:303)
>>        at
>> org.springframework.context.support.AbstractApplicationContext.finishRefresh(AbstractApplicationContext.java:911)
>>        at
>> org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:428)
>>        at
>> org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:467)
>>        at
>> org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:483)
>>        at
>> org.springframework.web.servlet.FrameworkServlet.initWebApplicationContext(FrameworkServlet.java:358)
>>        at
>> org.springframework.web.servlet.FrameworkServlet.initServletBean(FrameworkServlet.java:325)
>>        at
>> org.springframework.web.servlet.HttpServletBean.init(HttpServletBean.java:127)
>>        at javax.servlet.GenericServlet.init(GenericServlet.java:212)
>>        at
>> org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1173)
>>        at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:993)
>>        at
>> org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:4420)
>>        at
>> org.apache.catalina.core.StandardContext.start(StandardContext.java:4733)
>>        at
>> org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:799)
>>        at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:779)
>>        at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:601)
>>        at
>> org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:675)
>>        at
>> org.apache.catalina.startup.HostConfig.deployDescriptors(HostConfig.java:601)
>>        at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:502)
>>        at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1315)
>>        at
>> org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:324)
>>        at
>> org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:142)
>>        at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1061)
>>        at org.apache.catalina.core.StandardHost.start(StandardHost.java:840)
>>        at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1053)
>>        at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:463)
>>        at org.apache.catalina.core.StandardService.start(StandardService.java:525)
>>        at org.apache.catalina.core.StandardServer.start(StandardServer.java:754)
>>        at org.apache.catalina.startup.Catalina.start(Catalina.java:595)
>>        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>>        at
>> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>>        at
>> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>>        at java.lang.reflect.Method.invoke(Method.java:597)
>>        at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:289)
>>        at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:414)
>>
>> =================================
>> And this is my amended route
>>
>>  fromF("amqp:queue:%s", name)
>>
>>
>> .onException(AddBetOfferEventNotFoundException.class,
>> OddsAddedBetOfferNotFoundException.class,
>> OddsRemovedEventNotFoundException.class,
>> OddsRemovedBetOfferNotFoundException.class,OddsUpdatedBetOfferNotFoundException.class,RemoveBetOfferNotFoundException.class,OpenAllBetOffersEventNotFoundException.class,SuspendAllBetOffersEventNotFoundException.class,UpdateBetOfferStatusEventNotFoundException.class,RemoveBetOfferEventNotFoundException.class,OddsUpdatedEventNotFoundException.class).handled(true)
>>                        .setHeader(Exchange.HTTP_METHOD,
>> constant(org.apache.camel.component.http4.HttpMethods.GET))
>>                        .recipientList(simple(kambiLiveEventUrlForOpenEvent,
>> String.class))
>>                        .setHeader(CacheConstants.CACHE_OPERATION,
>> constant(CacheConstants.CACHE_OPERATION_ADD))
>>                        .setHeader(CacheConstants.CACHE_KEY,
>> header("eventid"))
>>                        .convertBodyTo(String.class, "UTF-8")
>>                        .to("cache://LiveOddsCache").end()
>>
>>
>> .onException(Throwable.class).handled(true).useOriginalMessage().to("log:com.dynaroutebuilder.DynamicRouteStarter?level=ERROR&showException=true&showCaughtException=true&showStackTrace=true").end()
>>
>>
>>                        .setHeader("eventid", constant(eventId))
>>                        .process(protoBufMessageProcessor).routeId(name)
>>                        .choice()
>>
>> .when(header("messagetype").isEqualTo(ProtoMessageType.ADD_EVENT))
>>
>> .marshal(jacksonDataFormatProcessor.getJacksonDataFormat()).process(new
>> AddBetOfferEventUpdateProcessor())
>>                        .setHeader(CacheConstants.CACHE_OPERATION,
>> constant(CacheConstants.CACHE_OPERATION_ADD))
>>                        .setHeader(CacheConstants.CACHE_KEY,
>> header("eventid"))
>>                        .to("log:ADD_EVENT")
>>                        .to("cache://LiveOddsCache")
>>                        .otherwise()
>>                        .to("log:unhandledevent");
>>
>>
>> --
>> View this message in context: http://camel.465427.n5.nabble.com/ProducerCache-memory-leak-tp5108206p5119339.html
>> Sent from the Camel - Users mailing list archive at Nabble.com.
>
>
>
> --
> Claus Ibsen
> -----------------
> FuseSource
> Email: cibsen@fusesource.com
> Web: http://fusesource.com
> Twitter: davsclaus, fusenews
> Blog: http://davsclaus.blogspot.com/
> Author of Camel in Action: http://www.manning.com/ibsen/



-- 
Claus Ibsen
-----------------
FuseSource
Email: cibsen@fusesource.com
Web: http://fusesource.com
Twitter: davsclaus, fusenews
Blog: http://davsclaus.blogspot.com/
Author of Camel in Action: http://www.manning.com/ibsen/

Mime
View raw message