Package org.apache.activemq.broker

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


            LOG.info("Starting activemq at port " + mqport + " with data dir " + dataDir);

            BrokerService broker = new BrokerService();
            broker.setUseJmx(false);
            broker.setDataDirectory(dataDir);
            broker.addConnector("vm://localhost");
            broker.addConnector("tcp://0.0.0.0:" + mqport);
            broker.setSchedulerSupport(true);
            broker.start();
        }
View Full Code Here


            BrokerService broker = new BrokerService();
            broker.setUseJmx(false);
            broker.setDataDirectory(dataDir);
            broker.addConnector("vm://localhost");
            broker.addConnector("tcp://0.0.0.0:" + mqport);
            broker.setSchedulerSupport(true);
            broker.start();
        }

        boolean enableTLS = Boolean.valueOf(StartupProperties.get().getProperty("falcon.enableTLS",
View Full Code Here

        PolicyEntry defaultEntry = new PolicyEntry();
        defaultEntry.setMemoryLimit(1024*1024*4);
        policyMap.setDefaultEntry(defaultEntry);
        answer.setDestinationPolicy(policyMap);

        answer.addConnector(bindAddress);
        return answer;
    }

    protected void useConnection(Connection connection) throws Exception {
        connection.setClientID(clientID);
View Full Code Here

    protected BrokerService createBroker() throws Exception {
        BrokerService answer = new BrokerService();
        answer.setUseJmx(true);
        answer.setEnableStatistics(true);
        answer.addConnector(bindAddress);
        answer.setPersistenceAdapter(persistenceAdapter);
        answer.deleteAllMessages();
        return answer;
    }
View Full Code Here

    private void createMasterBroker() throws Exception {
        final BrokerService master = new BrokerService();
        master.setBrokerName("master");
        master.setPersistent(false);
        master.addConnector("tcp://localhost:0");

        KahaDBStore kaha = new KahaDBStore();
        kaha.setDirectory(new File("target/activemq-data/kahadb"));
        kaha.deleteAllMessages();
        master.setPersistenceAdapter(kaha);
View Full Code Here

        defaultPolicy.setMaxExpirePageSize(1200);
        PolicyMap policyMap = new PolicyMap();
        policyMap.setDefaultEntry(defaultPolicy);
        broker.setDestinationPolicy(policyMap);
        broker.setDeleteAllMessagesOnStartup(deleteAllMessages);
        broker.addConnector("tcp://localhost:0");
        broker.start();
        broker.waitUntilStarted();
        return broker;
    }
View Full Code Here

    public void testRemoveSubscriber() throws Exception {
        BrokerService broker = new BrokerService();
        broker.setPersistent(false);

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

        final String stompUri = broker.getConnectorByName("Stomp").getPublishableConnectString();
        final int stompPort = new URI(stompUri).getPort();
View Full Code Here

    public void testRemoveSubscriber() throws Exception {
        BrokerService broker = new BrokerService();
        broker.setPersistent(false);

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

        final String stompUri = broker.getConnectorByName("Stomp").getPublishableConnectString();
        final int stompPort = new URI(stompUri).getPort();
        final String openwireUri = broker.getConnectorByName("Default").getPublishableConnectString();
View Full Code Here

    protected BrokerService createBroker() throws Exception {
        BrokerService broker = BrokerFactory.createBroker(new URI("broker://()/localhost"));
        broker.setUseJmx(true);
        broker.setDeleteAllMessagesOnStartup(true);
        broker.addConnector("stomp://localhost:0?transport.closeAsync=false");

        File testDataDir = new File("target/activemq-data/StompVirtualTopicTest");
        broker.setDataDirectoryFile(testDataDir);
        KahaDBPersistenceAdapter persistenceAdapter = new KahaDBPersistenceAdapter();
        persistenceAdapter.setDirectory(new File(testDataDir, "kahadb"));
View Full Code Here

        LOG.debug(ThreadExplorer.show("threads at beginning"));
       
        BrokerService broker = new BrokerService();
        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));
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.