use of org.apache.activemq.broker.BrokerService in project activemq-artemis by apache.
the class BrokerNetworkWithStuckMessagesTest method createSecondRemoteBroker.
protected BrokerService createSecondRemoteBroker() throws Exception {
secondRemoteBroker = new BrokerService();
secondRemoteBroker.setBrokerName("secondRemotehost");
secondRemoteBroker.setUseJmx(false);
secondRemoteBroker.setPersistenceAdapter(null);
secondRemoteBroker.setPersistent(false);
secondRemoteConnector = createSecondRemoteConnector();
secondRemoteBroker.addConnector(secondRemoteConnector);
configureBroker(secondRemoteBroker);
secondRemoteBroker.start();
secondRemoteBroker.waitUntilStarted();
brokers.put(secondRemoteBroker.getBrokerName(), secondRemoteBroker);
return secondRemoteBroker;
}
use of org.apache.activemq.broker.BrokerService in project activemq-artemis by apache.
the class DuplexNetworkMBeanTest method testMbeanPresenceOnBrokerRestart.
@Test
public void testMbeanPresenceOnBrokerRestart() throws Exception {
BrokerService networkedBroker = createNetworkedBroker();
try {
networkedBroker.start();
assertEquals(1, countMbeans(networkedBroker, "connector=networkConnectors", 30000));
assertEquals(0, countMbeans(networkedBroker, "connectionName"));
BrokerService broker = null;
for (int i = 0; i < numRestarts; i++) {
broker = createBroker();
try {
broker.start();
assertEquals(1, countMbeans(networkedBroker, "networkBridge", 5000));
assertEquals("restart number: " + i, 2, countMbeans(broker, "connectionName", 10000));
} finally {
broker.stop();
broker.waitUntilStopped();
}
assertEquals(0, countMbeans(broker, "stopped"));
}
assertEquals(1, countMbeans(networkedBroker, "connector=networkConnectors"));
assertEquals(0, countMbeans(networkedBroker, "connectionName"));
assertEquals(0, countMbeans(broker, "connectionName"));
} finally {
networkedBroker.stop();
networkedBroker.waitUntilStopped();
}
}
use of org.apache.activemq.broker.BrokerService in project activemq-artemis by apache.
the class DuplexNetworkMBeanTest method createNetworkedBroker.
protected BrokerService createNetworkedBroker() throws Exception {
BrokerService broker = new BrokerService();
broker.setBrokerName("networkedBroker");
broker.addConnector("tcp://localhost:62617?transport.reuseAddress=true");
NetworkConnector networkConnector = broker.addNetworkConnector("static:(tcp://localhost:61617?wireFormat.maxInactivityDuration=500)?useExponentialBackOff=false");
networkConnector.setDuplex(true);
return broker;
}
use of org.apache.activemq.broker.BrokerService in project activemq-artemis by apache.
the class NetworkConnectionsTest method setUp.
@Override
protected void setUp() throws Exception {
LOG.info("Setting up LocalBroker");
localBroker = new BrokerService();
localBroker.setBrokerName("LocalBroker");
localBroker.setUseJmx(false);
localBroker.setPersistent(false);
localBroker.setTransportConnectorURIs(new String[] { LOCAL_BROKER_TRANSPORT_URI });
localBroker.start();
localBroker.waitUntilStarted();
LOG.info("Setting up RemoteBroker");
remoteBroker = new BrokerService();
remoteBroker.setBrokerName("RemoteBroker");
remoteBroker.setUseJmx(false);
remoteBroker.setPersistent(false);
remoteBroker.setTransportConnectorURIs(new String[] { REMOTE_BROKER_TRANSPORT_URI });
remoteBroker.start();
remoteBroker.waitUntilStarted();
}
use of org.apache.activemq.broker.BrokerService in project activemq-artemis by apache.
the class NetworkRemovesSubscriptionsTest method setUp.
@Override
protected void setUp() throws Exception {
this.backEnd = new BrokerService();
this.backEnd.setBrokerName("backEnd");
this.backEnd.setPersistent(false);
NetworkConnector backEndNetwork = this.backEnd.addNetworkConnector("static://" + frontEndAddress);
backEndNetwork.setName("backEndNetwork");
backEndNetwork.setDynamicOnly(true);
this.backEnd.addConnector(backEndAddress);
this.backEnd.start();
this.frontEnd = new BrokerService();
this.frontEnd.setBrokerName("frontEnd");
this.frontEnd.setPersistent(false);
NetworkConnector frontEndNetwork = this.frontEnd.addNetworkConnector("static://" + backEndAddress);
frontEndNetwork.setName("frontEndNetwork");
this.frontEnd.addConnector(frontEndAddress);
this.frontEnd.start();
Thread.sleep(2000);
}
Aggregations