Use
                from("activemq:queue:foo")
                .from("activemq:queue:bar")
                .from("activemq:queue:baz")
                    .to("mock:result");

Christian, this test works:

public class SimpleRouteTest extends CamelTestSupport {

    @EndpointInject(uri = "mock:result")
    private MockEndpoint mockResult;

    protected JndiRegistry createRegistry() throws Exception {
        JndiRegistry registry = super.createRegistry();
        registry.bind("activemq",
ActiveMQComponent.activeMQComponent("vm://test-broker?broker.persistent=false&broker.useJmx=false"));
        return registry;
    }

    @Test
    public void multipleJmsConsumer() throws Exception {
        context.addRoutes(new RouteBuilder() {
            @Override
            public void configure() throws Exception {
                from("activemq:queue:foo")
                .from("activemq:queue:bar")
                .from("activemq:queue:baz")
                    .to("mock:result");

            }
        });

        mockResult.expectedBodiesReceivedInAnyOrder("test1", "test2",
"test3");

        template.sendBody("activemq:queue:foo", "test1");
        template.sendBody("activemq:queue:bar", "test2");
        template.sendBody("activemq:queue:baz", "test3");

        assertMockEndpointsSatisfied();
    }
}

You should be able to configure the route in a dynamic way...

Best,
Christian

On Wed, May 23, 2012 at 2:13 PM, Christian Schneider <
ch...@die-schneider.net> wrote:

> The problem is that the from endpoints are not known at compile time and
> can change at any time.
> Besides that we need transactionality. Not sure if seda provides that.
> Christian
>
> Am 23.05.2012 13:41, schrieb Serkan Eryilmaz:
>
>  Couldn't you just create a seda queue once (that is your logic route),
>> and then for each jms queue that gets added you redirect it to that seda
>> queue ?
>>
>> On 05/23/2012 01:03 PM, Christian Schneider wrote:
>>
>>> I would like to listen to a list of jms queues and for each queue do the
>>> same route.
>>>
>>> Currently I use a RouteBuilder that gets the jms endpoint uri in its
>>> constructor and builds the route. This routebuilder is then created once
>>> for each jms endpoint and the
>>> route is added each time to the context. This works but I wonder if we
>>> can do this in a generic way. For the producer side we have the
>>> recipientlist where you can give it a list of endpoints to send to.
>>>
>>> How about a component that can create consumers from a list of uris
>>> separated by comma? Would there be a general interest in such a thing? Do
>>> we perhaps have a similar thing that I just overlooked?
>>>
>>> Christian
>>>
>>>
>>>
>>
>
> --
>
> Christian Schneider
> http://www.liquid-reality.de
>
> Open Source Architect
> Talend Application Integration Division http://www.talend.com
>
>

Reply via email to