Package org.apache.camel

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


                    processor.process(exchange);
                }
            }
        } finally {
            try {
                consumer.stop();
            } catch (Exception e) {
                LOG.warn("Failed to stop PollingConsumer: " + e, e);
            }
        }
    }
View Full Code Here


        consumer.start();
        Exchange out = consumer.receive(3000);
        assertNull("Should not get the file", out);

        try {
            consumer.stop();
        } catch (FtpOperationFailedException fofe) {
            // expected, ignore
        }
    }
View Full Code Here

                    processor.process(exchange);
                }
            }
        } finally {
            try {
                consumer.stop();
            } catch (Exception e) {
                LOG.warn("Failed to stop PollingConsumer: " + e, e);
            }
        }
    }
View Full Code Here

                        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
                        exchange.getIn().setBody(result.getIn().getBody());
                    }
View Full Code Here

                    processor.process(exchange);
                }
            }
        } finally {
            try {
                consumer.stop();
            } catch (Exception e) {
                LOG.warn("Failed to stop PollingConsumer: " + e, e);
            }
        }
    }
View Full Code Here

                    processor.process(exchange);
                }
            }
        } finally {
            try {
                consumer.stop();
            } catch (Exception e) {
                LOG.warn("Failed to stop PollingConsumer: " + e, e);
            }
        }
    }
View Full Code Here

                    processor.process(exchange);
                }
            }
        } finally {
            try {
                consumer.stop();
            } catch (Exception e) {
                LOG.warn("Failed to stop PollingConsumer: " + e, e);
            }
        }
    }
View Full Code Here

        // 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);

        assertMockEndpointsSatisfied();
    }
View Full Code Here

        consumer.start();

        Exchange bar = consumer.receiveNoWait();
        assertNull("Should NOT be a message on queue", bar);

        consumer.stop();

        template.sendBody("activemq:queue:foo", "Hello World");

        assertMockEndpointsSatisfied();
    }
View Full Code Here

        consumer.start();

        Exchange bar = consumer.receive(5000);
        assertNotNull("Should be a message on queue", bar);

        consumer.stop();

        template.send("activemq:queue:foo?preserveMessageQos=true", bar);

        Thread.sleep(1000);
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.