Package org.apache.activemq.broker

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


        broker.setDedicatedTaskRunner(true);
        broker.setPersistent(false);
        broker.addConnector("tcp://localhost:61616");
        NetworkConnector networkConnector = broker.addNetworkConnector("static:(tcp://wrongHostname1:61617,tcp://wrongHostname2:61618)?useExponentialBackOff=false");
        networkConnector.setDuplex(true);
        broker.start();
       
        ActiveMQConnectionFactory cf = new ActiveMQConnectionFactory(new URI(VM_BROKER_URI));
        Connection connection = cf.createConnection("system", "manager");
        connection.start();
       
View Full Code Here


        broker = new BrokerService();
        broker.setSchedulerSupport(true);
        broker.setDedicatedTaskRunner(true);
        broker.setPersistent(false);
        broker.addConnector("tcp://localhost:61616?wireFormat.maxInactivityDuration=1000&wireFormat.maxInactivityDurationInitalDelay=1000");
        broker.start();

        cf = new ActiveMQConnectionFactory("tcp://localhost:61616?wireFormat.maxInactivityDuration=1000&wireFormat.maxInactivityDurationInitalDelay=1000");
        connection = cf.createConnection("system", "manager");
        connection.start();
        connection.close();
View Full Code Here

                network2.setNetworkTTL(3);
                network2.setPrefetchSize(networkBridgePrefetch);
                network2.setConduitSubscriptions(false);
                network2.setDecreaseNetworkConsumerPriority(false);
                network2.setDispatchAsync(false);
                brokerService2.start();
            }
            final ExecutorService pool = Executors.newSingleThreadExecutor();
            final ActiveMQConnectionFactory connectionFactory1 = new ActiveMQConnectionFactory(
                    "vm://one");
            final SingleConnectionFactory singleConnectionFactory1 = new SingleConnectionFactory(
View Full Code Here

        BrokerPlugin[] plugins = new BrokerPlugin[1];
        plugins[0] = new StatisticsBrokerPlugin();
        answer.setPlugins(plugins);
        answer.setDeleteAllMessagesOnStartup(true);
        answer.addConnector("tcp://localhost:0");
        answer.start();
        return answer;
    }
   
    protected BrokerService createBroker(String uri) throws Exception {
        LOG.info("Loading broker configuration from the classpath with URI: " + uri);
View Full Code Here

        TransportConnector transportConnector = new TransportConnector();
        transportConnector.setUri(new URI(BROKER_A1_BIND_ADDRESS));
        answer.addConnector(transportConnector);
        answer.setUseShutdownHook(false);

        answer.start();

        return answer;
    }

    protected BrokerService createBrokerA2() throws Exception {
View Full Code Here

        new Thread(new Runnable() {
            @Override
            public void run() {
                try {
                    answer.start();
                } catch (Exception e) {
                    e.printStackTrace();
                    fail("Failed to start broker");
                }
            }
View Full Code Here

        TransportConnector transportConnector = new TransportConnector();
        transportConnector.setUri(new URI(BROKER_B1_BIND_ADDRESS));
        answer.addConnector(transportConnector);
        answer.setUseShutdownHook(false);

        answer.start();

        return answer;
    }

    protected BrokerService createBrokerB2() throws Exception {
View Full Code Here

        new Thread(new Runnable() {
            @Override
            public void run() {
                try {
                    answer.start();
                } catch (Exception e) {
                    e.printStackTrace();
                    fail("Failed to start broker");
                }
            }
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

        BrokerService broker = new BrokerService();
        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) {
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.