Package org.activemq

Examples of org.activemq.ActiveMQConnectionFactory


        sendBroker = new BrokerContainerImpl("sender");
        sendBroker.addConnector("tcp://localhost:62001");
        sendBroker.addNetworkConnector("reliable:tcp://localhost:62002");
        sendBroker.start();

        ActiveMQConnectionFactory factory = new ActiveMQConnectionFactory(sendBroker, "tcp://localhost:62001");

        return factory;
    }
View Full Code Here


    protected Connection createSendConnection() throws JMSException {
        return sendFactory.createConnection();
    }

    protected ActiveMQConnectionFactory createConnectionFactory(String config, String brokerName, String connectUrl) throws JMSException {
        ActiveMQConnectionFactory factory = new ActiveMQConnectionFactory(connectUrl);
        factory.setBrokerName(brokerName);
        factory.setUseEmbeddedBroker(true);
        factory.setBrokerContainerFactory(new SpringBrokerContainerFactory(new ClassPathResource(config)));
        return factory;
    }
View Full Code Here

        // configuration of container and all protocolls
        BrokerContainerImpl container = createBroker();

        // start a client
        ActiveMQConnectionFactory factory = new
                ActiveMQConnectionFactory("tcp://localhost:9100");
        factory.start();
        factory.createConnection();

        // stop activemq broker
        container.stop();

        // start activemq broker again
        container = createBroker();

        // start a client again
        factory = new
                ActiveMQConnectionFactory("tcp://localhost:9100");
        factory.start();
        factory.createConnection();

        // stop activemq broker
        container.stop();

    }
View Full Code Here

* @version $Revision: 1.1.1.1 $
*/
public class ZeroconfDiscoveryTest extends TestCase {

    public void test1() throws Exception {
        ActiveMQConnectionFactory connectionFactory = new ActiveMQConnectionFactory("zeroconf:_activemq.broker.development.");

        // use an embedded broker configured via Spring
        connectionFactory.setUseEmbeddedBroker(true);
        connectionFactory.setBrokerContainerFactory(new SpringBrokerContainerFactory(new ClassPathResource("org/activemq/usecases/receiver-zeroconf.xml")));

        Connection connection = connectionFactory.createConnection();
        connection.setClientID("Producer1");
        connection.start();

        // now lets close things down
        connection.close();
View Full Code Here

* @version $Revision: 1.1 $
*/
public class EmberTopicSendReceiveTwoConnectionsTest extends JmsTopicSendReceiveWithTwoConnectionsTest {

    protected ActiveMQConnectionFactory createConnectionFactory() {
        ActiveMQConnectionFactory factory = new ActiveMQConnectionFactory();
        factory.setBrokerURL("nio://localhost:61618");
        factory.setUseEmbeddedBroker(true);
        return factory;
    }
View Full Code Here

* @version $Revision: 1.1 $
*/
public class EmberTopicSendReceiveTest extends JmsTopicSendReceiveTest {

    protected ActiveMQConnectionFactory createConnectionFactory() {
        ActiveMQConnectionFactory factory = new ActiveMQConnectionFactory();
        factory.setBrokerURL("nio://localhost:61801");
        factory.setUseEmbeddedBroker(true);
        return factory;
    }
View Full Code Here

            m_url = url;
        }

        protected void _initialize() throws JMSException {
            m_connection = new ActiveMQConnectionFactory(m_url).createConnection();
            m_connection.start();

            m_session = m_connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
            m_queue = m_session.createQueue(QUEUE_NAME);
        }
View Full Code Here

        container.addConnector(url);
        container.addNetworkConnector(new DiscoveryNetworkConnector(container));
        container.start();
        //embedded brokers are resolved by url - so make url unique
        //this confused me tests for a while :-)
        return new ActiveMQConnectionFactory(container,"vm://"+brokerName);
    }
View Full Code Here

* @version $Revision: 1.1 $
*/
public class JGroupsTopicSendReceiveTwoConnectionsTest extends JmsTopicSendReceiveWithTwoConnectionsTest {

    protected ActiveMQConnectionFactory createConnectionFactory() {
        ActiveMQConnectionFactory factory = new ActiveMQConnectionFactory();
        factory.setBrokerURL(JGroupsTransportChannelTest.config);
        return factory;

    }
View Full Code Here

* @version $Revision: 1.1 $
*/
public class JGroupsTopicSendReceiveTest extends JmsTopicSendReceiveWithTwoConnectionsTest {

    protected ActiveMQConnectionFactory createConnectionFactory() {
        ActiveMQConnectionFactory factory = new ActiveMQConnectionFactory();
        factory.setBrokerURL(JGroupsTransportChannelTest.config);
        return factory;

    }
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.