Examples of basicConsume()


Examples of com.rabbitmq.client.Channel.basicConsume()

        channel.queueBind(completionQueue, exchangeName, "");

        LatencyExperimentConsumer callback = new LatencyExperimentConsumer(channel, queueName);
        callback._autoAck = this._autoAck;

        channel.basicConsume(queueName, _autoAck, callback);
        channel.basicConsume(completionQueue, true, "completion", callback);
        callback.report(_writeStats);

        System.out.println("Deleting test queue.");
        channel.queueDelete(queueName);
View Full Code Here

Examples of com.rabbitmq.client.Channel.basicConsume()

        LatencyExperimentConsumer callback = new LatencyExperimentConsumer(channel, queueName);
        callback._autoAck = this._autoAck;

        channel.basicConsume(queueName, _autoAck, callback);
        channel.basicConsume(completionQueue, true, "completion", callback);
        callback.report(_writeStats);

        System.out.println("Deleting test queue.");
        channel.queueDelete(queueName);
View Full Code Here

Examples of com.rabbitmq.client.Channel.basicConsume()

                    channel.basicPublish("", queueName,
                                         MessageProperties.BASIC, MESSAGE);
                }

                QueueingConsumer consumer = new QueueingConsumer(channel);
                channel.basicConsume(queueName, true, consumer);

                long publishTime = System.nanoTime() - start;

                start = System.nanoTime();
View Full Code Here

Examples of com.rabbitmq.client.Channel.basicConsume()

        QueueingConsumer c1 = new QueueingConsumer(ch1);
        QueueingConsumer c2 = new QueueingConsumer(ch2);
        String q1 = declareBindConsume(ch1, c1, false);
        String q2 = declareBindConsume(ch2, c2, false);
        ch1.basicConsume(q2, false, c1);
        ch2.basicConsume(q1, false, c2);
        ch1.basicQos(1);
        ch2.basicQos(1);
        fill(5);
        Queue<Delivery> d1 = drain(c1, 1);
        Queue<Delivery> d2 = drain(c2, 1);
View Full Code Here

Examples of com.rabbitmq.client.Channel.basicConsume()

                Channel ch = conn.createChannel();
                ch.queueDeclare(QUEUE_NAME, true, false, false, null);

                // Consume
                QueueingConsumer qc = new QueueingConsumer(ch);
                ch.basicConsume(QUEUE_NAME, true, qc);
                for (int i = 0; i < msgCount; ++i) {
                    qc.nextDelivery();
                }

                // Cleanup
View Full Code Here

Examples of com.rabbitmq.client.Channel.basicConsume()

                    channel.basicPublish("", queueName,
                                         MessageProperties.BASIC, MESSAGE);
                }

                QueueingConsumer consumer = new QueueingConsumer(channel);
                channel.basicConsume(queueName, true, consumer);

                long publishTime = System.nanoTime() - start;

                start = System.nanoTime();
View Full Code Here

Examples of com.rabbitmq.client.Channel.basicConsume()

        redeclare(q, chan);

        trace("Beginning plateau of " + repeatCount + " repeats, sampling every " + sampleGranularity + " messages");

        QueueingConsumer consumer = new QueueingConsumer(chan);
        chan.basicConsume(q, consumer);

        long startTime = System.currentTimeMillis();
        for (int i = 0; i < repeatCount; i++) {
            if (((i % sampleGranularity) == 0) && (i > 0)) {
                long now = System.currentTimeMillis();
View Full Code Here

Examples of com.rabbitmq.client.Channel.basicConsume()

  public void testNThreadShutdown() throws Exception{
    Channel channel = connection.createChannel();
    final QueueingConsumer c = new QueueingConsumer(channel);
    channel.queueDeclare(QUEUE, false, true, true, null);
    channel.basicConsume(QUEUE, c);
    final AtomicInteger count = new AtomicInteger(THREADS);
    final CountDownLatch latch = new CountDownLatch(THREADS);

    for(int i = 0; i < THREADS; i++){
      new Thread(){
View Full Code Here

Examples of com.rabbitmq.client.Channel.basicConsume()

            ConnectionFactory factory = new ConnectionFactory();
            factory.setUri(uri);
            Connection connection = factory.newConnection();
            final Channel ch = connection.createChannel();
            ch.queueDeclare(SERVER_QUEUE, false, true, false, null);
            ch.basicConsume(SERVER_QUEUE, true, new DefaultConsumer(ch) {
                @Override
                public void handleDelivery(String consumerTag, Envelope envelope, AMQP.BasicProperties properties, byte[] body) throws IOException {
                    String replyTo = properties.getReplyTo();
                    ch.basicPublish("", replyTo, MessageProperties.MINIMAL_BASIC, "Hello client!".getBytes());
                }
View Full Code Here

Examples of com.rabbitmq.client.Channel.basicConsume()

        channel.queueBind(completionQueue, exchangeName, "");

        LatencyExperimentConsumer callback = new LatencyExperimentConsumer(channel, queueName);
        callback._autoAck = this._autoAck;

        channel.basicConsume(queueName, _autoAck, callback);
        channel.basicConsume(completionQueue, true, "completion", callback);
        callback.report(_writeStats);

        System.out.println("Deleting test queue.");
        channel.queueDelete(queueName);
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.