Package org.springframework.issues

Source Code of org.springframework.issues.ActiveMqConfig

package org.springframework.issues;

import javax.jms.ConnectionFactory;

import org.apache.activemq.ActiveMQConnectionFactory;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.jms.connection.CachingConnectionFactory;
import org.springframework.jms.core.JmsTemplate;

/**
*
* @author Stephane Nicoll
*/
@Configuration
public class ActiveMqConfig {

  @Bean
  public ConnectionFactory connectionFactory() {
    return new CachingConnectionFactory(
        new ActiveMQConnectionFactory("failover:(tcp://127.0.0.1:61616)"));
  }

  @Bean
  public JmsTemplate jmsTemplate() {
    return new JmsTemplate(connectionFactory());
  }

}
TOP

Related Classes of org.springframework.issues.ActiveMqConfig

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.