Package org.apache.activemq.camel.component

Examples of org.apache.activemq.camel.component.ActiveMQComponent


    public static String getDefaultEndpointUri() {
        return "activemq:" + CamelJmxConnectorSupport.DEFAULT_DESTINATION_PREFIX;
    }

    public static void configureActiveMQComponent(CamelContext camelContext, String brokerUrl) {
        ActiveMQComponent activemqComponent = camelContext.getComponent("activemq", ActiveMQComponent.class);
        activemqComponent.setBrokerURL(brokerUrl);
    }
View Full Code Here


            ContextBuilder contextBuilderCorrelationID = new ContextBuilder() {
                public CamelContext buildContext(CamelContext context) throws Exception {
                    ConnectionFactory connectionFactory =
                        CamelJmsTestHelper.createConnectionFactory();
                    ActiveMQComponent jmsComponent = ActiveMQComponent.activeMQComponent();
                    jmsComponent.setConnectionFactory(connectionFactory);
                    jmsComponent.setUseMessageIDAsCorrelationID(false);
                    jmsComponent.setConcurrentConsumers(maxServerTasks);
                    context.addComponent(componentName, jmsComponent);
                    return context;
                }
            };

            ContextBuilder contextBuilderMessageIDNamedReplyToSelector = new ContextBuilder() {
                public CamelContext buildContext(CamelContext context) throws Exception {
                    ConnectionFactory connectionFactory =
                        CamelJmsTestHelper.createConnectionFactory();
                    ActiveMQComponent jmsComponent = ActiveMQComponent.activeMQComponent();
                    jmsComponent.setConnectionFactory(connectionFactory);
                    jmsComponent.setUseMessageIDAsCorrelationID(true);
                    jmsComponent.setConcurrentConsumers(maxServerTasks);
                    jmsComponent.getConfiguration().setReplyToDestinationSelectorName(REPLY_TO_DESTINATION_SELECTOR_NAME);
                    context.addComponent(componentName, jmsComponent);
                    return context;
                }
            };

            ContextBuilder contextBuilderCorrelationIDNamedReplyToSelector = new ContextBuilder() {
                public CamelContext buildContext(CamelContext context) throws Exception {
                    ConnectionFactory connectionFactory =
                        CamelJmsTestHelper.createConnectionFactory();
                    ActiveMQComponent jmsComponent = ActiveMQComponent.activeMQComponent();
                    jmsComponent.setConnectionFactory(connectionFactory);
                    jmsComponent.setUseMessageIDAsCorrelationID(false);
                    jmsComponent.setConcurrentConsumers(maxServerTasks);
                    jmsComponent.getConfiguration().setReplyToDestinationSelectorName(REPLY_TO_DESTINATION_SELECTOR_NAME);
                    context.addComponent(componentName, jmsComponent);
                    return context;
                }
            };


            ContextBuilder contextBuilderCorrelationIDDiffComp = new ContextBuilder() {
                public CamelContext buildContext(CamelContext context) throws Exception {
                    ConnectionFactory connectionFactory =
                        CamelJmsTestHelper.createConnectionFactory();
                    ActiveMQComponent jmsComponent = ActiveMQComponent.activeMQComponent();
                    jmsComponent.setConnectionFactory(connectionFactory);
                    jmsComponent.setConcurrentConsumers(maxServerTasks);
                    context.addComponent(componentName, jmsComponent);

                    ActiveMQComponent jmsComponent1 = ActiveMQComponent.activeMQComponent();
                    jmsComponent1.setConnectionFactory(connectionFactory);
                    jmsComponent1.setUseMessageIDAsCorrelationID(false);
                    jmsComponent1.setConcurrentConsumers(maxServerTasks);
                    context.addComponent(componentName1, jmsComponent1);
                    return context;
                }
            };

            ContextBuilder contextBuilderMessageIDDiffComp = new ContextBuilder() {
                public CamelContext buildContext(CamelContext context) throws Exception {
                    ConnectionFactory connectionFactory =
                        CamelJmsTestHelper.createConnectionFactory();
                    ActiveMQComponent jmsComponent = ActiveMQComponent.activeMQComponent();
                    jmsComponent.setConnectionFactory(connectionFactory);
                    jmsComponent.setUseMessageIDAsCorrelationID(true);
                    jmsComponent.setConcurrentConsumers(maxServerTasks);
                    context.addComponent(componentName, jmsComponent);

                    ActiveMQComponent jmsComponent1 = ActiveMQComponent.activeMQComponent();
                    jmsComponent1.setConnectionFactory(connectionFactory);
                    jmsComponent1.setUseMessageIDAsCorrelationID(true);
                    jmsComponent1.setConcurrentConsumers(maxServerTasks);
                    context.addComponent(componentName1, jmsComponent1);
                    return context;
                }
            };
View Full Code Here

      if (camelContext == null) {
        LOG.debug("Creating camel context");
        camelContext = new DefaultCamelContext();
        ActiveMQConfiguration conf = new ActiveMQConfiguration();
        conf.setConnectionFactory(new PooledConnectionFactory((ActiveMQConnectionFactory)factory));
        ActiveMQComponent component = new ActiveMQComponent(conf);
        camelContext.addComponent("activemq", component);
      }
      return camelContext;
    }
View Full Code Here

      if (camelContext == null) {
        LOG.debug("Creating camel context");
        camelContext = new DefaultCamelContext();
        ActiveMQConfiguration conf = new ActiveMQConfiguration();
        conf.setConnectionFactory(new PooledConnectionFactory((ActiveMQConnectionFactory)factory));
        ActiveMQComponent component = new ActiveMQComponent(conf);
        camelContext.addComponent("activemq", component);
      }
      return camelContext;
    }
View Full Code Here

      if (camelContext == null) {
        LOG.debug("Creating camel context");
        camelContext = new DefaultCamelContext();
        ActiveMQConfiguration conf = new ActiveMQConfiguration();
        conf.setConnectionFactory(new PooledConnectionFactory((ActiveMQConnectionFactory)factory));
        ActiveMQComponent component = new ActiveMQComponent(conf);
        camelContext.addComponent("activemq", component);
      }
      return camelContext;
    }
View Full Code Here

    @Override
    protected Context createJndiContext() throws Exception {
        JndiContext answer = new JndiContext();

        // add ActiveMQ with embedded broker
        ActiveMQComponent amq = ActiveMQComponent.activeMQComponent("vm://localhost?broker.persistent=false");
        amq.setCamelContext(context);
        answer.bind("jms", amq);
        return answer;
    }
View Full Code Here

    }

    protected CamelContext createCamelContext() throws Exception {
        CamelContext camelContext = super.createCamelContext();

        ActiveMQComponent amq = ActiveMQComponent.activeMQComponent("vm://localhost?broker.persistent=false");
        // as this is a unit test I dont want to wait 20 sec before timeout occurs, so we use 10
        amq.getConfiguration().setRequestTimeout(10000);
        camelContext.addComponent(componentName, amq);

        return camelContext;
    }
View Full Code Here

    }

    protected CamelContext createCamelContext() throws Exception {
        CamelContext camelContext = super.createCamelContext();
        // TODO: MR-170
        ActiveMQComponent activemq =
            activeMQComponent("vm://localhost?broker.persistent=false&broker.useJmx=false&jms.redeliveryPolicy.maximumRedeliveries=0"
                              + "&jms.redeliveryPolicy.initialRedeliveryDelay=500&jms.useAsyncSend=false&jms.sendTimeout=10000"
                              + "&jms.maxReconnectAttempts=1&jms.timeout=3000");
        camelContext.addComponent("activemq", activemq);
        return camelContext;
View Full Code Here

    @Override
    protected Context createJndiContext() throws Exception {
        JndiContext answer = new JndiContext();

        // add ActiveMQ with embedded broker
        ActiveMQComponent amq = ActiveMQComponent.activeMQComponent("vm://localhost?broker.persistent=false");
        amq.setCamelContext(context);
        answer.bind("activemq", amq);
        return answer;
    }
View Full Code Here

    @Override
    protected Context createJndiContext() throws Exception {
        JndiContext answer = new JndiContext();

        // add ActiveMQ with embedded broker
        ActiveMQComponent amq = ActiveMQComponent.activeMQComponent("vm://localhost?broker.persistent=false");
        amq.setCamelContext(context);
        answer.bind("jms", amq);
        return answer;
    }
View Full Code Here

TOP

Related Classes of org.apache.activemq.camel.component.ActiveMQComponent

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.