Package org.apache.activemq.broker

Examples of org.apache.activemq.broker.BrokerService.waitUntilStarted()


    public void startBroker(URI configURI) throws Exception {
        System.out.println("Loading message broker from: " + configURI);
        BrokerService broker = BrokerFactory.createBroker(configURI);
        brokers.add(broker);
        broker.start();
        if (!broker.waitUntilStarted()) {
            throw new Exception(broker.getStartException());
        }
    }

    /**
 
View Full Code Here


        TransportConnector tcp = broker.addConnector("tcp://localhost:0?transport.closeAsync=false");
        String group = "GR-" +  System.currentTimeMillis();
        URI discoveryUri = new URI("multicast://default?group=" + group);
        tcp.setDiscoveryUri(discoveryUri);
        broker.start();
        broker.waitUntilStarted();

        Vector<String> existingNames = new Vector<String>();
        Thread[] threads = getThreads();
        for (Thread t : threads) {
            existingNames.add(t.getName());
View Full Code Here

    }

    protected BrokerService createBroker() throws Exception {
        BrokerService broker = BrokerFactory.createBroker(new URI("broker:()/localhost?persistent=false"));
        broker.start();
        broker.waitUntilStarted();
        return broker;
    }

    @Override
    protected ActiveMQConnectionFactory createConnectionFactory() throws Exception {
View Full Code Here

        stompUri = broker.addConnector("stomp://localhost:0").getPublishableConnectString();
        wsUri = broker.addConnector(getWSConnectorURI()).getPublishableConnectString();
        broker.setDeleteAllMessagesOnStartup(deleteMessages);
        broker.start();
        broker.waitUntilStarted();

        return broker;
    }

    protected String getWSConnectorURI() {
View Full Code Here

public class CustomLockerTest extends TestCase {

    public void testCustomLocker() throws Exception {
        BrokerService broker = BrokerFactory.createBroker("xbean:org/apache/activemq/store/kahadb/shared.xml");
        broker.waitUntilStarted();
        broker.stop();
        broker.waitUntilStopped();
    }
}
View Full Code Here

        BrokerService broker = createBroker(new URI("broker:(tcp://localhost:61616)/BrokerA?persistent=true&useJmx=false"));
        broker.setBrokerId("BrokerA");
        NetworkConnector aTOb = bridgeBrokers(brokers.get("BrokerA").broker, brokers.get("BrokerB").broker, false, 2, true, true);
        aTOb.addStaticallyIncludedDestination(queue);
        broker.start();
        broker.waitUntilStarted();
        waitForBridgeFormation();
    }

}
View Full Code Here

            }
            //TODO deal with multiple brokers


            broker.start();
            broker.waitUntilStarted();
            brokers.put(pid, broker);


        } catch (Exception e) {
            throw new ConfigurationException(null, "Cannot start the broker", e);
View Full Code Here

    public void testCloseSendConnection() throws Exception {
        String brokerName = "closeSend";
        BrokerService broker = BrokerFactory.createBroker(new URI("broker:(tcp://localhost:0)/" + brokerName));
        broker.start();
        broker.waitUntilStarted();
        ActiveMQXAConnectionFactory cf = new ActiveMQXAConnectionFactory(broker.getTransportConnectors().get(0).getConnectUri());
        XAConnection connection = (XAConnection)cf.createConnection();
        connection.start();
        XASession session = connection.createXASession();
        XAResource resource = session.getXAResource();
View Full Code Here

        broker.setBrokerName("localhost");
        broker.setUseJmx(false);
        broker.setDeleteAllMessagesOnStartup(true);
        broker.addConnector("vm://localhost");
        broker.start();
        broker.waitUntilStarted();
        return broker;
    }
}
View Full Code Here

        policyMap.setDefaultEntry(defaultPolicy);
        broker.setDestinationPolicy(policyMap);
        broker.setDeleteAllMessagesOnStartup(deleteAllMessages);
        broker.addConnector("tcp://localhost:61616");
        broker.start();
        broker.waitUntilStarted();
        return broker;
    }

    protected DestinationViewMBean createView(ActiveMQDestination destination) throws Exception {
        String domain = "org.apache.activemq";
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.