Class AmqpSender

  • All Implemented Interfaces:
    StreamBase, WriteStream<AmqpMessage>

    public class AmqpSender
    extends Object
    implements WriteStream<AmqpMessage>
    AMQP Sender interface used to send messages.

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

    • Constructor Detail

      • AmqpSender

        public AmqpSender​(io.vertx.amqp.AmqpSender delegate)
      • AmqpSender

        public AmqpSender​(Object delegate)
    • Method Detail

      • hashCode

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

        @CheckReturnValue
        public io.smallrye.mutiny.Uni<Void> write​(AmqpMessage arg0)
        Description copied from interface: WriteStream
        Same as but with an handler called when the operation completes

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

        Specified by:
        write in interface WriteStream<AmqpMessage>
        Returns:
        the uni firing the result of the operation when completed, or a failure if the operation failed.
      • writeAndAwait

        public Void writeAndAwait​(AmqpMessage arg0)
        Description copied from interface: WriteStream
        Blocking variant of io.vertx.mutiny.core.streams.WriteStream#write(T).

        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:
        writeAndAwait in interface WriteStream<AmqpMessage>
        Returns:
        the Void instance produced by the operation.
      • writeAndForget

        public void writeAndForget​(AmqpMessage arg0)
        Description copied from interface: WriteStream
        Variant of io.vertx.mutiny.core.streams.WriteStream#write(T) that ignores the result of the operation.

        This method subscribes on the result of io.vertx.mutiny.core.streams.WriteStream#write(T), but discards the outcome (item or failure). This method is useful to trigger the asynchronous operation from io.vertx.mutiny.core.streams.WriteStream#write(T) but you don't need to compose it with other operations.

        Specified by:
        writeAndForget in interface WriteStream<AmqpMessage>
      • end

        @CheckReturnValue
        public io.smallrye.mutiny.Uni<Void> end()
        Description copied from interface: WriteStream
        Same as WriteStream.end() but with an handler called when the operation completes

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

        Specified by:
        end in interface WriteStream<AmqpMessage>
        Returns:
        the uni firing the result of the operation when completed, or a failure if the operation failed.
      • endAndAwait

        public Void endAndAwait()
        Description copied from interface: WriteStream
        Blocking variant of WriteStream.end().

        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:
        endAndAwait in interface WriteStream<AmqpMessage>
        Returns:
        the Void instance produced by the operation.
      • end

        @CheckReturnValue
        public io.smallrye.mutiny.Uni<Void> end​(AmqpMessage data)
        Description copied from interface: WriteStream
        Same as but with an handler called when the operation completes

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

        Specified by:
        end in interface WriteStream<AmqpMessage>
        Returns:
        the uni firing the result of the operation when completed, or a failure if the operation failed.
      • endAndAwait

        public Void endAndAwait​(AmqpMessage data)
        Description copied from interface: WriteStream
        Blocking variant of io.vertx.mutiny.core.streams.WriteStream#end(T).

        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:
        endAndAwait in interface WriteStream<AmqpMessage>
        Returns:
        the Void instance produced by the operation.
      • endAndForget

        public void endAndForget​(AmqpMessage data)
        Description copied from interface: WriteStream
        Variant of io.vertx.mutiny.core.streams.WriteStream#end(T) that ignores the result of the operation.

        This method subscribes on the result of io.vertx.mutiny.core.streams.WriteStream#end(T), but discards the outcome (item or failure). This method is useful to trigger the asynchronous operation from io.vertx.mutiny.core.streams.WriteStream#end(T) but you don't need to compose it with other operations.

        Specified by:
        endAndForget in interface WriteStream<AmqpMessage>
      • setWriteQueueMaxSize

        public AmqpSender setWriteQueueMaxSize​(int maxSize)
        Specified by:
        setWriteQueueMaxSize in interface WriteStream<AmqpMessage>
        Parameters:
        maxSize - the max size of the write stream
        Returns:
        a reference to this, so the API can be used fluently
      • send

        public AmqpSender send​(AmqpMessage message)
        Parameters:
        message - the message, must not be null
        Returns:
        the current sender
      • sendWithAck

        @CheckReturnValue
        public io.smallrye.mutiny.Uni<Void> sendWithAck​(AmqpMessage message)
        Sends an AMQP message and waits for an acknowledgement. The acknowledgement handler is called with an marked as failed if the message has been rejected or re-routed. If the message has been accepted, the handler is called with a success.

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

        Parameters:
        message - the message, must not be null
        Returns:
        the uni firing the result of the operation when completed, or a failure if the operation failed.
      • sendWithAckAndAwait

        public Void sendWithAckAndAwait​(AmqpMessage message)
        Blocking variant of sendWithAck(io.vertx.mutiny.amqp.AmqpMessage).

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

        Parameters:
        message - the message, must not be null
        Returns:
        the Void instance produced by the operation.
      • close

        @CheckReturnValue
        public io.smallrye.mutiny.Uni<Void> close()
        Closes the sender.

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

        public Void closeAndAwait()
        Blocking variant of close().

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

        public void closeAndForget()
        Variant of close() that ignores the result of the operation.

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

      • address

        public String address()
        Returns:
        the configured address.
      • connection

        public AmqpConnection connection()
        Returns:
        the connection having created the sender.
      • remainingCredits

        public long remainingCredits()
        Returns:
        the remaining credit, 0 is none.
      • unwrap

        public io.vertx.proton.ProtonSender unwrap()
        Returns:
        the underlying ProtonSender.
      • newInstance

        public static AmqpSender newInstance​(io.vertx.amqp.AmqpSender arg)