Package org.codehaus.activemq

Examples of org.codehaus.activemq.ActiveMQConnectionFactory.createConnection()


    }

    private void initializeRemote() throws JMSException {
        ActiveMQConnectionFactory factory = new ActiveMQConnectionFactory(remoteUserName, remotePassword, uri);
        factory.setUseAsyncSend(true);
        remoteConnection = (ActiveMQConnection) factory.createConnection();
        remoteConnection.setClientID(brokerContainer.getBroker().getBrokerName() + "_NetworkChannel");
        TransportChannel transportChannel = remoteConnection.getTransportChannel();
        if (transportChannel instanceof CompositeTransportChannel) {
            CompositeTransportChannel composite = (CompositeTransportChannel) transportChannel;
            composite.setMaximumRetries(maximumRetries);
View Full Code Here


    private void initializeLocal() throws JMSException {
        String brokerName = brokerContainer.getBroker().getBrokerName();
        ActiveMQConnectionFactory factory = new ActiveMQConnectionFactory("vm://" + brokerName);
        factory.setUseAsyncSend(true);
        factory.setBrokerName(brokerName);
        localConnection = (ActiveMQConnection) factory.createConnection();
        localConnection.start();
        BrokerInfo info = new BrokerInfo();
        info.setBrokerName(remoteBrokerName);
        info.setClusterName(remoteClusterName);
        localConnection.asyncSendPacket(info);
View Full Code Here

        return session;
    }

    protected Connection createConnection() throws JMSException, Exception {
        ActiveMQConnectionFactory connectionFactory = new ActiveMQConnectionFactory(user, pwd, url);
        return connectionFactory.createConnection();
    }

    protected void close(Connection connection, Session session) throws JMSException {
        // lets dump the stats
        dumpStats(connection);
View Full Code Here

        remoteBroker = new BrokerContainerImpl("remoteBroker");
        remoteBroker.addConnector(ActiveMQConnection.DEFAULT_URL);
        remoteBroker.start();
       
        ActiveMQConnectionFactory fac = new ActiveMQConnectionFactory("remote://" + URL + "?brokerName=receiver");
        consumerConnection = fac.createConnection();
        consumerConnection.setClientID(new IdGenerator().generateId());
        consumerConnection.start();
       
        fac = new ActiveMQConnectionFactory("remote://" + URL + "?brokerName=sender");
        producerConnection = fac.createConnection();
View Full Code Here

        consumerConnection = fac.createConnection();
        consumerConnection.setClientID(new IdGenerator().generateId());
        consumerConnection.start();
       
        fac = new ActiveMQConnectionFactory("remote://" + URL + "?brokerName=sender");
        producerConnection = fac.createConnection();
        producerConnection.start();
       
       
       
    }
View Full Code Here

   
   
    protected void setUp() throws Exception{
        started = new SynchronizedBoolean(false);
        ActiveMQConnectionFactory fac = new ActiveMQConnectionFactory("vm://localhost");
        connection = fac.createConnection();
        session = connection.createSession(false,Session.AUTO_ACKNOWLEDGE);
        destination = session.createTopic(destinationName);
        connection.start();
    }
   
View Full Code Here

   
   
    protected void setUp() throws Exception{
        started = new SynchronizedBoolean(false);
        ActiveMQConnectionFactory fac = new ActiveMQConnectionFactory("vm://localhost");
        connection = fac.createConnection();
        session = connection.createSession(false,Session.AUTO_ACKNOWLEDGE);
        destination = session.createTopic(destinationName);
        connection.start();
    }
   
View Full Code Here

        return session;
    }

    protected Connection createConnection() throws JMSException, Exception {
        ActiveMQConnectionFactory connectionFactory = new ActiveMQConnectionFactory(user, pwd, url);
        Connection connection = connectionFactory.createConnection();
        connection.start();
        return connection;
    }

    protected void close(Connection connection, Session session) throws JMSException {
View Full Code Here

            ActiveMQConnectionFactory factory = new ActiveMQConnectionFactory(remoteUserName, remotePassword, uri);
            factory.setTurboBoost(true);
            factory.setJ2EEcompliant(false);
            factory.setQuickClose(true);
            factory.setInternalConnection(true);
            remoteConnection = (ActiveMQConnection) factory.createConnection();           
            TransportChannel transportChannel = remoteConnection.getTransportChannel();
            if (transportChannel instanceof CompositeTransportChannel) {
                CompositeTransportChannel composite = (CompositeTransportChannel) transportChannel;
                composite.setMaximumRetries(maximumRetries);
                composite.setFailureSleepTime(reconnectSleepTime);
View Full Code Here

        factory.setTurboBoost(true);
        factory.setJ2EEcompliant(false);
        factory.setBrokerName(brokerName);
        factory.setQuickClose(true);
        factory.setInternalConnection(true);
        localConnection = (ActiveMQConnection) factory.createConnection();
        localConnection.start();
        BrokerInfo info = new BrokerInfo();
        info.setBrokerName(remoteBrokerName);
        info.setClusterName(remoteClusterName);
        localConnection.asyncSendPacket(info);
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.