Package org.apache.activemq.broker

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


        brokerA1 = slave;
        ExecutorService executor = Executors.newCachedThreadPool();
        executor.execute(new Runnable() {
            public void run() {
                try {
                    slave.start();
                } catch (Exception e) {
                    e.printStackTrace();
                    errors.add(e);
                }
            }
View Full Code Here


                    LOG.warn("Exception starting master: " + e);
                    e.printStackTrace();
                }
            }
        });
        slave.start();
        slave.waitUntilStarted();
       
        master.waitUntilStarted();
       
        LOG.info("killing slave..");
View Full Code Here

    private BrokerService createAndStartBroker(boolean deleteAll) throws Exception {
        BrokerService broker = new BrokerService();
        broker.setDeleteAllMessagesOnStartup(deleteAll);
        broker.setUseJmx(false);
        broker.getManagementContext().setCreateConnector(false);
        broker.start();
        return broker;
    }
}
View Full Code Here

        // the audit will suppress the duplicates as it defaults to true so this test
        // checking for dups will fail. it is good to have it on in practice.
        policy.setEnableAudit(false);
        policyMap.put(new ActiveMQTopic(TOPIC_NAME), policy);
        broker.setDestinationPolicy(policyMap);
        broker.start();
      
        return broker;
    }

    @Override
View Full Code Here

        BrokerService broker = new BrokerService();
        broker.setPersistent(false);

        broker.addConnector("stomp://localhost:61613").setName("Stomp");
        broker.addConnector("tcp://localhost:61616").setName("Default");
        broker.start();

        ActiveMQConnectionFactory factory = new ActiveMQConnectionFactory("tcp://localhost:61616");
        Connection connection = factory.createConnection();
        Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
        MessageProducer producer = session.createProducer(new ActiveMQQueue(getDestinationName()));
View Full Code Here

        FileOutputStream out = new FileOutputStream(updateFile);
        out.write(firstTcpUri.getBytes());
        out.close();

        BrokerService bs1 = createBroker("bs1", firstTcpUri);
        bs1.start();

        // no failover uri's to start with, must be read from file...
        ActiveMQConnectionFactory cf = new ActiveMQConnectionFactory("failover:()?updateURIsURL=file:///" + updateFile.getAbsoluteFile());
        connection = cf.createConnection();
        connection.start();
View Full Code Here

        BrokerService bs1 = new BrokerService();
        bs1.setUseJmx(false);
        TransportConnector transportConnector = bs1.addConnector(firstTcpUri);
        transportConnector.setUpdateClusterClients(true);
        bs1.start();

        ActiveMQConnectionFactory cf = new ActiveMQConnectionFactory("failover:(" + firstTcpUri + ")");
        Connection connection = cf.createConnection();
        connection.start();
        Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
View Full Code Here

        }
       
        BrokerService restartedBroker = createAndConfigureBroker(new URI("broker:(tcp://localhost:61616,stomp://localhost:61613)/BrokerA"));
        bridgeAndConfigureBrokers("BrokerA", "BrokerB");
        bridgeAndConfigureBrokers("BrokerA", "BrokerC");
        restartedBroker.start();
        waitForBridgeFormation();
       
        Thread.sleep(3000);

        assertEquals("Destination", 0, brokers.get("BrokerA").broker.getAdminView().getTemporaryQueues().length);
View Full Code Here

    @Test
    public void testBrokerStart() throws Exception {
        BrokerService broker = BrokerFactory.createBroker(new URI("broker:()/localhost?persistent=false&useJmx=false"));
        broker.addConnector(getBindLocation());
        broker.start();
        broker.waitUntilStarted();
        Thread.sleep(2000);
        //System.in.read();
        broker.stop();
        broker.waitUntilStopped();
View Full Code Here

    }

    protected BrokerService createBroker() throws Exception {
        BrokerService answer = new BrokerService();
        configureBroker(answer);
        answer.start();
        return answer;
    }

    protected void configureBroker(BrokerService answer) throws Exception {
        File dataFileDir = new File("target/test-amq-data/bugs/AMQ2356/kahadb");
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.