Package org.apache.camel

Examples of org.apache.camel.Consumer


       
        RestletEndpoint endpoint = camelContext.getEndpoint(url, RestletEndpoint.class);
        setProperties(endpoint, parameters);

        // configure consumer properties
        Consumer consumer = endpoint.createConsumer(processor);
        if (config != null && config.getConsumerProperties() != null && !config.getConsumerProperties().isEmpty()) {
            setProperties(consumer, config.getConsumerProperties());
        }

        return consumer;
View Full Code Here


        super(endpointUri, component);
        this.configuration = configuration;
    }

    public Consumer createConsumer(Processor processor) throws Exception {
        Consumer answer = new NettyConsumer(this, processor, configuration);
        configureConsumer(answer);
        return answer;
    }
View Full Code Here

        // use the rest binding
        endpoint.setBinding(new ServletRestHttpBinding());

        // configure consumer properties
        Consumer consumer = endpoint.createConsumer(processor);
        if (config != null && config.getConsumerProperties() != null && !config.getConsumerProperties().isEmpty()) {
            setProperties(consumer, config.getConsumerProperties());
        }

        return consumer;
View Full Code Here

        endpoint.setEnableMultipartFilter(false);
        // use the rest binding
        endpoint.setBinding(new JettyRestHttpBinding());

        // configure consumer properties
        Consumer consumer = endpoint.createConsumer(processor);
        if (config != null && config.getConsumerProperties() != null && !config.getConsumerProperties().isEmpty()) {
            setProperties(consumer, config.getConsumerProperties());
        }

        return consumer;
View Full Code Here

        // filter out already started routes
        Map<String, RouteService> filtered = new LinkedHashMap<String, RouteService>();
        for (Map.Entry<String, RouteService> entry : routeServices.entrySet()) {
            boolean startable = false;

            Consumer consumer = entry.getValue().getRoutes().iterator().next().getConsumer();
            if (consumer instanceof SuspendableService) {
                // consumer could be suspended, which is not reflected in the RouteService status
                startable = ((SuspendableService) consumer).isSuspended();
            }
View Full Code Here

                throw new IllegalArgumentException("Cannot use existing queue " + key + " as the existing queue multiple consumers "
                        + ref.getMultipleConsumers() + " does not match given multiple consumers " + multipleConsumers);
            }
        }

        Consumer answer = new SedaConsumer(this, processor);
        configureConsumer(answer);
        return answer;
    }
View Full Code Here

            Endpoint endpoint = getEndpointInjection(annotation.uri(), annotation.name());
            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

            }
        };
    }

    public Consumer createConsumer(Processor processor) throws Exception {
        Consumer answer = new LoadBalancerConsumer(this, processor, loadBalancer);
        configureConsumer(answer);
        return answer;
    }
View Full Code Here

    @Test
    public void testSetServletInitalparameters() throws Exception {
        String uri = "websocket://localhost:" + port + "/bar?bufferSize=65000&maxIdleTime=3000";
        WebsocketEndpoint websocketEndpoint = (WebsocketEndpoint)context.getEndpoint(uri);
        WebsocketComponent component = websocketEndpoint.getComponent();
        Consumer consumer = websocketEndpoint.createConsumer(processor);
        component.connect((WebsocketProducerConsumer) consumer);
       
        assertNotNull(consumer);
        assertEquals(WebsocketConsumer.class, consumer.getClass());
       
        // just check the servlet initial parameters
        ConnectorRef conector = component.getConnectors().values().iterator().next();
       
        ServletContextHandler context = (ServletContextHandler)conector.server.getHandler();
View Full Code Here

                throw new IllegalArgumentException("Cannot use existing queue " + key + " as the existing queue multiple consumers "
                        + ref.getMultipleConsumers() + " does not match given multiple consumers " + multipleConsumers);
            }
        }

        Consumer answer = new SedaConsumer(this, processor);
        configureConsumer(answer);
        return answer;
    }
View Full Code Here

TOP

Related Classes of org.apache.camel.Consumer

Copyright © 2018 www.massapicom. 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.