use of org.apache.activemq.broker.BrokerService in project activemq-artemis by apache.
the class CheckDuplicateMessagesOnDuplexTest method createLocalBroker.
private void createLocalBroker() throws Exception {
localBroker = new BrokerService();
localBroker.setBrokerName("LOCAL");
localBroker.setUseJmx(true);
localBroker.setSchedulePeriodForDestinationPurge(5000);
ManagementContext managementContext = new ManagementContext();
managementContext.setCreateConnector(false);
localBroker.setManagementContext(managementContext);
PersistenceAdapter persistenceAdapter = persistenceAdapterFactory("target/local");
localBroker.setPersistenceAdapter(persistenceAdapter);
List<TransportConnector> transportConnectors = new ArrayList<>();
DebugTransportFactory tf = new DebugTransportFactory();
TransportServer transport = tf.doBind(URI.create("nio://127.0.0.1:23539"));
TransportConnector transportConnector = new TransportConnector(transport);
transportConnector.setName("tc");
transportConnector.setAuditNetworkProducers(true);
transportConnectors.add(transportConnector);
localBroker.setTransportConnectors(transportConnectors);
}
use of org.apache.activemq.broker.BrokerService in project activemq-artemis by apache.
the class SecurityTestSupport method createBroker.
/**
* Overrides to set the JMSXUserID flag to true.
*/
@Override
protected BrokerService createBroker() throws Exception {
BrokerService broker = super.createBroker();
broker.setPopulateJMSXUserID(true);
return broker;
}
use of org.apache.activemq.broker.BrokerService in project activemq-artemis by apache.
the class BrokerStatisticsPluginTest method createBroker.
protected BrokerService createBroker() throws Exception {
BrokerService answer = new BrokerService();
BrokerPlugin[] plugins = new BrokerPlugin[1];
plugins[0] = new StatisticsBrokerPlugin();
answer.setPlugins(plugins);
answer.setDeleteAllMessagesOnStartup(true);
answer.addConnector("tcp://localhost:0");
answer.start();
return answer;
}
use of org.apache.activemq.broker.BrokerService in project activemq-artemis by apache.
the class ProxyTestSupport method createRemoteBroker.
protected BrokerService createRemoteBroker() throws Exception {
BrokerService service = new BrokerService();
service.setBrokerName("broker2");
service.setPersistent(false);
service.setUseJmx(false);
remoteConnector = service.addConnector(getRemoteURI());
remoteProxyConnector = new ProxyConnector();
remoteProxyConnector.setName("remoteProxy");
remoteProxyConnector.setBind(new URI(getRemoteProxyURI()));
remoteProxyConnector.setRemote(new URI("fanout:static://" + getLocalURI()));
service.addProxyConnector(remoteProxyConnector);
return service;
}
use of org.apache.activemq.broker.BrokerService in project activemq-artemis by apache.
the class InactiveDurableTopicTest method setUp.
@Override
protected void setUp() throws Exception {
super.setUp();
broker = new BrokerService();
// broker.setPersistenceAdapter(new KahaPersistenceAdapter());
/*
* JournalPersistenceAdapterFactory factory = new
* JournalPersistenceAdapterFactory();
* factory.setDataDirectoryFile(broker.getDataDirectory());
* factory.setTaskRunnerFactory(broker.getTaskRunnerFactory());
* factory.setUseJournal(false); broker.setPersistenceFactory(factory);
*/
broker.addConnector(ActiveMQConnectionFactory.DEFAULT_BROKER_BIND_URL);
broker.start();
connectionFactory = new ActiveMQConnectionFactory(ActiveMQConnectionFactory.DEFAULT_BROKER_URL);
/*
* Doesn't matter if you enable or disable these, so just leaving them
* out for this test case connectionFactory.setAlwaysSessionAsync(true);
* connectionFactory.setAsyncDispatch(true);
*/
connectionFactory.setUseAsyncSend(true);
}
Aggregations