Package org.activemq

Examples of org.activemq.ActiveMQConnectionFactory.createConnection()


            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

            if (embeddedBroker) {
                factory.setUseEmbeddedBroker(true);
            }

            factory.setTurboBoost(true);
            return factory.createConnection();
        }
    }

    /**
     * Creates a Destination object through Session using subject.
View Full Code Here

     * @see TestCase#setUp()
     */
    protected void setUp() throws Exception {
        super.setUp();
        ConnectionFactory fac = new ActiveMQConnectionFactory("vm://localhost");
        producerConnection = fac.createConnection();
        Session s = producerConnection.createSession(false, Session.AUTO_ACKNOWLEDGE);
        Destination dest = s.createTopic(getClass().getName());
        MessageProducer producer = s.createProducer(dest);
        consumerConnection = fac.createConnection();
        s = consumerConnection.createSession(false, Session.AUTO_ACKNOWLEDGE);
View Full Code Here

        ConnectionFactory fac = new ActiveMQConnectionFactory("vm://localhost");
        producerConnection = fac.createConnection();
        Session s = producerConnection.createSession(false, Session.AUTO_ACKNOWLEDGE);
        Destination dest = s.createTopic(getClass().getName());
        MessageProducer producer = s.createProducer(dest);
        consumerConnection = fac.createConnection();
        s = consumerConnection.createSession(false, Session.AUTO_ACKNOWLEDGE);
        MessageConsumer consumer = s.createConsumer(dest);
        consumerConnection.start();
        out = new DataOutputStream(new JMSOutputStream(producer));
        in = new DataInputStream(new JMSInputStream(consumer));
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

    }

    protected Connection createConnection() throws JMSException {
        System.err.println("creating connection ....");
        ActiveMQConnectionFactory fac = new ActiveMQConnectionFactory("peer://" + getClass().getName());
        return fac.createConnection();
    }

    protected Destination createDestination() {
        return createDestination(getClass().getName());
    }
View Full Code Here

        remoteBroker = new BrokerContainerImpl("remoteBroker");
        remoteBroker.addConnector(ActiveMQConnection.DEFAULT_BROKER_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

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.