io.vertx.rabbitmq

## Interface RabbitMQConsumer

- All Superinterfaces:
    ReadStream<RabbitMQMessage>, StreamBase

      public interface RabbitMQConsumer
      extends ReadStream<RabbitMQMessage>

  A stream of messages from a rabbitmq queue.

- - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `cancel()` Stop message consumption from a queue.
    `void` | `cancel(Handler<AsyncResult<Void>> cancelResult)` Stop message consumption from a queue.
    `String` | `consumerTag()`
    `RabbitMQConsumer` | `endHandler(Handler<Void> endHandler)` Set an end handler.
    `RabbitMQConsumer` | `exceptionHandler(Handler<Throwable> exceptionHandler)` Set an exception handler on the read stream.
    `RabbitMQConsumer` | `handler(Handler<RabbitMQMessage> messageArrived)` Set a message handler.
    `boolean` | `isPaused()`
    `RabbitMQConsumer` | `pause()` Pause the stream of incoming messages from queue.
    `RabbitMQConsumer` | `resume()` Resume reading from a queue.

    - ### Methods inherited from interface io.vertx.core.streams.ReadStream

      `fetch, pipe, pipeTo, pipeTo`

- - ### Method Detail

    - #### exceptionHandler

          RabbitMQConsumer exceptionHandler(Handler<Throwable> exceptionHandler)

      Set an exception handler on the read stream.
      Specified by:
        `exceptionHandler` in interface `ReadStream<RabbitMQMessage>`
      Specified by:
        `exceptionHandler` in interface `StreamBase`
      Parameters:
        `exceptionHandler` - the exception handler
      Returns:
        a reference to this, so the API can be used fluently

    - #### handler

          RabbitMQConsumer handler(Handler<RabbitMQMessage> messageArrived)

      Set a message handler. As message appear in a queue, the handler will be called with the message.
      Specified by:
        `handler` in interface `ReadStream<RabbitMQMessage>`
      Returns:
        a reference to this, so the API can be used fluently

    - #### pause

          RabbitMQConsumer pause()

      Pause the stream of incoming messages from queue.

      The messages will continue to arrive, but they will be stored in a internal queue. If the queue size would exceed the limit provided by `RabbitMQConsumer#size(int)`, then incoming messages will be discarded.

      Specified by:
        `pause` in interface `ReadStream<RabbitMQMessage>`
      Returns:
        a reference to this, so the API can be used fluently

    - #### resume

          RabbitMQConsumer resume()

      Resume reading from a queue. Flushes internal queue.
      Specified by:
        `resume` in interface `ReadStream<RabbitMQMessage>`
      Returns:
        a reference to this, so the API can be used fluently

    - #### endHandler

          RabbitMQConsumer endHandler(Handler<Void> endHandler)

      Set an end handler. Once the stream has canceled successfully, the handler will be called.
      Specified by:
        `endHandler` in interface `ReadStream<RabbitMQMessage>`
      Returns:
        a reference to this, so the API can be used fluently

    - #### consumerTag

          String consumerTag()

      Returns:
        a consumer tag

    - #### cancel

          void cancel()

      Stop message consumption from a queue.

      The operation is asynchronous. When consumption will be stopped, you can by notified via `endHandler(Handler)`

    - #### cancel

          void cancel(Handler<AsyncResult<Void>> cancelResult)

      Stop message consumption from a queue.

      The operation is asynchronous. When consumption will be stopped, you can by notified via `endHandler(Handler)`

      Parameters:
        `cancelResult` - contains information about operation status: success/fail.

    - #### isPaused

          boolean isPaused()

      Returns:
        is the stream paused?

Copyright © 2019 Eclipse. All rights reserved.