Search in sources :

Example 96 with BrokerService

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

the class SslContextBrokerServiceTest method setUp.

@Override
protected void setUp() throws Exception {
    Thread.currentThread().setContextClassLoader(SslContextBrokerServiceTest.class.getClassLoader());
    context = new ClassPathXmlApplicationContext("org/apache/activemq/transport/tcp/activemq-ssl.xml");
    Map<String, BrokerService> beansOfType = context.getBeansOfType(BrokerService.class);
    broker = beansOfType.values().iterator().next();
    connector = broker.getTransportConnectors().get(0);
}
Also used : ClassPathXmlApplicationContext(org.springframework.context.support.ClassPathXmlApplicationContext) BrokerService(org.apache.activemq.broker.BrokerService)

Example 97 with BrokerService

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

the class SslContextNBrokerServiceTest method getBroker.

private BrokerService getBroker(String name) {
    BrokerService result = null;
    Iterator<BrokerService> iterator = beansOfType.values().iterator();
    while (iterator.hasNext()) {
        BrokerService candidate = iterator.next();
        if (candidate.getBrokerName().equals(name)) {
            result = candidate;
            break;
        }
    }
    return result;
}
Also used : BrokerService(org.apache.activemq.broker.BrokerService)

Example 98 with BrokerService

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

the class AdvisoryDuplexNetworkBridgeTest method createBroker1.

@Override
public void createBroker1() throws Exception {
    broker1 = new BrokerService();
    broker1.setBrokerName("broker1");
    broker1.addConnector("tcp://localhost:61617");
    broker1.setUseJmx(false);
    broker1.setPersistent(false);
    broker1.start();
    broker1.waitUntilStarted();
}
Also used : BrokerService(org.apache.activemq.broker.BrokerService)

Example 99 with BrokerService

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

the class DbRestartJDBCQueueTest method setUp.

@Override
protected void setUp() throws Exception {
    setAutoFail(true);
    topic = false;
    verbose = true;
    // startup db
    sharedDs = (EmbeddedDataSource) DataSourceServiceSupport.createDataSource(IOHelper.getDefaultDataDirectory());
    broker = new BrokerService();
    DefaultIOExceptionHandler handler = new DefaultIOExceptionHandler();
    handler.setIgnoreSQLExceptions(false);
    handler.setStopStartConnectors(true);
    broker.setIoExceptionHandler(handler);
    broker.addConnector("tcp://localhost:0");
    broker.setUseJmx(false);
    broker.setPersistent(true);
    broker.setDeleteAllMessagesOnStartup(true);
    JDBCPersistenceAdapter persistenceAdapter = new JDBCPersistenceAdapter();
    persistenceAdapter.setDataSource(sharedDs);
    persistenceAdapter.setUseLock(false);
    persistenceAdapter.setLockKeepAlivePeriod(500);
    persistenceAdapter.getLocker().setLockAcquireSleepInterval(500);
    broker.setPersistenceAdapter(persistenceAdapter);
    broker.start();
    super.setUp();
}
Also used : DefaultIOExceptionHandler(org.apache.activemq.util.DefaultIOExceptionHandler) JDBCPersistenceAdapter(org.apache.activemq.store.jdbc.JDBCPersistenceAdapter) BrokerService(org.apache.activemq.broker.BrokerService)

Example 100 with BrokerService

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

the class QueueMasterSlaveSingleUrlTest method createMaster.

@Override
protected void createMaster() throws Exception {
    master = new BrokerService();
    master.setBrokerName("shared-master");
    configureSharedPersistenceAdapter(master);
    master.addConnector(brokerUrl);
    master.start();
}
Also used : BrokerService(org.apache.activemq.broker.BrokerService)

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