Examples of peekMessagesByKey()


Examples of com.netflix.astyanax.recipes.queue.ShardedDistributedMessageQueue.peekMessagesByKey()

            LOG.info("Key already exists");
        }

        // Confirm that the message is there
        Assert.assertEquals(1, queue.getMessageCount());
        printMessages("Pending messages after insert ORIG message", queue.peekMessagesByKey(key));

        // Consume the message
        LOG.info("*** Reading first message ***");
        final List<MessageContext> m1 = consumer.readMessages(10);
        printMessages("Consuming the ORIG message", m1);
View Full Code Here

Examples of com.netflix.astyanax.recipes.queue.ShardedDistributedMessageQueue.peekMessagesByKey()

        LOG.info("*** Reading first message ***");
        final List<MessageContext> m1 = consumer.readMessages(10);
        printMessages("Consuming the ORIG message", m1);
        Assert.assertEquals(1, m1.size());

        printMessages("Pending messages after consume ORIG " + key, queue.peekMessagesByKey(key));

        // Exceed the timeout
        Thread.sleep(2000);

        // Consume the timeout event
View Full Code Here

Examples of com.netflix.astyanax.recipes.queue.ShardedDistributedMessageQueue.peekMessagesByKey()

        LOG.info("*** Reading timeout message ***");
        final List<MessageContext> m2 = consumer.readMessages(10);
        printMessages("Consuming the TIMEOUT message", m2);
        Assert.assertEquals(1, m2.size());

        printMessages("Pending messages after consume TIMEOUT " + key, queue.peekMessagesByKey(key));
//        Assert.assertEquals(2, m2a.size());

        LOG.info("*** Acking both messages ***");
        consumer.ackMessages(m1);
        consumer.ackMessages(m2);
View Full Code Here

Examples of com.netflix.astyanax.recipes.queue.ShardedDistributedMessageQueue.peekMessagesByKey()

        LOG.info("*** Acking both messages ***");
        consumer.ackMessages(m1);
        consumer.ackMessages(m2);

        printMessages("Pending messages after both acks " + key, queue.peekMessagesByKey(key));
//        Assert.assertEquals(2, m2a.size());

        // Consume anything that is in the queue
        final List<MessageContext> m3 = consumer.readMessages(10);
        printMessages("Consuming messages", m3);
View Full Code Here

Examples of com.netflix.astyanax.recipes.queue.ShardedDistributedMessageQueue.peekMessagesByKey()

        // Consume anything that is in the queue
        final List<MessageContext> m3 = consumer.readMessages(10);
        printMessages("Consuming messages", m3);
        Assert.assertEquals(1, m3.size());

        printMessages("Pending messages after 2nd consume " + key, queue.peekMessagesByKey(key));

        consumer.ackMessages(m3);

        Thread.sleep(2000);
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.