camel-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Babak Vahdat (Commented) (JIRA)" <>
Subject [jira] [Commented] (CAMEL-4650) NPE when using SEDA route and attaching an extra consumer
Date Tue, 15 Nov 2011 12:00:53 GMT


Babak Vahdat commented on CAMEL-4650:

I think that the problem/challenge resides in the fact that camel-core doesn't realize that
there's already another route consuming from the same URI (in this case the Seda consumer
with multipleConsumers *not* enabled) if one of the routes is not autoEnabled and the other
one is already up and consuming and one starts that not-autoEnabled route afterwards through
the provided API.

However if both routes are already autoEnabled (which is the default) then this case gets
caught correctly at the startup of the camel context:

org.apache.camel.FailedToStartRouteException: Failed to start route route2 because of Multiple
consumers for the same endpoint is not allowed: Endpoint[seda://foo?concurrentConsumers=5]
	at org.apache.camel.impl.DefaultCamelContext.doStartOrResumeRouteConsumers(
	at org.apache.camel.impl.DefaultCamelContext.doStartRouteConsumers(
	at org.apache.camel.impl.DefaultCamelContext.safelyStartRouteServices(
	at org.apache.camel.impl.DefaultCamelContext.doStartOrResumeRoutes(
	at org.apache.camel.impl.DefaultCamelContext.doStartCamel(
	at org.apache.camel.impl.DefaultCamelContext.doStart(
	at org.apache.camel.impl.DefaultCamelContext.start(
	at org.apache.camel.ContextTestSupport.startCamelContext(
	at org.apache.camel.ContextTestSupport.setUp(
	at junit.framework.TestCase.runBare(
	at org.apache.camel.TestSupport.runBare(
	at junit.framework.TestResult$1.protect(
	at junit.framework.TestResult.runProtected(
	at junit.framework.TestSuite.runTest(
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(
> NPE when using SEDA route and attaching an extra consumer
> ---------------------------------------------------------
>                 Key: CAMEL-4650
>                 URL:
>             Project: Camel
>          Issue Type: Bug
>          Components: camel-core
>    Affects Versions: 2.8.2
>         Environment: Java 6, Camel 2.8.2, Centos 4.
>            Reporter: Tarjei Huse
>            Assignee: Claus Ibsen
> I'm trying to construct a system for moving some seda queues over to
> ActiveMQ during system shutdown. What I did was create a Route that
> connects to some of my seda queues and then drains the queue to activemq.
> Basicly I got two routes, the drainer:
> from("seda:" + sedaId + "?size=1000")
>                     .routeId(routeName +
> sedaIs).noAutoStartup().to(activeMQFailuresQueue);
> And the main route:
> from("seda:" + sedaId + "?size=1000")
>                     .routeId(routeName + sedaIs).to(SomeProcessor);
> Now, sometimes the main route stalls for various reasons I need to
> restart the jvm process it is running in, so I start the first route.
> But when trying this in production, I got:
>  java.lang.NullPointerException
>     at
> org.apache.camel.util.AsyncProcessorHelper.process(
>     at
> org.apache.camel.component.seda.SedaConsumer.sendToConsumers(
>     at
> org.apache.camel.component.seda.SedaConsumer.doRun(
>     at
>     at
> java.util.concurrent.ThreadPoolExecutor$Worker.runTask(
>     at
> java.util.concurrent.ThreadPoolExecutor$
>     at
> Bvahdat added a comment:
> just a very tiny pointer:
> Looking at the source it seems that  the
> SedaEndpoint.getConsumerMulticastProcessor() method returns 'null' causing
> the NPE, as the condition:
> multicastStarted == false || consumerMulticastProcessor == null
> is true.

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators:!default.jspa
For more information on JIRA, see:


View raw message