@Bean
  public ActiveMQConnectionFactory connectionFactory() {
    final ActiveMQConnectionFactory activeMQConnectionFactory = new ActiveMQConnectionFactory();
    activeMQConnectionFactory.setRedeliveryPolicyMap(this.redeliveryPolicyMap());
    activeMQConnectionFactory.setBrokerURL(
        this.environment.getRequiredProperty(PROPERTY_NAME_JMS_ACTIVEMQ_BROKER_URL));

    activeMQConnectionFactory.setNonBlockingRedelivery(true);

    return activeMQConnectionFactory;
  }
  public Producer() throws JMSException {
    // Create a ConnectionFactory
    ActiveMQConnectionFactory connectionFactory = new ActiveMQConnectionFactory();
    connectionFactory.setBrokerURL("tcp://localhost:61616");

    connection = connectionFactory.createConnection();
    connection.start();

    // Clean up
    //      connection.close();

  }
Example #3
0
 @Bean
 public ConnectionFactory connectionFactory() {
   ActiveMQConnectionFactory factory = new ActiveMQConnectionFactory();
   factory.setBrokerURL("tcp://127.0.0.1:61616");
   return factory;
 }