Class RabbitMQConsumer

  • All Implemented Interfaces:
    io.vertx.mutiny.core.streams.ReadStream<RabbitMQMessage>, io.vertx.mutiny.core.streams.StreamBase

    public class RabbitMQConsumer
    extends Object
    implements io.vertx.mutiny.core.streams.ReadStream<RabbitMQMessage>
    A stream of messages from a rabbitmq queue.

    NOTE: This class has been automatically generated from the original non Mutiny-ified interface using Vert.x codegen.

    • Field Detail

      • __TYPE_ARG

        public static final io.smallrye.mutiny.vertx.TypeArg<RabbitMQConsumer> __TYPE_ARG
    • Constructor Detail

      • RabbitMQConsumer

        public RabbitMQConsumer​(io.vertx.rabbitmq.RabbitMQConsumer delegate)
      • RabbitMQConsumer

        public RabbitMQConsumer​(Object delegate)
    • Method Detail

      • getDelegate

        public io.vertx.rabbitmq.RabbitMQConsumer getDelegate()
        Specified by:
        getDelegate in interface io.vertx.mutiny.core.streams.ReadStream<RabbitMQMessage>
        Specified by:
        getDelegate in interface io.vertx.mutiny.core.streams.StreamBase
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object
      • pipe

        public io.vertx.mutiny.core.streams.Pipe<RabbitMQMessage> pipe()
        Specified by:
        pipe in interface io.vertx.mutiny.core.streams.ReadStream<RabbitMQMessage>
      • pipeTo

        @CheckReturnValue
        public io.smallrye.mutiny.Uni<Void> pipeTo​(io.vertx.mutiny.core.streams.WriteStream<RabbitMQMessage> dst)
        Specified by:
        pipeTo in interface io.vertx.mutiny.core.streams.ReadStream<RabbitMQMessage>
      • pipeToAndAwait

        public Void pipeToAndAwait​(io.vertx.mutiny.core.streams.WriteStream<RabbitMQMessage> dst)
        Specified by:
        pipeToAndAwait in interface io.vertx.mutiny.core.streams.ReadStream<RabbitMQMessage>
      • pipeToAndForget

        public void pipeToAndForget​(io.vertx.mutiny.core.streams.WriteStream<RabbitMQMessage> dst)
        Specified by:
        pipeToAndForget in interface io.vertx.mutiny.core.streams.ReadStream<RabbitMQMessage>
      • exceptionHandler

        public RabbitMQConsumer exceptionHandler​(Consumer<Throwable> exceptionHandler)
        Specified by:
        exceptionHandler in interface io.vertx.mutiny.core.streams.ReadStream<RabbitMQMessage>
        Specified by:
        exceptionHandler in interface io.vertx.mutiny.core.streams.StreamBase
        Parameters:
        exceptionHandler - the exception handler
        Returns:
      • pause

        public RabbitMQConsumer pause()
        Specified by:
        pause in interface io.vertx.mutiny.core.streams.ReadStream<RabbitMQMessage>
        Returns:
        a reference to this, so the API can be used fluently
      • resume

        public RabbitMQConsumer resume()
        Specified by:
        resume in interface io.vertx.mutiny.core.streams.ReadStream<RabbitMQMessage>
        Returns:
        a reference to this, so the API can be used fluently
      • endHandler

        public RabbitMQConsumer endHandler​(Runnable endHandler)
        Specified by:
        endHandler in interface io.vertx.mutiny.core.streams.ReadStream<RabbitMQMessage>
        Parameters:
        endHandler -
        Returns:
      • queueName

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

        public RabbitMQConsumer setQueueName​(String name)
        Parameters:
        name - the name of the queue
        Returns:
        a reference to this, so the API can be used fluently
      • consumerTag

        public String consumerTag()
        Returns:
        a consumer tag
      • cancel

        @CheckReturnValue
        public io.smallrye.mutiny.Uni<Void> cancel()
        Stop message consumption from a queue.

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

        Unlike the bare Vert.x variant, this method returns a Uni. Don't forget to subscribe on it to trigger the operation.

        Returns:
        the uni firing the result of the operation when completed, or a failure if the operation failed.
      • cancelAndAwait

        public Void cancelAndAwait()
        Blocking variant of cancel().

        This method waits for the completion of the underlying asynchronous operation. If the operation completes successfully, the result is returned, otherwise the failure is thrown (potentially wrapped in a RuntimeException).

        Returns:
        the Void instance produced by the operation.
      • cancelAndForget

        public void cancelAndForget()
        Variant of cancel() that ignores the result of the operation.

        This method subscribes on the result of cancel(), but discards the outcome (item or failure). This method is useful to trigger the asynchronous operation from cancel() but you don't need to compose it with other operations.

      • isCancelled

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

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

        public RabbitMQConsumer fetch​(long amount)
        Specified by:
        fetch in interface io.vertx.mutiny.core.streams.ReadStream<RabbitMQMessage>
        Parameters:
        amount -
        Returns:
        a reference to this, so the API can be used fluently
      • toMulti

        @CheckReturnValue
        public io.smallrye.mutiny.Multi<RabbitMQMessage> toMulti()
        Specified by:
        toMulti in interface io.vertx.mutiny.core.streams.ReadStream<RabbitMQMessage>
      • newInstance

        public static RabbitMQConsumer newInstance​(io.vertx.rabbitmq.RabbitMQConsumer arg)