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

    Nested Classes
    Modifier and Type
    Interface
    Description
    static interface 
    Context for message processing.
    static interface 
    Contract to process a message.

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

    Resource.State, Resource.StateListener
  • Method Summary

    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

    • pause

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

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

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

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