Package org.apache.activemq.broker

Examples of org.apache.activemq.broker.TransportConnector


        Transport transport = TransportFactory.connect(remoteConnector.getServer().getConnectURI());
        return transport;
    }
   
    protected TransportConnector createConnector() throws Exception, IOException, URISyntaxException {
        return new TransportConnector(TransportFactory.bind(new URI(getLocalURI())));
    }
View Full Code Here


    protected TransportConnector createConnector() throws Exception, IOException, URISyntaxException {
        return new TransportConnector(TransportFactory.bind(new URI(getLocalURI())));
    }
   
    protected TransportConnector createRemoteConnector() throws Exception, IOException, URISyntaxException {
        return new TransportConnector(TransportFactory.bind(new URI(getRemoteURI())));
    }
View Full Code Here

    @Override
    protected void setUp() throws Exception {
        broker = new BrokerService();
        broker.setPersistent(false);
        TransportConnector connector = broker.addConnector("tcp://localhost:0");
        broker.start();
        connectionUri = connector.getPublishableConnectString();
        factory = new ActiveMQConnectionFactory(connectionUri);
        pooledFactory = new PooledConnectionFactory(factory);
        pooledFactory.setMaxConnections(1);
        pooledFactory.setBlockIfSessionPoolIsFull(false);
    }
View Full Code Here

    }

    protected void addTransportConnector(BrokerService brokerService,
                                         String connectorName, String uri, boolean clustered)
            throws Exception {
        TransportConnector connector = brokerService.addConnector(uri);
        connector.setName(connectorName);
        if (clustered) {
            connector.setRebalanceClusterClients(true);
            connector.setUpdateClusterClients(true);
            connector.setUpdateClusterClientsOnRemove(true);
        } else {
            connector.setRebalanceClusterClients(false);
            connector.setUpdateClusterClients(false);
            connector.setUpdateClusterClientsOnRemove(false);
        }
    }
View Full Code Here

    protected void assertCreateConnection(String uri) throws Exception {
        // Start up a broker with a tcp connector.
        BrokerService broker = new BrokerService();
        broker.setPersistent(false);
        TransportConnector connector = broker.addConnector(uri);
        broker.start();

        URI temp = new URI(uri);
        // URI connectURI = connector.getServer().getConnectURI();
        // TODO this sometimes fails when using the actual local host name
        URI currentURI = connector.getServer().getConnectURI();

        // sometimes the actual host name doesn't work in this test case
        // e.g. on OS X so lets use the original details but just use the actual
        // port
        URI connectURI = new URI(temp.getScheme(), temp.getUserInfo(), temp.getHost(), currentURI.getPort(),
View Full Code Here

                try {
                    BrokerService broker = new BrokerService();
                    broker.setBrokerName("shared-slave");
                    configureSharedPersistenceAdapter(broker);
                    // add transport as a service so that it is bound on start, after store started               
                    final TransportConnector tConnector = new TransportConnector();
                    tConnector.setUri(new URI(brokerUrl));
                    broker.addConnector(tConnector);
                   
                    broker.start();
                    slave.set(broker);
                    slaveStarted.countDown();
View Full Code Here

     * @throws Exception
     * @throws IOException
     * @throws URISyntaxException
     */
    protected TransportConnector createRemoteConnector() throws Exception, IOException, URISyntaxException {
        return new TransportConnector(TransportFactory.bind(new URI(getRemoteURI())));
    }
View Full Code Here

     * @throws Exception
     * @throws IOException
     * @throws URISyntaxException
     */
    protected TransportConnector createConnector() throws Exception, IOException, URISyntaxException {
        return new TransportConnector(TransportFactory.bind(new URI(getLocalURI())));
    }
View Full Code Here

            if (transportConnectors.isEmpty()) {
                broker.addConnector(new URI(AUTO_ASSIGN_TRANSPORT));
                transportConnectors = broker.getTransportConnectors();
            }

            TransportConnector transport = transportConnectors.get(0);
            transport.setDiscoveryUri(new URI("multicast://default?group=" + groupName));
            NetworkConnector nc = broker.addNetworkConnector("multicast://default?group=" + groupName);
            nc.setNetworkTTL(ttl);
            nc.setSuppressDuplicateQueueSubscriptions(suppressduplicateQueueSubs);
            nc.setDecreaseNetworkConsumerPriority(decreasePriority);
        }
View Full Code Here

    @Override
    protected BrokerService createBroker() throws Exception {
        bindAddress = "tcp://localhost:0";
        BrokerService answer = new BrokerService();
        answer.setPersistent(isPersistent());
        TransportConnector connector = new TransportConnector();
        connector.setUri(new URI(bindAddress));
        connector.setDiscoveryUri(new URI("multicast://default?group=test"));
        answer.addConnector(connector);
        return answer;
    }
View Full Code Here

TOP

Related Classes of org.apache.activemq.broker.TransportConnector

Copyright © 2018 www.massapicom. 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.