Package org.apache.activemq.camel.component

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


            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


    @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

            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

    }

    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

            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

        pooledConnectionFactory.setMaxConnections(8);
        pooledConnectionFactory.setMaximumActive(500);
        pooledConnectionFactory.setIdleTimeout(0); //No timeout for connections in the pool

        ActiveMQComponent activeMQComponent = ActiveMQComponent.activeMQComponent();
        activeMQComponent.setUsePooledConnection(true);
        activeMQComponent.setConnectionFactory(pooledConnectionFactory);
        camelContext.addComponent("amq", activeMQComponent);

        return "amq:queue:" + eventsToInsightsQueueName + "?jmsMessageType=Text";
    }
View Full Code Here

        propagationNotSupported.setPropagationBehaviorName("PROPAGATION_NOT_SUPPORTED");
        registry.put("PROPAGATION_NOT_SUPPORTED", propagationNotSupported);

        CamelContext camelContext = new DefaultCamelContext(registry);

        ActiveMQComponent activeMQComponent = new ActiveMQComponent();
        activeMQComponent.setConnectionFactory(connectionFactory);
        activeMQComponent.setTransactionManager(jmsTransactionManager);
        camelContext.addComponent("jms", activeMQComponent);

        return camelContext;
    }
View Full Code Here

        policy.setPropagationBehaviorName("PROPAGATION_REQUIRED");
        registry.put("PROPAGATION_REQUIRED", policy);

        CamelContext camelContext = new DefaultCamelContext(registry);

        ActiveMQComponent activeMQComponent = new ActiveMQComponent();
        activeMQComponent.setConnectionFactory(connectionFactory);
        activeMQComponent.setTransactionManager(jmsTransactionManager);
        camelContext.addComponent("jms", activeMQComponent);

        return camelContext;
    }
View Full Code Here

        ActiveMQConnectionFactory connectionFactory = new ActiveMQConnectionFactory();
        connectionFactory.setBrokerURL(broker.getTcpConnectorUri());
        registry.put("connectionFactory", connectionFactory);

        CamelContext camelContext = new DefaultCamelContext(registry);
        ActiveMQComponent activeMQComponent = new ActiveMQComponent();
        activeMQComponent.setConnectionFactory(connectionFactory);
        camelContext.addComponent("jms", activeMQComponent);
        return camelContext;
    }
View Full Code Here

            sqlComponent.setDataSource(atomikosDataSourceBean);
            camelContext.addComponent("sql", sqlComponent);
        }
        {
            // transactional JMS component
            ActiveMQComponent activeMQComponent = new ActiveMQComponent();
            activeMQComponent.setConnectionFactory(atomikosConnectionFactoryBean);
            activeMQComponent.setTransactionManager(jtaTransactionManager);
            camelContext.addComponent("jms", activeMQComponent);
        }
        {
            // non-transactional JMS component setup for test purposes
            ActiveMQConnectionFactory connectionFactory =
                new ActiveMQConnectionFactory();
            connectionFactory.setBrokerURL(broker.getTcpConnectorUri());

            ActiveMQComponent activeMQComponent = new ActiveMQComponent();
            activeMQComponent.setConnectionFactory(connectionFactory);
            activeMQComponent.setTransactionManager(jtaTransactionManager);
            camelContext.addComponent("nonTxJms", activeMQComponent);
        }
        return camelContext;
    }
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.