Interface Consumer

All Superinterfaces:
AutoCloseable, Resource

public interface Consumer extends AutoCloseable, Resource
API to consume messages from a RabbitMQ queue.

Instances are configured and created with a ConsumerBuilder.

See Also:
  • Nested Class Summary Link icon

    Nested Classes
    Modifier and Type
    Interface
    Description
    static interface 
    Context to accumulate message contexts and settle them at once.
    static interface 
    Context for message processing.
    static interface 
    Contract to process a message.

    Nested classes/interfaces inherited from interface com.rabbitmq.client.amqp.Resource Link icon

    Resource.State, Resource.StateListener
  • Method Summary Link icon

    Modifier and Type
    Method
    Description
    void
    Close the consumer with its resources.
    void
    Pause the consumer to stop receiving messages.
    void
    Request to receive messages again.
    long
    Return the number of unsettled messages.
  • Method Details Link icon

    • pause Link icon

      void pause()
      Pause the consumer to stop receiving messages.
    • unsettledMessageCount Link icon

      long unsettledMessageCount()
      Return the number of unsettled messages.
      Returns:
      unsettled message count
    • unpause Link icon

      void unpause()
      Request to receive messages again.
    • close Link icon

      void close()
      Close the consumer with its resources.
      Specified by:
      close in interface AutoCloseable