Class QueueingConsumer

java.lang.Object
com.rabbitmq.client.DefaultConsumer
org.hobbit.core.rabbit.QueueingConsumer
All Implemented Interfaces:
com.rabbitmq.client.Consumer

public class QueueingConsumer extends com.rabbitmq.client.DefaultConsumer
This class extends the DefaultConsumer class with blocking semantics. The class provides a linked blocking queue of Delivery class to fetch the next delivery message.
Author:
Altaf & Sourabh
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    private LinkedBlockingQueue<com.rabbitmq.client.Delivery>
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    QueueingConsumer(com.rabbitmq.client.Channel channel)
     
    QueueingConsumer(com.rabbitmq.client.Channel channel, LinkedBlockingQueue<com.rabbitmq.client.Delivery> deliveryQueue)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    LinkedBlockingQueue<com.rabbitmq.client.Delivery>
     
    void
    handleDelivery(String consumerTag, com.rabbitmq.client.Envelope envelope, com.rabbitmq.client.AMQP.BasicProperties properties, byte[] body)
    Adds the delivery object to linked blocking queue for every receive

    Methods inherited from class com.rabbitmq.client.DefaultConsumer

    getChannel, getConsumerTag, handleCancel, handleCancelOk, handleConsumeOk, handleRecoverOk, handleShutdownSignal

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

  • Constructor Details

    • QueueingConsumer

      public QueueingConsumer(com.rabbitmq.client.Channel channel)
    • QueueingConsumer

      public QueueingConsumer(com.rabbitmq.client.Channel channel, LinkedBlockingQueue<com.rabbitmq.client.Delivery> deliveryQueue)
  • Method Details

    • handleDelivery

      public void handleDelivery(String consumerTag, com.rabbitmq.client.Envelope envelope, com.rabbitmq.client.AMQP.BasicProperties properties, byte[] body) throws IOException
      Adds the delivery object to linked blocking queue for every receive
      Specified by:
      handleDelivery in interface com.rabbitmq.client.Consumer
      Overrides:
      handleDelivery in class com.rabbitmq.client.DefaultConsumer
      Throws:
      IOException
    • getDeliveryQueue

      public LinkedBlockingQueue<com.rabbitmq.client.Delivery> getDeliveryQueue()