Search in sources :

Example 81 with BrokerService

use of org.apache.activemq.broker.BrokerService in project activemq-artemis by apache.

the class QueueOutboundBridgeReconnectTest method createSecondBroker.

protected BrokerService createSecondBroker() throws Exception {
    BrokerService broker = new BrokerService();
    broker.setBrokerName("broker2");
    broker.setPersistent(false);
    broker.setUseJmx(false);
    broker.addConnector("tcp://localhost:61617");
    broker.addConnector("vm://broker2");
    return broker;
}
Also used : BrokerService(org.apache.activemq.broker.BrokerService)

Example 82 with BrokerService

use of org.apache.activemq.broker.BrokerService in project activemq-artemis by apache.

the class TopicBridgeStandaloneReconnectTest method createFirstBroker.

protected BrokerService createFirstBroker() throws Exception {
    BrokerService broker = new BrokerService();
    broker.setBrokerName("broker1");
    broker.setPersistent(false);
    broker.setUseJmx(false);
    broker.addConnector("tcp://localhost:61616");
    return broker;
}
Also used : BrokerService(org.apache.activemq.broker.BrokerService)

Example 83 with BrokerService

use of org.apache.activemq.broker.BrokerService in project activemq-artemis by apache.

the class TopicOutboundBridgeReconnectTest method createFirstBroker.

protected BrokerService createFirstBroker() throws Exception {
    BrokerService broker = new BrokerService();
    broker.setBrokerName("broker1");
    broker.setPersistent(false);
    broker.setUseJmx(false);
    broker.addConnector("tcp://localhost:61616");
    broker.addConnector("vm://broker1");
    SimpleJmsTopicConnector jmsTopicConnector = new SimpleJmsTopicConnector();
    jmsTopicConnector.setOutboundTopicBridges(new OutboundTopicBridge[] { new OutboundTopicBridge("RECONNECT.TEST.TOPIC") });
    jmsTopicConnector.setOutboundTopicConnectionFactory(new ActiveMQConnectionFactory("tcp://localhost:61617"));
    broker.setJmsBridgeConnectors(new JmsConnector[] { jmsTopicConnector });
    return broker;
}
Also used : ActiveMQConnectionFactory(org.apache.activemq.ActiveMQConnectionFactory) BrokerService(org.apache.activemq.broker.BrokerService)

Example 84 with BrokerService

use of org.apache.activemq.broker.BrokerService in project activemq-artemis by apache.

the class BrokerPropertiesTest method testPropertiesFile.

public void testPropertiesFile() throws Exception {
    BrokerService broker = BrokerFactory.createBroker("properties:org/apache/activemq/config/broker.properties");
    LOG.info("Created broker: " + broker);
    assertNotNull(broker);
    assertEquals("isUseJmx()", false, broker.isUseJmx());
    assertEquals("isPersistent()", false, broker.isPersistent());
    assertEquals("getBrokerName()", "Cheese", broker.getBrokerName());
    broker.stop();
}
Also used : BrokerService(org.apache.activemq.broker.BrokerService)

Example 85 with BrokerService

use of org.apache.activemq.broker.BrokerService in project activemq-artemis by apache.

the class OpenTypeSupportTest method setUp.

@Before
public void setUp() throws Exception {
    brokerService = new BrokerService();
    brokerService.setPersistent(false);
    brokerService.setUseJmx(true);
    connectionUri = brokerService.addConnector(BROKER_ADDRESS).getPublishableConnectString();
    brokerService.start();
    connectionFactory = new ActiveMQConnectionFactory(connectionUri);
    sendMessage();
}
Also used : ActiveMQConnectionFactory(org.apache.activemq.ActiveMQConnectionFactory) BrokerService(org.apache.activemq.broker.BrokerService) Before(org.junit.Before)

Aggregations

BrokerService (org.apache.activemq.broker.BrokerService)349 URI (java.net.URI)53 PolicyEntry (org.apache.activemq.broker.region.policy.PolicyEntry)45 PolicyMap (org.apache.activemq.broker.region.policy.PolicyMap)45 Test (org.junit.Test)43 ActiveMQConnectionFactory (org.apache.activemq.ActiveMQConnectionFactory)32 TransportConnector (org.apache.activemq.broker.TransportConnector)31 Before (org.junit.Before)22 File (java.io.File)20 MemoryPersistenceAdapter (org.apache.activemq.store.memory.MemoryPersistenceAdapter)17 JMSException (javax.jms.JMSException)16 JDBCPersistenceAdapter (org.apache.activemq.store.jdbc.JDBCPersistenceAdapter)14 KahaDBPersistenceAdapter (org.apache.activemq.store.kahadb.KahaDBPersistenceAdapter)14 BrokerFactoryBean (org.apache.activemq.xbean.BrokerFactoryBean)14 NetworkConnector (org.apache.activemq.network.NetworkConnector)13 MessageConsumer (javax.jms.MessageConsumer)12 PersistenceAdapter (org.apache.activemq.store.PersistenceAdapter)12 ArrayList (java.util.ArrayList)11 Destination (javax.jms.Destination)11 ClassPathResource (org.springframework.core.io.ClassPathResource)10