Package org.apache.activemq.broker

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


    protected BrokerService createBroker() throws Exception {
        BrokerService answer = new BrokerService();
        configureBroker(answer);
        answer.start();
        answer.waitUntilStarted();
        bindAddress = answer.getTransportConnectors().get(0).getConnectUri().toString();
        return answer;
    }
   
    protected void configureBroker(BrokerService answer) throws Exception {
View Full Code Here


    protected void startAllBrokers() throws Exception {
        Collection<BrokerItem> brokerList = brokers.values();
        for (Iterator<BrokerItem> i = brokerList.iterator(); i.hasNext();) {
            BrokerService broker = i.next().broker;
            broker.start();
            broker.waitUntilStarted();
        }

        Thread.sleep(maxSetupTime);
    }
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

                    e.printStackTrace();
                }
            }
        });
        slave.start();
        slave.waitUntilStarted();
       
        master.waitUntilStarted();
       
        LOG.info("killing slave..");
        slave.stop();
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

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

        broker.setPersistent(false);
        broker.setUseJmx(false);
        broker.addConnector("vm://localhost");
       
        broker.start();
        broker.waitUntilStarted();
        return broker;
  }

  protected void tearDown() throws Exception {
    connection.stop();
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

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

    protected BrokerService createBroker() throws Exception {
        BrokerService answer = new BrokerService();
        configureBroker(answer);
        answer.start();
        answer.waitUntilStarted();
        return answer;
    }
   
    protected void configureBroker(BrokerService answer) throws Exception {
        PolicyEntry policy = new PolicyEntry();
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.