Interface RabbitMQConsumer

    • Method Detail

      • 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
      • queueName

        String queueName()
        Returns:
        the name of the queue
      • setQueueName

        RabbitMQConsumer setQueueName​(String name)
        Set the name of the queue. This method is typically only required during a connectionEstablishedCallback when the queue name has changed.
        Parameters:
        name - the name of the queue
        Returns:
        a reference to this, so the API can be used fluently
      • consumerTag

        String consumerTag()
        Returns:
        a consumer tag
      • cancel

        Future<Void> cancel()
        Stop message consumption from a queue.

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

        Returns:
        a future through which you can find out the operation status.
      • isCancelled

        boolean isCancelled()
        Return true if cancel() has been called.
        Returns:
        true if cancel() has been called.
      • isPaused

        boolean isPaused()
        Returns:
        is the stream paused?
      • fetch

        RabbitMQConsumer fetch​(long amount)
        Fetch the specified amount of elements. If the ReadStream has been paused, reading will recommence with the specified amount of items, otherwise the specified amount will be added to the current stream demand.
        Specified by:
        fetch in interface ReadStream<RabbitMQMessage>
        Returns:
        a reference to this, so the API can be used fluently