Package org.apache.camel

Examples of org.apache.camel.Endpoint.createConsumer()


        // Start the component and wait for the FIX sessions to be logged on

        final CountDownLatch logonLatch = new CountDownLatch(2);
        final CountDownLatch messageLatch = new CountDownLatch(2);
               
        Consumer consumer = endpoint.createConsumer(new Processor() {
            public void process(Exchange exchange) throws Exception {
                QuickfixjEventCategory eventCategory =
                    (QuickfixjEventCategory) exchange.getIn().getHeader(QuickfixjEndpoint.EVENT_CATEGORY_KEY);
                if (eventCategory == QuickfixjEventCategory.SessionLogon) {
                    logonLatch.countDown();
View Full Code Here


        assertNotNull(out);
        assertFalse(out.hasOut());

        // get the reply from the special reply queue
        Endpoint end = context.getEndpoint(componentName + ":" + myReplyTo);
        final Consumer consumer = end.createConsumer(new Processor() {
            public void process(Exchange exchange) throws Exception {
                assertEquals("Late reply", exchange.getIn().getBody());
                latch.countDown();

            }
View Full Code Here

        String injectionPointName = method.getName();
        Endpoint endpoint = getEndpointInjection(endpointUri, endpointName, injectionPointName, true);
        if (endpoint != null) {
            try {
                Processor processor = createConsumerProcessor(bean, method, endpoint);
                Consumer consumer = endpoint.createConsumer(processor);
                if (LOG.isDebugEnabled()) {
                    LOG.debug("Created processor: " + processor + " for consumer: " + consumer);
                }
                startService(consumer);
            } catch (Exception e) {
View Full Code Here

     * such as adding the processor or consumer
     */
    @Override
    protected void addServices(List<Service> services) throws Exception {
        Endpoint endpoint = getEndpoint();
        Consumer consumer = endpoint.createConsumer(processor);
        if (consumer != null) {
            services.add(consumer);
        }
        Processor processor = getProcessor();
        if (processor instanceof Service) {
View Full Code Here

        mock.expectedMessageCount(1);

        template.sendBody("jms:in", "Hello World");

        Endpoint endpoint = context.getEndpoint("jms:out");
        endpoint.createConsumer(new Processor() {
            public void process(Exchange exchange) throws Exception {
                assertEquals("Bye World", exchange.getIn().getBody(String.class));
            }
        });
View Full Code Here

        assertNotNull(out);
        assertNull(out.getOut(false));

        // get the reply from the special reply queue
        Endpoint end = context.getEndpoint(componentName + ":" + myReplyTo);
        final Consumer consumer = end.createConsumer(new Processor() {
            public void process(Exchange exchange) throws Exception {
                assertEquals("Late reply", exchange.getIn().getBody());
                latch.countDown();

            }
View Full Code Here

    public void testCreateDirectory() throws Exception {
        deleteDirectory("target/file/foo");

        Endpoint endpoint = context.getEndpoint("file://target/file/foo");
        Consumer consumer = endpoint.createConsumer(new Processor() {
            public void process(Exchange exchange) throws Exception {
                // noop
            }
        });
View Full Code Here

        deleteDirectory("target/file/foo");
        // use current dir as base as absolute path
        String base = new File("").getAbsolutePath() + "/target/file/foo";

        Endpoint endpoint = context.getEndpoint("file://" + base);
        Consumer consumer = endpoint.createConsumer(new Processor() {
            public void process(Exchange exchange) throws Exception {
                // noop
            }
        });
View Full Code Here

    public void testDoNotCreateDirectory() throws Exception {
        deleteDirectory("target/file/foo");

        Endpoint endpoint = context.getEndpoint("file://target/file/foo?autoCreate=false");
        Consumer consumer = endpoint.createConsumer(new Processor() {
            public void process(Exchange exchange) throws Exception {
                // noop
            }
        });
View Full Code Here

    public void testStartingDirectoryMustExistDirectory() throws Exception {
        deleteDirectory("target/file/foo");

        Endpoint endpoint = context.getEndpoint("file://target/file/foo?autoCreate=false&startingDirectoryMustExist=true");
        try {
            endpoint.createConsumer(new Processor() {
                public void process(Exchange exchange) throws Exception {
                    // noop
                }
            });
            fail("Should have thrown an exception");
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.