Package org.activemq

Examples of org.activemq.ActiveMQConnectionFactory


    /**
     * @param activationSpec
     */
    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
     */
    synchronized private ActiveMQConnectionFactory getConnectionFactory() {
        if (connectionFactory == null) {
            connectionFactory = new ActiveMQConnectionFactory(info.getServerUrl());
        }
        return connectionFactory;
    }
View Full Code Here

    private SynchronizedBoolean started;
   
   
    protected void setUp() throws Exception{
        started = new SynchronizedBoolean(false);
        fac = new ActiveMQConnectionFactory("vm://localhost");
        connection = fac.createConnection();
        connection.start();
    }
View Full Code Here

        receiveBroker = new BrokerContainerImpl("receiver");
        receiveBroker.addConnector("tcp://localhost:61616");
        receiveBroker.setPersistenceAdapter(createPersistenceAdapter());
        receiveBroker.start();

        ActiveMQConnectionFactory factory = new ActiveMQConnectionFactory(receiveBroker, "tcp://localhost:61616");
        return factory;
    }
View Full Code Here

        ActiveMQConnectionFactory factory = new ActiveMQConnectionFactory(receiveBroker, "tcp://localhost:61616");
        return factory;
    }

    protected ActiveMQConnectionFactory createEmbeddedRemoteBrokerConnectionFactory() throws JMSException {
        ActiveMQConnectionFactory connectionFactory = new ActiveMQConnectionFactory();
        connectionFactory.setUseEmbeddedBroker(true);
        connectionFactory.setBrokerContainerFactory(new SpringBrokerContainerFactory(new ClassPathResource("org/activemq/usecases/EmbeddedRemoteConnector.xml")));

        return connectionFactory;
    }
View Full Code Here

        return connectionFactory;
    }

    public void testSendFromEmbeddedRemote() throws Exception {

        ActiveMQConnectionFactory embeddedRemoteFactory = createEmbeddedRemoteBrokerConnectionFactory();
        Connection conn = embeddedRemoteFactory.createConnection();
        Session session = conn.createSession(false, Session.AUTO_ACKNOWLEDGE);
        Destination destination = session.createQueue(subject);
        MessageProducer producer = session.createProducer(destination);
        producer.setDeliveryMode(DeliveryMode.PERSISTENT);
View Full Code Here

           System.out.println("Sending   " + message.getText());
        }
    }   

    public void testReceiver() throws Exception {
        ActiveMQConnectionFactory receiveFactory = createReceiverConnectionFactory();
        Connection conn = receiveFactory.createConnection();
       
        Session session = conn.createSession(false, Session.AUTO_ACKNOWLEDGE);
        Destination destination = session.createQueue(subject);
        MessageConsumer consumer = session.createConsumer(destination);
        conn.start();
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("receiver");
        consumerConnection.start();
       
        fac = new ActiveMQConnectionFactory("remote://" + URL + "?brokerName=sender");
        producerConnection = fac.createConnection();
        producerConnection.start();
       
       
       
       
View Full Code Here

    private SynchronizedBoolean started;
   
   
    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

    private SynchronizedBoolean started;
   
   
    protected void setUp() throws Exception{
        started = new SynchronizedBoolean(false);
        fac = new ActiveMQConnectionFactory("vm://localhost");
        connection = fac.createConnection();
        connection.start();
    }
View Full Code Here

TOP

Related Classes of org.activemq.ActiveMQConnectionFactory

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.