Examples of basicAck()


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

                                    delta));
                startTime = System.currentTimeMillis();
            }
            chan.basicPublish("", q, props, body);
            QueueingConsumer.Delivery d = consumer.nextDelivery();
            chan.basicAck(d.getEnvelope().getDeliveryTag(), false);
        }
        System.out.println();

        trace("Switching QOS to unlimited");
        chan.basicQos(0);
View Full Code Here

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

        chan.basicQos(0);

        trace("Draining backlog");
        for (int i = 0; i < backlogSize; i++) {
            QueueingConsumer.Delivery d = consumer.nextDelivery();
            chan.basicAck(d.getEnvelope().getDeliveryTag(), false);
        }

        redeclare(q, chan);

        trace("Closing connection");
View Full Code Here

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

                                    delta));
                startTime = System.currentTimeMillis();
            }
            chan.basicPublish("", q, props, body);
            QueueingConsumer.Delivery d = consumer.nextDelivery();
            chan.basicAck(d.getEnvelope().getDeliveryTag(), false);
        }
        System.out.println();

        trace("Switching QOS to unlimited");
        chan.basicQos(0);
View Full Code Here

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

        chan.basicQos(0);

        trace("Draining backlog");
        for (int i = 0; i < backlogSize; i++) {
            QueueingConsumer.Delivery d = consumer.nextDelivery();
            chan.basicAck(d.getEnvelope().getDeliveryTag(), false);
        }

        redeclare(q, chan);

        trace("Closing connection");
View Full Code Here

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

        FileOutputStream o = new FileOutputStream(f);
        o.write(body);
        o.close();
        System.out.println(" done.");
    }
    ch.basicAck(delivery.getEnvelope().getDeliveryTag(), false);
            }
        } catch (Exception ex) {
            System.err.println("Main thread caught exception: " + ex);
            ex.printStackTrace();
            System.exit(1);
View Full Code Here

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

            QueueingConsumer consumer = new QueueingConsumer(ch);
            ch.basicConsume(queueName, consumer);
            while (true) {
                QueueingConsumer.Delivery delivery = consumer.nextDelivery();
                System.out.println("Message: " + new String(delivery.getBody()));
                ch.basicAck(delivery.getEnvelope().getDeliveryTag(), false);
            }
        } catch (Exception ex) {
            System.err.println("Main thread caught exception: " + ex);
            ex.printStackTrace();
            System.exit(1);
View Full Code Here

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

            channel.basicConsume(queue, consumer);
            while (true) {
                QueueingConsumer.Delivery delivery = consumer.nextDelivery();
                Envelope envelope = delivery.getEnvelope();
                System.out.println(envelope.getRoutingKey() + ": " + new String(delivery.getBody()));
                channel.basicAck(envelope.getDeliveryTag(), false);
            }
        } catch (Exception ex) {
            System.err.println("Main thread caught exception: " + ex);
            ex.printStackTrace();
            System.exit(1);
View Full Code Here

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

        GetResponse response = channel.basicGet(queue, false);
        if(response == null) {
            System.out.println("Got no message...");
        } else {
            System.out.println("Got message: " + new String(response.getBody()));
            channel.basicAck(response.getEnvelope().getDeliveryTag(), false);
        }
        channel.close();
        connection.close();
    }
}
View Full Code Here

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

         } catch (Throwable t) {
            logger.error("calling message listener failed", t);
            // discard and continue in non-debug mode
            AuAssert.unreachable();
         }
         channel.basicAck(delivery.getEnvelope().getDeliveryTag(), false);
      }

      try {
         channel.queueDelete(queueName);
      } catch (AlreadyClosedException e) {
View Full Code Here

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

        } finally {
          if (channel != null) {
            // Now tell Daddy everything is cool
            try {
              if (deliveryTag != null && channel.isOpen()) {
                channel.basicAck(deliveryTag, false);
              }
            } catch (Throwable e) {
              Logger.error(ExceptionUtil.getStackTrace("Error doing a basicAck for tag: " + deliveryTag, e));
            }
            try {
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.