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


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

        assertNotNull(exchange);

        assertEquals("hello.txt", exchange.getIn().getHeader(Exchange.FILE_NAME, String.class));
        assertEquals("Hello World", exchange.getIn().getBody(String.class));

        consumer.stop();
    }
}
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

        Thread.sleep(1000);

        File file = new File(FTP_ROOT_DIR + "/polling/bye.txt");
        assertTrue("File should exist " + file, file.exists());

        consumer.stop();
    }

}
View Full Code Here

        Thread.sleep(1000);

        File file = new File("target/enrich/bye.txt");
        assertTrue("File should exist " + file, file.exists());

        consumer.stop();
    }

}
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

        current = (Integer) mbeanServer.getAttribute(on, "Size");
        assertEquals(0, current.intValue());

        // stop the consumer as it was purged from the cache
        // so we need to manually stop it
        consumer.stop();
        cache.stop();
    }

    @Override
    protected RouteBuilder createRouteBuilder() throws Exception {
View Full Code Here

                    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

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.