Package org.apache.activemq

Examples of org.apache.activemq.ActiveMQConnectionFactory.createQueueConnection()


    }

    @Test
    public void testTempDestinations() throws Exception {
        ActiveMQConnectionFactory factory = new ActiveMQConnectionFactory("tcp://localhost:61616");
        Connection conn = factory.createQueueConnection("jdoe", "sunflower");
        Session sess = conn.createSession(false, Session.AUTO_ACKNOWLEDGE);
        conn.start();
        Queue queue = sess.createTemporaryQueue();

        MessageProducer producer = sess.createProducer(queue);
View Full Code Here


    }

    public void testTryToReproduceNullPointerBug() throws Exception {
        String url = bindAddress;
        ActiveMQConnectionFactory factory = new ActiveMQConnectionFactory(url);
        QueueConnection queueConnection = factory.createQueueConnection();
        this.connection = queueConnection;
        QueueSession session = queueConnection.createQueueSession(false, Session.AUTO_ACKNOWLEDGE);
        session.createSender(null); // Unidentified
        Queue receiverQueue = session.createTemporaryQueue();
        session.createReceiver(receiverQueue);
View Full Code Here

        assertTrue("Unexpected count: " + count, count.get() == number);
    }

    protected QueueConnection createConnection() throws Exception {
        ActiveMQConnectionFactory factory = createConnectionFactory();
        return factory.createQueueConnection();
    }

    protected ActiveMQConnectionFactory createConnectionFactory() throws Exception {
        return new ActiveMQConnectionFactory(bindAddress);
    }
View Full Code Here

        requestor = new QueueRequestor(session, theQueue);
    }

    protected void createConnections() throws JMSException {
        ActiveMQConnectionFactory fac = (ActiveMQConnectionFactory)context.getBean("localFactory");
        localConnection = fac.createQueueConnection();
        localConnection.start();

        fac = (ActiveMQConnectionFactory)context.getBean("remoteFactory");
        remoteConnection = fac.createQueueConnection();
        remoteConnection.start();
View Full Code Here

        ActiveMQConnectionFactory fac = (ActiveMQConnectionFactory)context.getBean("localFactory");
        localConnection = fac.createQueueConnection();
        localConnection.start();

        fac = (ActiveMQConnectionFactory)context.getBean("remoteFactory");
        remoteConnection = fac.createQueueConnection();
        remoteConnection.start();
    }

    protected AbstractApplicationContext createApplicationContext() {
        return new ClassPathXmlApplicationContext("org/apache/activemq/network/jms/queue-config.xml");
View Full Code Here

    }

    public void testTryToReproduceNullPointerBug() throws Exception {
        String url = bindAddress;
        ActiveMQConnectionFactory factory = new ActiveMQConnectionFactory(url);
        QueueConnection queueConnection = factory.createQueueConnection();
        this.connection = queueConnection;
        QueueSession session = queueConnection.createQueueSession(false, Session.AUTO_ACKNOWLEDGE);
        QueueSender sender = session.createSender(null); //Unidentified
        Queue receiverQueue = session.createTemporaryQueue();
        QueueReceiver receiver = session.createReceiver(receiverQueue);
View Full Code Here

        assertTrue("Unexpected count: " + count, count.get() == NUMBER);
    }

    protected QueueConnection createConnection() throws Exception {
        ActiveMQConnectionFactory factory = createConnectionFactory();
        return factory.createQueueConnection();
    }

    protected ActiveMQConnectionFactory createConnectionFactory() throws Exception {
        return new ActiveMQConnectionFactory(bindAddress);
    }
View Full Code Here

    }


    protected void createConnections() throws JMSException {
        ActiveMQConnectionFactory fac = (ActiveMQConnectionFactory) context.getBean("localFactory");
        localConnection = fac.createQueueConnection();
        localConnection.start();
       
        fac = (ActiveMQConnectionFactory) context.getBean("remoteFactory");
        remoteConnection = fac.createQueueConnection();
        remoteConnection.start();
View Full Code Here

        ActiveMQConnectionFactory fac = (ActiveMQConnectionFactory) context.getBean("localFactory");
        localConnection = fac.createQueueConnection();
        localConnection.start();
       
        fac = (ActiveMQConnectionFactory) context.getBean("remoteFactory");
        remoteConnection = fac.createQueueConnection();
        remoteConnection.start();
    }


    protected AbstractApplicationContext createApplicationContext() {
View Full Code Here

        for (int id = 0; id < nBrokers; id++) {
            ActiveMQConnectionFactory connectionFactory = new ActiveMQConnectionFactory("failover:(tcp://localhost:" + (portBase + id) + ")");
            connectionFactory.setWatchTopicAdvisories(false);

            QueueConnection queueConnection = connectionFactory.createQueueConnection();
            queueConnection.start();

            final QueueSession queueSession = queueConnection.createQueueSession(true, Session.SESSION_TRANSACTED);

            final MessageProducer producer = queueSession.createProducer(compositeQ);
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.