Examples of QueueingConsumer


Examples of com.rabbitmq.client.QueueingConsumer

            channel = connection.createChannel();
        }
    }

    public void testConsumeFail() throws IOException, InterruptedException {
        QueueingConsumer c = new QueueingConsumer(channel);
        Channel ch = connection.createChannel();
        try {
            ch.basicConsume(QUEUE, false, c);
        } catch (IOException e) {
            // Can't have ack mode
View Full Code Here

Examples of com.rabbitmq.client.QueueingConsumer

            checkShutdownSignal(AMQP.PRECONDITION_FAILED, e);
        }
    }

    public void testConsumeSuccess() throws IOException, InterruptedException {
        QueueingConsumer c = new QueueingConsumer(channel);
        String ctag = channel.basicConsume(QUEUE, true, c);
        channel.basicCancel(ctag);

        String ctag2 = channel.basicConsume(QUEUE, true, c);
        channel.basicCancel(ctag2);
View Full Code Here

Examples of com.rabbitmq.client.QueueingConsumer

            }
        });
    }

    private void testPrefetch(Closure closure) throws IOException {
        QueueingConsumer c = new QueueingConsumer(channel);
        publish(q, 15);
        consume(c, 5, false);
        List<Delivery> deliveries = drain(c, 5);

        ack(channel.basicGet(q, false), false);
View Full Code Here

Examples of com.rabbitmq.client.QueueingConsumer

        closure.makeMore(deliveries);
        drain(c, 5);
    }

    public void testPrefetchOnEmpty() throws IOException {
        QueueingConsumer c = new QueueingConsumer(channel);
        publish(q, 5);
        consume(c, 10, false);
        drain(c, 5);
        publish(q, 10);
        drain(c, 5);
View Full Code Here

Examples of com.rabbitmq.client.QueueingConsumer

        publish(q, 10);
        drain(c, 5);
    }

    public void testAutoAckIgnoresPrefetch() throws IOException {
        QueueingConsumer c = new QueueingConsumer(channel);
        publish(q, 10);
        consume(c, 1, true);
        drain(c, 10);
    }
View Full Code Here

Examples of com.rabbitmq.client.QueueingConsumer

        consume(c, 1, true);
        drain(c, 10);
    }

    public void testPrefetchZeroMeansInfinity() throws IOException {
        QueueingConsumer c = new QueueingConsumer(channel);
        publish(q, 10);
        consume(c, 0, false);
        drain(c, 10);
    }
View Full Code Here

Examples of com.rabbitmq.client.QueueingConsumer

        basicPublishVolatile(m2, q);

        long tag1 = checkDelivery(channel.basicGet(q, false), m1, false);
        long tag2 = checkDelivery(channel.basicGet(q, false), m2, false);

        QueueingConsumer c = new QueueingConsumer(secondaryChannel);
        String consumerTag = secondaryChannel.basicConsume(q, false, c);

        // requeue
        channel.basicNack(tag2, false, true);

        long tag3 = checkDelivery(c.nextDelivery(), m2, true);
        secondaryChannel.basicCancel(consumerTag);

        // no requeue
        secondaryChannel.basicNack(tag3, false, false);
View Full Code Here

Examples of com.rabbitmq.client.QueueingConsumer

        long tag2 = checkDelivery(channel.basicGet(q, false), m4, false);

        // ack, leaving a gap in un-acked sequence
        channel.basicAck(tag1, false);

        QueueingConsumer c = new QueueingConsumer(secondaryChannel);
        String consumerTag = secondaryChannel.basicConsume(q, false, c);

        // requeue multi
        channel.basicNack(tag2, true, true);
View Full Code Here

Examples of com.rabbitmq.client.QueueingConsumer

        checkDelivery(channel.basicGet(q, false), m2, false);

        // nack all
        channel.basicNack(0, true, true);

        QueueingConsumer c = new QueueingConsumer(secondaryChannel);
        String consumerTag = secondaryChannel.basicConsume(q, true, c);

        checkDeliveries(c, m1, m2);

        secondaryChannel.basicCancel(consumerTag);
View Full Code Here

Examples of com.rabbitmq.client.QueueingConsumer

    public void testNoRequeueOnCancel()
        throws IOException, InterruptedException
    {
        channel.basicPublish("", Q, null, "1".getBytes());

        QueueingConsumer c;

        c = new QueueingConsumer(channel);
        String consumerTag = channel.basicConsume(Q, false, c);
        c.nextDelivery();
        channel.basicCancel(consumerTag);

        assertNull(channel.basicGet(Q, true));

        closeChannel();
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.