Package org.apache.camel

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


        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


        + "&consumer.deleteFile=true";

    public void testExludePreAndPostfixes() throws Exception {
        PollingConsumer consumer = context.getEndpoint(ftpUrl).createPollingConsumer();
        consumer.start();
        Exchange out = consumer.receive(3000);
        assertNull("Should not get the file", out);

        try {
            consumer.stop();
        } catch (FtpOperationFailedException fofe) {
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

                        // create a polling consumer so we can poll the remote ftp file
                        PollingConsumer consumer = ftp.createPollingConsumer();
                        consumer.start();
                        // receive the remote ftp without timeout
                        Exchange result = consumer.receive();
                        // we must stop the consumer
                        consumer.stop();

                        // the result is the response from the FTP consumer (the downloaded file)
                        // replace the outher exchange with the content from the downloaded file
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

        PollingConsumer consumer = context.getEndpoint("activemq:queue:bar").createPollingConsumer();
        consumer.start();

        // use timeout in case running on slow box
        Exchange bar = consumer.receive(10000);
        assertNotNull("Should be a message on queue", bar);

        consumer.stop();

        template.send("activemq:queue:foo", bar);
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.