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);
            ActiveMQConnection c = (ActiveMQConnection) factory.createConnection();

            c.getPrefetchPolicy().setQueuePrefetch(1000);
            c.getPrefetchPolicy().setQueueBrowserPrefetch(1000);
            c.getPrefetchPolicy().setTopicPrefetch(1000);
            c.getPrefetchPolicy().setDurableTopicPrefetch(1000);
View Full Code Here

        ActiveMQConnectionFactory connectionFactory = getConnectionFactory();

        String userName = info.getUserName();
        String password = info.getPassword();
        ActiveMQConnection physicalConnection = (ActiveMQConnection) connectionFactory.createConnection(userName, password);

        String clientId = info.getClientid();
        if (clientId != null) {
            physicalConnection.setClientID(clientId);
        }
View Full Code Here

     */
    public ActiveMQConnection makeConnection(ActiveMQActivationSpec activationSpec) throws JMSException {
        ActiveMQConnectionFactory connectionFactory = getConnectionFactory();
        String userName = defaultValue(activationSpec.getUserName(), info.getUserName());
        String password = defaultValue(activationSpec.getPassword(), info.getPassword());
        ActiveMQConnection physicalConnection = (ActiveMQConnection) connectionFactory.createConnection(userName, password);
        if (activationSpec.isDurableSubscription()) {
            physicalConnection.setClientID(activationSpec.getClientId());
        }
        return physicalConnection;
    }
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

    public void testTransaction() throws Exception {

        ActiveMQConnectionFactory factory = new ActiveMQConnectionFactory("vm://localhost");

        factory.setUseEmbeddedBroker(true);
        connection = factory.createConnection();
        queue = new ActiveMQQueue(getClass().getName() + "." + getName());

        producerSession = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
        consumerSession = connection.createSession(true, 0);
View Full Code Here

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

        factory.setTurboBoost(true);
        ActiveMQConnection c = (ActiveMQConnection) factory.createConnection();

        c.getPrefetchPolicy().setQueuePrefetch(1000);
        c.getPrefetchPolicy().setQueueBrowserPrefetch(1000);
        c.getPrefetchPolicy().setTopicPrefetch(1000);
        c.getPrefetchPolicy().setDurableTopicPrefetch(1000);
View Full Code Here

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

        factory.setTurboBoost(true);
        ActiveMQConnection c = (ActiveMQConnection) factory.createConnection();

        c.getPrefetchPolicy().setQueuePrefetch(1000);
        c.getPrefetchPolicy().setQueueBrowserPrefetch(1000);
        c.getPrefetchPolicy().setTopicPrefetch(1000);
        c.getPrefetchPolicy().setDurableTopicPrefetch(1000);
View Full Code Here

        ActiveMQConnectionFactory connectionFactory = getConnectionFactory();

        String userName = info.getUserName();
        String password = info.getPassword();
        ActiveMQConnection physicalConnection = (ActiveMQConnection) connectionFactory.createConnection(userName, password);

        String clientId = info.getClientid();
        if (clientId != null) {
            physicalConnection.setClientID(clientId);
        }
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.