Why you didn't try it out? It's so simple:

import org.apache.camel.builder.RouteBuilder;
import org.apache.camel.component.mock.MockEndpoint;
import org.apache.camel.test.junit4.CamelTestSupport;
import org.junit.Test;

public class CamelMultipleEndpointsTest extends CamelTestSupport {

    @Test
    public void test() throws Exception {
        MockEndpoint mock = getMockEndpoint("mock:end");
        mock.expectedBodiesReceived("a", "b", "c", "d");

        context.addRoutes(new RouteBuilder() {
            public void configure() {
                from("direct:a", "direct:b", "direct:c", "direct:d")
                    .to("mock:end");
            }
        });

        template.sendBody("direct:a", "a");
        template.sendBody("direct:b", "b");
        template.sendBody("direct:c", "c");
        template.sendBody("direct:d", "d");

        mock.assertIsSatisfied();
    }
}

And yes, it's possible (with a slightly different syntax).

Best,
Christian


On Mon, Jan 14, 2013 at 9:59 AM, liugang <clevers...@gmail.com> wrote:

> Hi All:
>
> I'd like to know it's there any Camel component which support to define
> multiple consumer(provider?) endpoint urls in it? For example:
>
>         from("XXX:direct:a, direct:b, direct:c,jms:queue:a,...").to("...");
>
> in this case, the "from" can handle the massage no matter it sends to
> "direct:a", "direct:b", "direct:c" or "jms:queue:a".
>
>
> Thanks
> GangLiu
>
>
>


--

Reply via email to