camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Claus Ibsen <>
Subject Re: context component with seda options
Date Fri, 21 Feb 2014 14:27:15 GMT

That is what the vm component is for

Or the direct-vm

On Fri, Feb 21, 2014 at 3:24 PM, Cohen, Bruce <> wrote:
> I'm trying to use the context component with SEDA endpoints.  My goal is to be able to
define a SEDA endpoint in one context and have multiple consumers in other contexts consuming
from it, is this possible?
>  I have the following two Spring DSL XML configurations:
> inner.xml
> <camelContext id="inner">
>      <endpoint id="inner-in" uri="seda:shared?multipleConsumers=true"/>
>      <route>
>              <from uri="direct:in"/>
>              <!-- do good stuff here -->
>              <to ref="inner-in"/>
>       </route>
> </camelContext>
> outer.xml
> <camelContext id="outer" depends-on="inner">
>       <route>
>             <from uri="context:inner:shared?multipleConsumers=true"/>
>             <!-- do other good stuff here -->
>             <to uri="direct:out"/>
>       </route>
> </camelContext>
> This results in an exception being thrown that reads:
> org.apache.camel.ResolvedEndpointFailedException: Failed to resolve the endpoint: Cannot
find the endpoint with the uri shared in the CamelContext inner
> If I modify both contexts to remove '?multipleConsumers=true' from both references to
the 'shared' endpoint I'm able to resolve the 'shared' endpoint in the outer context with
no exceptions (but since multipleConsumers isn't set to 'true' on the endpoint I won't be
able to accomplish my goal)
> If I remove '?multipleConsumers=true' from just the endpoint definition in inner.xml
I get a different exception:
> java.lang.IllegalArgumentException: Cannot use existing queue seda://shared as the existing
queue multiple consumers false does not match the given multiple consumers true
> How can I define a SEDA endpoint in one context so that multiple consumers in other contexts
can consume from it?
> Thanks in advance,
>     Bruce

Claus Ibsen
Red Hat, Inc.
Twitter: davsclaus
Author of Camel in Action:
Make your Camel applications look hawt, try:

View raw message