Package org.apache.activemq.util

Examples of org.apache.activemq.util.MessageIdList


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

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

        assertEquals(MESSAGE_COUNT * 3, msgsA.getMessageCount() + msgsB.getMessageCount() + msgsC.getMessageCount());
    }
View Full Code Here


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

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

        waitFor(new Condition() {
            public boolean isSatisified() {
                return msgsA.getMessageCount() == MESSAGE_COUNT;
            }
        });
       
        assertEquals(MESSAGE_COUNT * 3, msgsA.getMessageCount() + msgsB.getMessageCount() + msgsC.getMessageCount());
    }
View Full Code Here

        sendMessages("BrokerA", dest, messageCount);
    
        assertTrue(messagesReceived.await(30, TimeUnit.SECONDS));
       
        // Get message count
        MessageIdList msgsA = getConsumerMessages("BrokerA", clientA);
        assertEquals(messageCount, msgsA.getMessageCount());
    }
View Full Code Here

        sendMessages("BrokerB", dest, messageCount);

        assertTrue("messaged received within time limit", messagesReceived.await(30, TimeUnit.SECONDS));
       
        // Get message count
        MessageIdList msgsA = getConsumerMessages("BrokerA", clientA);
        assertEquals(messageCount, msgsA.getMessageCount());
    }
View Full Code Here

        // Let's try to wait for any messages.
        assertTrue(messagesReceived.await(30, TimeUnit.SECONDS));

        // Get message count
        MessageIdList msgs = getConsumerMessages("BrokerB", clientB);
       
        // see will any more arrive
        Thread.sleep(500);       
        assertEquals(messageCount/2, msgs.getMessageCount());
       
        // pick up the stuck messages
        messagesReceived = new CountDownLatch(messageCount/2);
        clientA = createConsumer("BrokerA", dest, messagesReceived);
        // Let's try to wait for any messages.
        assertTrue(messagesReceived.await(30, TimeUnit.SECONDS));
       
        msgs = getConsumerMessages("BrokerA", clientA);
        assertEquals(messageCount/2, msgs.getMessageCount());
    }
View Full Code Here

        CountDownLatch messagesReceived = new CountDownLatch(messageCount);
        MessageConsumer clientB = createConsumer("BrokerB", dest, messagesReceived);
      
        // make the consumer slow so that any network consumer has a chance, even
        // if it has a lower priority
        MessageIdList msgs = getConsumerMessages("BrokerB", clientB);
        msgs.setProcessingDelay(10);
       
        // ensure advisors have percolated
        Thread.sleep(2000);

        LOG.info("Close consumer on A");
        clientA.close();

        // ensure advisors have percolated
        Thread.sleep(2000);
      
        LOG.info("Send to B");
        sendMessages("BrokerB", dest, messageCount);

        // Let's try to wait for any messages.
        assertTrue("messages are received within limit", messagesReceived.await(60, TimeUnit.SECONDS));
        assertEquals(messageCount, msgs.getMessageCount());     
    }
View Full Code Here

        assertNull(getDestination(brokers.get("BrokerB").broker, virtualTopic));

        // send some messages
        sendMessages("BrokerA", virtualTopic, 1);

        MessageIdList msgsA = getConsumerMessages("BrokerA", clientA);
        MessageIdList msgsB = getConsumerMessages("BrokerB", clientB);

        msgsA.waitForMessagesToArrive(1);
        msgsB.waitForMessagesToArrive(1);

        // ensure we don't get any more messages
        Thread.sleep(2000);

        assertEquals(1, msgsA.getMessageCount());
        assertEquals(1, msgsB.getMessageCount());

    }
View Full Code Here

        assertNull(getDestination(brokers.get("BrokerB").broker, virtualTopic));

        // send some messages
        sendMessages("BrokerA", virtualTopic, 1);

        MessageIdList msgsA = getConsumerMessages("BrokerA", clientA);
        MessageIdList msgsB = getConsumerMessages("BrokerB", clientB);

        msgsA.waitForMessagesToArrive(1);
        msgsB.waitForMessagesToArrive(0);

        // ensure we don't get any more messages
        Thread.sleep(2000);

        assertEquals(1, msgsA.getMessageCount());
        assertEquals(0, msgsB.getMessageCount());
    }
View Full Code Here

        assertNotNull(getDestination(brokers.get("BrokerB").broker, virtualTopic));

        // send some messages
        sendMessages("BrokerA", virtualTopic, 1);

        MessageIdList msgsA = getConsumerMessages("BrokerA", clientA);
        MessageIdList msgsB = getConsumerMessages("BrokerB", clientB);

        msgsA.waitForMessagesToArrive(1);
        msgsB.waitForMessagesToArrive(1);

        // ensure we don't get any more messages
        Thread.sleep(2000);

        assertEquals(1, msgsA.getMessageCount());
        assertEquals(1, msgsB.getMessageCount());
    }
View Full Code Here

        sleep(600);

        // Send messages
        sendMessages(SPOKE, dest, MESSAGE_COUNT);

        MessageIdList msgs = getConsumerMessages(HUB, client);
        msgs.waitForMessagesToArrive(MESSAGE_COUNT);

        assertTrue("At least message " + MESSAGE_COUNT +
                " must be recieved, duplicates are expected, count=" + msgs.getMessageCount(),
                MESSAGE_COUNT <= msgs.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.