Examples of JmsComponent


Examples of org.apache.camel.component.jms.JmsComponent

    }
   
    @Override
    // setup the ActiveMQ component and register it into the camel context
    protected void setupCamelContext(CamelContext camelContext) throws Exception {
        JmsComponent answer = new JmsComponent();
        ActiveMQConnectionFactory connectionFactory = new ActiveMQConnectionFactory();
        connectionFactory.setBrokerURL("vm://localhost.spring.javaconfig?marshal=false&broker.persistent=false&broker.useJmx=false");
        answer.setConnectionFactory(connectionFactory);       
        camelContext.addComponent("jms", answer);       
    }
View Full Code Here

Examples of org.apache.camel.component.jms.JmsComponent

        broker.setPersistent(false);
        broker.setTimeBeforePurgeTempDestinations(1000);
        broker.start();

        DefaultCamelContext context = new DefaultCamelContext();
        JmsComponent jmsComponent = new JmsComponent();

        /**
         *
         */
        ActiveMQConnectionFactory connectionFactory = new ActiveMQConnectionFactory();
        connectionFactory.setBrokerURL("failover://(tcp://localhost:61616)?maxReconnectAttempts=1");

        /**
         * When using Tibco EMS the problem can be recreated. As the broker is
         * external it has to be stopped and started by hand.
         */
        // TibjmsConnectionFactory connectionFactory = new
        // TibjmsConnectionFactory();
        // connectionFactory.setReconnAttemptCount(1);

        jmsComponent.setConnectionFactory(connectionFactory);
        jmsComponent.setRequestTimeout(1000);
        jmsComponent.setReceiveTimeout(1000);
        context.addComponent("jms", jmsComponent);
        context.addRoutes(new RouteBuilder() {

            @Override
            public void configure() throws Exception {
View Full Code Here

Examples of org.apache.camel.component.jms.JmsComponent

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

        ConnectionFactory connectionFactory = CamelJmsTestHelper.createConnectionFactory();
        camelContext.addComponent("activemq", jmsComponentAutoAcknowledge(connectionFactory));
        JmsComponent jms = camelContext.getComponent("activemq", JmsComponent.class);
        jms.getConfiguration().setJmsKeyFormatStrategy(new PassThroughJmsKeyFormatStrategy());

        return camelContext;
    }
View Full Code Here

Examples of org.apache.camel.component.jms.JmsComponent

  @Bean
  public CamelContext jmsContext() {
    CamelContext ctx = common.camelContext();
    if ( ctx.getComponent("activemq") == null ) {
      ConnectionFactory connectionFactory = getConnectionFactory();
      JmsComponent jmsComponent = JmsComponent.jmsComponentAutoAcknowledge(connectionFactory);
      ctx.addComponent("activemq", jmsComponent);
    }
    return ctx;
  }
View Full Code Here

Examples of org.apache.camel.component.jms.JmsComponent

   @Bean
  public CamelContext jmsContextWithClientACK() {
    CamelContext ctx = common.camelContext();
    if ( ctx.getComponent("activemq") == null ) {
      ConnectionFactory connectionFactory = getConnectionFactory();
      JmsComponent jmsComponent = JmsComponent.jmsComponentClientAcknowledge(connectionFactory);
      ctx.addComponent("activemq", jmsComponent);
    }
   
    return ctx;
  }
View Full Code Here

Examples of org.apache.camel.component.jms.JmsComponent

   
    @Override
    protected Context createJndiContext() throws Exception {
        JndiContext answer = new JndiContext();
        ConnectionFactory connectionFactory = new ActiveMQConnectionFactory("vm://localhost?broker.persistent=true");
        JmsComponent component = JmsComponent.jmsComponent(connectionFactory);
        component.setConcurrentConsumers(4);
        answer.bind("activemq", JmsComponent.jmsComponentAutoAcknowledge(connectionFactory));
        answer.bind("myBean1", b1);
        answer.bind("myBean2", b2);
        answer.bind("myBean3", b3);
        return answer;
View Full Code Here

Examples of org.apache.camel.component.jms.JmsComponent

    }

    @Test
    public void testRollbackUsingXmlQueueToQueueRequestReplyUsingDynamicMessageSelector() throws Exception {

        JmsComponent c = (JmsComponent)context.getComponent("activemq");
        JmsComponent c1 = (JmsComponent)context.getComponent("activemq-1");
        final ConditionalExceptionProcessor cp = new ConditionalExceptionProcessor(10);
        context.addRoutes(new SpringRouteBuilder() {
            @Override
            public void configure() throws Exception {
                Policy required = lookup("PROPAGATION_REQUIRED_POLICY", SpringTransactionPolicy.class);
View Full Code Here

Examples of org.apache.camel.component.jms.JmsComponent

    }
   
    @Override
    // setup the ActiveMQ component and register it into the camel context
    public void setupCamelContext(CamelContext camelContext) throws Exception {
        JmsComponent answer = new JmsComponent();
        ActiveMQConnectionFactory connectionFactory = new ActiveMQConnectionFactory();
        connectionFactory.setBrokerURL("vm://localhost?broker.persistent=false&broker.useJmx=false");
        answer.setConnectionFactory(connectionFactory);       
        camelContext.addComponent("jms", answer);       
    }
View Full Code Here

Examples of org.apache.camel.component.jms.JmsComponent

        // setup the ActiveMQ component
        ActiveMQConnectionFactory connectionFactory = new ActiveMQConnectionFactory();
        connectionFactory.setBrokerURL("vm://localhost.spring.javaconfig?marshal=false&broker.persistent=false&broker.useJmx=false");

        // and register it into the CamelContext
        JmsComponent answer = new JmsComponent();
        answer.setConnectionFactory(connectionFactory);
        camelContext.addComponent("jms", answer);
    }
View Full Code Here

Examples of org.apache.camel.component.jms.JmsComponent

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

        ConnectionFactory connectionFactory = new ActiveMQConnectionFactory("vm://localhost?broker.persistent=false");
        JmsComponent jms = jmsComponentClientAcknowledge(connectionFactory);

        // use a spring 2.x task executor
        ThreadPoolTaskExecutor executor = new ThreadPoolTaskExecutor();
        executor.setCorePoolSize(4);
        executor.setMaxPoolSize(16);
        executor.setThreadNamePrefix("foo");
        executor.afterPropertiesSet();
        jms.setTaskExecutorSpring2(executor);

        camelContext.addComponent("activemq", jms);

        return camelContext;
    }
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.