Class MessageConsumer<T>

    • Constructor Detail

      • MessageConsumer

        public MessageConsumer​(io.vertx.core.eventbus.MessageConsumer delegate)
      • MessageConsumer

        public MessageConsumer​(Object delegate,
                               TypeArg<T> typeArg_0)
      • MessageConsumer

        public MessageConsumer​(io.vertx.core.eventbus.MessageConsumer delegate,
                               TypeArg<T> typeArg_0)
    • Method Detail

      • hashCode

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

        @CheckReturnValue
        public io.smallrye.mutiny.Uni<Void> pipeTo​(WriteStream<Message<T>> dst)
        Pipe this ReadStream to the WriteStream.

        Elements emitted by this stream will be written to the write stream until this stream ends or fails.

        Once this stream has ended or failed, the write stream will be ended and the handler will be called with the result.

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

        Specified by:
        pipeTo in interface ReadStream<T>
        Parameters:
        dst - the destination write stream
        Returns:
        the uni firing the result of the operation when completed, or a failure if the operation failed.
      • pipeToAndAwait

        public Void pipeToAndAwait​(WriteStream<Message<T>> dst)
        Blocking variant of ReadStream.pipeTo(io.vertx.mutiny.core.streams.WriteStream).

        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).

        Specified by:
        pipeToAndAwait in interface ReadStream<T>
        Parameters:
        dst - the destination write stream
        Returns:
        the Void instance produced by the operation.
      • fetch

        public MessageConsumer<T> fetch​(long amount)
        Specified by:
        fetch in interface ReadStream<T>
        Returns:
        a reference to this, so the API can be used fluently
      • bodyStream

        public ReadStream<T> bodyStream()
        Returns:
        a read stream for the body of the message stream.
      • isRegistered

        public boolean isRegistered()
        Returns:
        true if the current consumer is registered
      • address

        public String address()
        Returns:
        The address the handler was registered with.
      • setMaxBufferedMessages

        public MessageConsumer<T> setMaxBufferedMessages​(int maxBufferedMessages)
        Parameters:
        maxBufferedMessages - the maximum number of messages that can be buffered
        Returns:
        this registration
      • getMaxBufferedMessages

        public int getMaxBufferedMessages()
        Returns:
        the maximum number of messages that can be buffered when this stream is paused
      • completionHandler

        @CheckReturnValue
        public io.smallrye.mutiny.Uni<Void> completionHandler()
        Optional method which can be called to indicate when the registration has been propagated across the cluster.

        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.
      • completionHandlerAndAwait

        public Void completionHandlerAndAwait()
        Blocking variant of completionHandler().

        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.
      • completionHandlerAndForget

        public void completionHandlerAndForget()
        Variant of completionHandler() that ignores the result of the operation.

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

      • unregister

        @CheckReturnValue
        public io.smallrye.mutiny.Uni<Void> unregister()
        Unregisters the handler which created this registration

        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.
      • unregisterAndAwait

        public Void unregisterAndAwait()
        Blocking variant of unregister().

        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.
      • unregisterAndForget

        public void unregisterAndForget()
        Variant of unregister() that ignores the result of the operation.

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

      • toMulti

        @CheckReturnValue
        public io.smallrye.mutiny.Multi<Message<T>> toMulti()
        Specified by:
        toMulti in interface ReadStream<T>
      • newInstance

        public static <T> MessageConsumer<T> newInstance​(io.vertx.core.eventbus.MessageConsumer arg)
      • newInstance

        public static <T> MessageConsumer<T> newInstance​(io.vertx.core.eventbus.MessageConsumer arg,
                                                         TypeArg<T> __typeArg_T)