Package org.apache.camel

Examples of org.apache.camel.PollingConsumer.receive()


        } catch (CamelExecutionException e) {
            // queue should be full
            assertIsInstanceOf(IllegalStateException.class, e.getCause());
        }

        Exchange out = consumer.receive(5000);
        assertNotNull(out);
        assertEquals("Message 0", out.getIn().getBody());

        assertEquals(9, edpc.getQueueSize());
        assertEquals(10, edpc.getQueueCapacity());
View Full Code Here


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

        Endpoint endpoint = context.getEndpoint("seda:queue");
        PollingConsumer consumer = cache.getConsumer(endpoint);
        Exchange out = consumer.receive(3000);
        assertNotNull("Should got an exchange", out);
        assertEquals("Hello World", out.getIn().getBody());

        // get the stats for the route
        MBeanServer mbeanServer = getMBeanServer();
View Full Code Here

    public Exchange receive(Endpoint endpoint) {
        LOG.debug("<<<< {}", endpoint);

        PollingConsumer consumer = getConsumer(endpoint);
        return consumer.receive();
    }

    public Exchange receive(Endpoint endpoint, long timeout) {
        LOG.debug("<<<< {}", endpoint);
View Full Code Here

    public Exchange receive(Endpoint endpoint, long timeout) {
        LOG.debug("<<<< {}", endpoint);

        PollingConsumer consumer = getConsumer(endpoint);
        return consumer.receive(timeout);
    }

    public Exchange receiveNoWait(Endpoint endpoint) {
        LOG.debug("<<<< {}", endpoint);
View Full Code Here

        Executors.newSingleThreadExecutor().execute(new Runnable() {
            public void run() {
                try {
                    PollingConsumer consumer = context.getEndpoint("activemq:queue.start").createPollingConsumer();
                    consumer.start();
                    Exchange exchange = consumer.receive();
                    String body = exchange.getIn().getBody(String.class);
                    template.sendBody("activemq:queue.foo", body + " Claus");
                    consumer.stop();
                } catch (Exception e) {
                    throw new RuntimeException(e);
View Full Code Here

        PollingConsumer consumer = endpoint.createPollingConsumer();
        try {
            consumer.start();

            while (true) {
                Exchange exchange = consumer.receive(timeout);
                if (exchange == null) {
                    break;
                } else {
                    processor.process(exchange);
                }
View Full Code Here

        PollingConsumer consumer = endpoint.createPollingConsumer();
        try {
            consumer.start();

            while (true) {
                Exchange exchange = consumer.receive(timeout);
                if (exchange == null) {
                    break;
                } else {
                    processor.process(exchange);
                }
View Full Code Here

        if (LOG.isDebugEnabled()) {
            LOG.debug("<<<< " + endpoint);
        }

        PollingConsumer consumer = getConsumer(endpoint);
        return consumer.receive();
    }

    public Exchange receive(Endpoint endpoint, long timeout) {
        if (LOG.isDebugEnabled()) {
            LOG.debug("<<<< " + endpoint);
View Full Code Here

        if (LOG.isDebugEnabled()) {
            LOG.debug("<<<< " + endpoint);
        }

        PollingConsumer consumer = getConsumer(endpoint);
        return consumer.receive(timeout);
    }

    public Exchange receiveNoWait(Endpoint endpoint) {
        if (LOG.isDebugEnabled()) {
            LOG.debug("<<<< " + endpoint);
View Full Code Here

        PollingConsumer consumer = endpoint.createPollingConsumer();
        try {
            consumer.start();

            while (true) {
                Exchange exchange = consumer.receive(timeout);
                if (exchange == null) {
                    break;
                } else {
                    processor.process(exchange);
                }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.