Package org.apache.activemq.broker

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


    public void testRollbackXaErrorCode() throws Exception {
        String brokerName = "rollbackErrorCode";
        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


    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

    }

    public void testSlaveStopped(final boolean lease) throws Exception {
        final BrokerService master = createBroker("master", true, lease, false);
        master.start();
        master.waitUntilStarted();

        final AtomicReference<BrokerService> slave = new AtomicReference<BrokerService>();

        Thread slaveThread = new Thread() {
            public void run() {
View Full Code Here

    public void testDeleteAllMessages() throws Exception {
        BrokerService broker = createBrokerService();
        broker.getPersistenceAdapter().deleteAllMessages();
        broker.setUseJmx(false);
        broker.start();
        broker.waitUntilStarted();
        broker.stop();
        broker.waitUntilStopped();
    }

    /**
 
View Full Code Here

    private void doSendConsume(boolean transacted) throws Exception {

        BrokerService broker = createBrokerService();
        broker.setUseJmx(false);
        broker.start();
        broker.waitUntilStarted();

        ActiveMQConnectionFactory cf = new ActiveMQConnectionFactory(new URI("vm:" + BROKER_NAME));
        ActiveMQConnection c1 = (ActiveMQConnection) cf.createConnection();
        c1.start();
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

        broker.setSslContext(context);

        broker.addConnector(getWSConnectorURI()).setName("ws+mqtt");;
        broker.setDeleteAllMessagesOnStartup(deleteMessages);
        broker.start();
        broker.waitUntilStarted();

        return broker;
    }

    protected String getWSConnectorURI() {
View Full Code Here

            JobSchedulerStoreImpl scheduler = new JobSchedulerStoreImpl();
            scheduler.setDirectory(testDir);
            scheduler.setJournalMaxFileLength(1024 * 1024);
            BrokerService broker = createBroker(scheduler);
            broker.start();
            broker.waitUntilStarted();

            final AtomicInteger count = new AtomicInteger();
            Connection connection = cf.createConnection();

            Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
View Full Code Here

            brokerContext.setConfigurationUrl(resource.getURL().toExternalForm());
            brokerContext.setApplicationContext(ctx);
            broker.setBrokerContext(brokerContext);

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

        PolicyMap pMap = new PolicyMap();
        pMap.setDefaultEntry(policy);
        broker.setDestinationPolicy(pMap);

        broker.start();
        broker.waitUntilStarted();

        return broker;
    }

    /**
 
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.