Package org.apache.activemq

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


    }

    @Test
    public void testCompositeSendDenied() 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.createQueue("TEST.FOO,ADMIN.FOO");

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


    }

    @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

        b.start();

        ActiveMQConnectionFactory connectionFactory = new ActiveMQConnectionFactory("tcp://localhost:" + (portBase + 0));
        connectionFactory.setWatchTopicAdvisories(false);

        QueueConnection c1 = connectionFactory.createQueueConnection();
        QueueConnection c2 = connectionFactory.createQueueConnection();
        QueueConnection c3 = connectionFactory.createQueueConnection();

        c1.start();
        c2.start();
View Full Code Here

        ActiveMQConnectionFactory connectionFactory = new ActiveMQConnectionFactory("tcp://localhost:" + (portBase + 0));
        connectionFactory.setWatchTopicAdvisories(false);

        QueueConnection c1 = connectionFactory.createQueueConnection();
        QueueConnection c2 = connectionFactory.createQueueConnection();
        QueueConnection c3 = connectionFactory.createQueueConnection();

        c1.start();
        c2.start();
        c3.start();
View Full Code Here

        ActiveMQConnectionFactory connectionFactory = new ActiveMQConnectionFactory("tcp://localhost:" + (portBase + 0));
        connectionFactory.setWatchTopicAdvisories(false);

        QueueConnection c1 = connectionFactory.createQueueConnection();
        QueueConnection c2 = connectionFactory.createQueueConnection();
        QueueConnection c3 = connectionFactory.createQueueConnection();

        c1.start();
        c2.start();
        c3.start();
View Full Code Here

    private void startConsumer(String brokerName, ActiveMQDestination destination) throws Exception {
        int id = Integer.parseInt(brokerName.substring(1));
        ActiveMQConnectionFactory connectionFactory = new ActiveMQConnectionFactory("tcp://localhost:" + (portBase + id));
        connectionFactory.setWatchTopicAdvisories(false);
        QueueConnection queueConnection = connectionFactory.createQueueConnection();
        queueConnection.start();

        queueConnection.createQueueSession(false, Session.AUTO_ACKNOWLEDGE).createConsumer(destination);
        queueConnection.close();
    }
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

        List<ConsumerState> consumerStates = new LinkedList<ConsumerState>();
        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(false, Session.AUTO_ACKNOWLEDGE);

            ActiveMQQueue destination = new ActiveMQQueue("GW." + id);
View Full Code Here

                @Override
                public void run() {
                    try {
                        ActiveMQConnectionFactory connectionFactory = new ActiveMQConnectionFactory("failover:(tcp://localhost:" + (portBase + id) + ")");
                        connectionFactory.setWatchTopicAdvisories(false);
                        QueueConnection queueConnection = connectionFactory.createQueueConnection();
                        queueConnection.start();
                        QueueSession queueSession = queueConnection.createQueueSession(false, Session.AUTO_ACKNOWLEDGE);
                        MessageProducer producer = queueSession.createProducer(null);
                        int val = 0;
                        while ((val = toSend.decrementAndGet()) >= 0) {
View Full Code Here

    }

    @Test
    public void testSendReceive() 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();
        Destination queue = sess.createQueue("TEST.FOO");

        MessageProducer producer = sess.createProducer(queue);
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.