Package org.apache.camel

Examples of org.apache.camel.Consumer.start()


            if (endpoint != null) {
                try {
                    Processor processor = createConsumerProcessor(bean, method, endpoint);
                    LOG.info("Created processor: " + processor);
                    Consumer consumer = endpoint.createConsumer(processor);
                    consumer.start();
                    addConsumer(consumer);
                } catch (Exception e) {
                    LOG.warn(e);
                    throw new RuntimeCamelException(e);
                }
View Full Code Here


    @Test
    public void getAllContentFromServerOrderedFromRootToLeaves() throws Exception {
        resultEndpoint.expectedMessageCount(5);

        Consumer treeBasedConsumer = createConsumerFor(CMIS_ENDPOINT_TEST_SERVER);
        treeBasedConsumer.start();

        resultEndpoint.assertIsSatisfied();
        treeBasedConsumer.stop();

        List<Exchange> exchanges = resultEndpoint.getExchanges();
View Full Code Here

    public void consumeDocumentsWithQuery() throws Exception {
        resultEndpoint.expectedMessageCount(2);

        Consumer queryBasedConsumer = createConsumerFor(
                CMIS_ENDPOINT_TEST_SERVER + "?query=SELECT * FROM cmis:document");
        queryBasedConsumer.start();
        resultEndpoint.assertIsSatisfied();
        queryBasedConsumer.stop();
    }

    private Consumer createConsumerFor(String path) throws Exception {
View Full Code Here

            }
        });
        // reset latch
        latch = new CountDownLatch(1);
        consumer.start();

        latch.await();
        consumer.stop();
    }
View Full Code Here

            public void process(Exchange exchange) throws Exception {
                // noop
            }
        });

        consumer.start();
        consumer.stop();

        // the directory should now exists
        File dir = new File("target/file/foo").getAbsoluteFile();
        assertTrue("Directory should be created", dir.exists());
View Full Code Here

            public void process(Exchange exchange) throws Exception {
                // noop
            }
        });

        consumer.start();
        consumer.stop();

        // the directory should now exists
        File dir = new File(base).getAbsoluteFile();
        assertTrue("Directory should be created", dir.exists());
View Full Code Here

            public void process(Exchange exchange) throws Exception {
                // noop
            }
        });

        consumer.start();
        consumer.stop();

        // the directory should NOT exists
        File dir = new File("target/file/foo").getAbsoluteFile();
        assertFalse("Directory should NOT be created", dir.exists());
View Full Code Here

            }
        });
        // reset latch
        latch = new CountDownLatch(1);
        consumer.start();

        latch.await();
        consumer.stop();
    }
View Full Code Here

            Consumer consumer = endpoint.createConsumer(new Processor() {
                public void process(Exchange exchange) throws Exception {
                    template.send("mock:result", exchange);
                }
            });
            consumer.start();

            assertMockEndpointsSatisfied();

            consumer.stop();
        } finally {
View Full Code Here

                String body = exchange.getIn().getBody(String.class);
                assertEquals("Hello World", body);
                latch.countDown();
            }
        });
        consumer.start();
        latch.await();

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