Examples of nextDelivery()


Examples of com.rabbitmq.client.QueueingConsumer.nextDelivery()

            channel.basicConsume(queueName, true, consumer);

            for (;;) {

                //  Get next request
                String msg = consumer.nextDelivery().getBody().toString();
                System.out.println (msg);
            }
        } catch (Exception e) {
            System.err.println("Main thread caught exception: " + e);
            e.printStackTrace();
View Full Code Here

Examples of com.rabbitmq.client.QueueingConsumer.nextDelivery()

   
    QueueingConsumer consumer = new QueueingConsumer(channel);
    channel.basicConsume(TASK_QUEUE_NAME, false, consumer);
   
    while (true) {
      QueueingConsumer.Delivery delivery = consumer.nextDelivery();
      String message = new String(delivery.getBody());
     
      System.out.println(" [x] Received '" + message + "'");
      doWork(message);
      System.out.println(" [x] Done");
View Full Code Here

Examples of com.rabbitmq.client.QueueingConsumer.nextDelivery()

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

    while (true) {
      QueueingConsumer.Delivery delivery = consumer.nextDelivery();
      String message = new String(delivery.getBody());
      String routingKey = delivery.getEnvelope().getRoutingKey();

      System.out.println(" [x] Received '" + routingKey + "':'" + message + "'");  
    }
View Full Code Here

Examples of com.rabbitmq.client.QueueingConsumer.nextDelivery()

      System.out.println(" [x] Awaiting RPC requests");
 
      while (true) {
        String response = null;
       
        QueueingConsumer.Delivery delivery = consumer.nextDelivery();
       
        BasicProperties props = delivery.getProperties();
        BasicProperties replyProps = new BasicProperties
                                         .Builder()
                                         .correlationId(props.getCorrelationId())
View Full Code Here

Examples of com.rabbitmq.client.QueueingConsumer.nextDelivery()

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

      while (true) {
        QueueingConsumer.Delivery delivery = consumer.nextDelivery();
        String message = new String(delivery.getBody());
        String routingKey = delivery.getEnvelope().getRoutingKey();

        System.out.println(" [x] Received '" + routingKey + "':'" + message + "'");  
      }
View Full Code Here

Examples of com.rabbitmq.client.QueueingConsumer.nextDelivery()

   
    QueueingConsumer consumer = new QueueingConsumer(channel);
    channel.basicConsume(QUEUE_NAME, true, consumer);
   
    while (true) {
      QueueingConsumer.Delivery delivery = consumer.nextDelivery();
      String message = new String(delivery.getBody());
      System.out.println(" [x] Received '" + message + "'");
    }
  }
}
View Full Code Here

Examples of com.rabbitmq.client.QueueingConsumer.nextDelivery()

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

      while (true) {
        QueueingConsumer.Delivery delivery = consumer.nextDelivery();
        String message = new String(delivery.getBody());
        String routingKeyFromSender = delivery.getEnvelope().getRoutingKey();

        System.out.println(" [x] Received '" + routingKeyFromSender + "':'" + message + "'");  
      }
View Full Code Here

Examples of com.rabbitmq.client.QueueingConsumer.nextDelivery()

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

    while (true) {
      QueueingConsumer.Delivery delivery = consumer.nextDelivery();
      String message = new String(delivery.getBody());

      System.out.println(" [x] Received '" + message + "'");  
    }
  }
View Full Code Here

Examples of com.rabbitmq.client.QueueingConsumer.nextDelivery()

            ch.queueDeclare(queueName, false, false, false, null);

            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);
View Full Code Here

Examples of com.rabbitmq.client.QueueingConsumer.nextDelivery()

    for(int i = 0; i < THREADS; i++){
      new Thread(){
        @Override public void run(){
          try {
            while(true){
                c.nextDelivery();
            }
          } catch (ShutdownSignalException sig) {
              count.decrementAndGet();
          } catch (Exception e) {
            throw new RuntimeException(e);
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.