Package org.apache.camel.component.seda

Examples of org.apache.camel.component.seda.SedaEndpoint$SedaProducer


    protected Endpoint createEndpoint(String uri, String remaining, Map<String, Object> parameters) throws Exception {
        if (ENDPOINTS.containsKey(uri)) {
            return ENDPOINTS.get(uri);
        }

        SedaEndpoint answer = (SedaEndpoint) super.createEndpoint(uri, remaining, parameters);

        ENDPOINTS.put(uri, answer);
        return answer;
    }
View Full Code Here


    private static final AtomicInteger START_COUNTER = new AtomicInteger();

    @Override
    protected Endpoint createEndpoint(String uri, String remaining, Map parameters) throws Exception {
        BlockingQueue<Exchange> blockingQueue = getBlockingQueue(uri, parameters);
        return new SedaEndpoint(uri, this, blockingQueue);
    }
View Full Code Here

    protected SenderComponent senderComponent = new SenderComponent();

    public void testCamelInvokingJbi() throws Exception {
        senderComponent.sendMessages(1);

        SedaEndpoint receiverEndpoint = (SedaEndpoint) camelContext
                .getEndpoint("seda:receiver");

        BlockingQueue<Exchange> queue = receiverEndpoint.getQueue();
        Exchange exchange = queue.poll(5, TimeUnit.SECONDS);

        assertNotNull(
                "Camel Receiver queue should have received an exchange by now",
                exchange);
View Full Code Here

    @Override
    protected RouteBuilder createRouteBuilder() throws Exception {
        return new RouteBuilder() {
            @Override
            public void configure() throws Exception {
                SedaEndpoint seda = context.getEndpoint("seda:start", SedaEndpoint.class);
                seda.getQueue().put(new DefaultExchange(context));

                from("seda:start").routeId("foo")
                        .process(new Processor() {
                            @Override
                            public void process(Exchange exchange) throws Exception {
View Full Code Here


    @Override
    protected Endpoint createEndpoint(String uri, String remaining, Map parameters) throws Exception {
        BlockingQueue<Exchange> blockingQueue = getBlockingQueue(uri, parameters);
        return new SedaEndpoint(uri, this, blockingQueue);
    }
View Full Code Here

            public void configure() throws Exception {
                // put a message pre-early on the seda queue, to trigger the route, which
                // then would add a 2nd route during CamelContext startup. This is a test
                // to ensure the foo route is not started too soon, and thus adding the 2nd
                // route works as expected
                SedaEndpoint seda = context.getEndpoint("seda:start", SedaEndpoint.class);
                seda.getQueue().put(new DefaultExchange(context));

                from("seda:start").routeId("foo")
                        .process(new Processor() {
                            @Override
                            public void process(Exchange exchange) throws Exception {
View Full Code Here

    private static final AtomicInteger START_COUNTER = new AtomicInteger();

    @Override
    protected Endpoint createEndpoint(String uri, String remaining, Map parameters) throws Exception {
        BlockingQueue<Exchange> blockingQueue = getBlockingQueue(uri, parameters);
        SedaEndpoint answer = new SedaEndpoint(uri, this, blockingQueue);
        answer.configureProperties(parameters);
        return answer;
    }
View Full Code Here

        template.sendBody("direct:start", "Hello World");

        assertMockEndpointsSatisfied();

        // the message was not send to the direct:foo route and thus not sent to the seda endpoint
        SedaEndpoint seda = context.getEndpoint("seda:foo", SedaEndpoint.class);
        assertEquals(0, seda.getCurrentQueueSize());
    }
View Full Code Here

    private static final AtomicInteger START_COUNTER = new AtomicInteger();

    @Override
    protected Endpoint createEndpoint(String uri, String remaining, Map<String, Object> parameters) throws Exception {
        BlockingQueue<Exchange> blockingQueue = getBlockingQueue(uri, parameters);
        SedaEndpoint answer = new SedaEndpoint(uri, this, blockingQueue);
        answer.configureProperties(parameters);
        return answer;
    }
View Full Code Here

        template.sendBody("direct:start", "Hello World");

        assertMockEndpointsSatisfied();

        // the message was not send to the direct:foo route and thus not sent to the seda endpoint
        SedaEndpoint seda = context.getEndpoint("seda:foo", SedaEndpoint.class);
        assertEquals(0, seda.getCurrentQueueSize());
    }
View Full Code Here

TOP

Related Classes of org.apache.camel.component.seda.SedaEndpoint$SedaProducer

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.