Package org.apache.activemq.util

Examples of org.apache.activemq.util.MessageIdList


        }

        // Get message count
        for (int i=1; i<=BROKER_COUNT; i++) {
            for (int j=0; j<CONSUMER_COUNT; j++) {
                MessageIdList msgs = getConsumerMessages("Broker" + i, (MessageConsumer)consumerMap.get("Consumer:" + i + ":" + j));
                msgs.waitForMessagesToArrive(BROKER_COUNT * PRODUCER_COUNT * MESSAGE_COUNT);
                assertEquals(BROKER_COUNT * PRODUCER_COUNT * MESSAGE_COUNT, msgs.getMessageCount());
            }
        }
    }
View Full Code Here


            Session session = connections[i].createSession(false, Session.AUTO_ACKNOWLEDGE);
            producers[i] = session.createProducer(destination);
            producers[i].setDeliveryMode(deliveryMode);
            MessageConsumer consumer = createMessageConsumer(session, destination);
            messageIdList[i] = new MessageIdList();
            consumer.setMessageListener(messageIdList[i]);
        }
       
        log.info("Waiting for cluster to be fully connected");
       
View Full Code Here

        connection = createConnection();
        connection.start();
        session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);

        MessageConsumer consumer = createConsumer();
        MessageIdList listener = new MessageIdList();
        consumer.setMessageListener(listener);
        listener.waitForMessagesToArrive(messageCount);
        listener.assertMessagesReceived(messageCount);

    }
View Full Code Here

    public void sendReceive(String dest1, boolean topic1, String dest2, boolean topic2, int send, int expected) throws Exception{
        MessageConsumer client = createConsumer("BrokerA", createDestination(dest2, topic2));
        Thread.sleep(1000);
        sendMessages("BrokerA", createDestination(dest1, topic1), send);
        MessageIdList msgs = getConsumerMessages("BrokerA", client);
        msgs.setMaximumDuration(1000);
        assertEquals(expected, msgs.getMessageCount());
        client.close();
        Thread.sleep(500);
    }
View Full Code Here

        // Setup consumers
        MessageConsumer clientB = createConsumer("B", destA);


        final long maxWait = 5 * 60 * 1000l;
        MessageIdList listA = getConsumerMessages("A", clientA);
        listA.setMaximumDuration(maxWait);
        listA.waitForMessagesToArrive(numMessages);

        MessageIdList listB = getConsumerMessages("B", clientB);
        listB.setMaximumDuration(maxWait);
        listB.waitForMessagesToArrive(numMessages);

        assertEquals("got all on A" + listA.getMessageCount(),
                numMessages, listA.getMessageCount());

        assertEquals("got all on B" + listB.getMessageCount(),
                numMessages, listB.getMessageCount());

    }
View Full Code Here

        // Let's try to wait for any messages. Should be none.
        Thread.sleep(1000);

        // Get message count
        MessageIdList msgsC = getConsumerMessages("BrokerC", clientC);
        assertEquals(0, msgsC.getMessageCount());
    }
View Full Code Here

        // Let's try to wait for any messages.
        Thread.sleep(1000);

        // Get message count
        MessageIdList msgsA = getConsumerMessages("BrokerA", clientA);
        MessageIdList msgsC = getConsumerMessages("BrokerC", clientC);

        // Total received should be 100
        assertEquals(MESSAGE_COUNT, msgsA.getMessageCount() + msgsC.getMessageCount());
    }
View Full Code Here

       
        // Let's try to wait for any messages.
        //Thread.sleep(1000);

        // Get message count
        MessageIdList msgsA = getConsumerMessages("BrokerA", clientA);
        MessageIdList msgsC = getConsumerMessages("BrokerC", clientC);
       
        // Total received should be 100
        assertEquals(MESSAGE_COUNT, msgsA.getMessageCount());
        assertEquals(MESSAGE_COUNT, msgsC.getMessageCount());
    }
View Full Code Here

       
        // Let's try to wait for any messages.
        Thread.sleep(1000);

        // Get message count
        MessageIdList msgsA = getConsumerMessages("BrokerA", clientA);
        MessageIdList msgsC = getConsumerMessages("BrokerC", clientC);
       
        // Total received should be 100
        assertEquals(MESSAGE_COUNT, msgsA.getMessageCount());
        assertEquals(MESSAGE_COUNT, msgsC.getMessageCount());
    }   
View Full Code Here

        // Send messages
        sendMessages("BrokerA", dest, MESSAGE_COUNT);
        sendMessages("BrokerC", dest, MESSAGE_COUNT);

        // Get message count
        MessageIdList msgsB = getConsumerMessages("BrokerB", clientB);

        msgsB.waitForMessagesToArrive(MESSAGE_COUNT * 2);

        assertEquals(MESSAGE_COUNT * 2, msgsB.getMessageCount());
    }
View Full Code Here

TOP

Related Classes of org.apache.activemq.util.MessageIdList

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.