Class AmqpClient

java.lang.Object
io.vertx.mutiny.amqp.AmqpClient
All Implemented Interfaces:
MutinyDelegate

public class AmqpClient extends Object implements MutinyDelegate
AMQP Client entry point. Use this interface to create an instance of AmqpClient and connect to a broker and server.

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

See Also:
  • AmqpClient
  • Field Details

  • Constructor Details

    • AmqpClient

      public AmqpClient(io.vertx.amqp.AmqpClient delegate)
      Create a new instance of AmqpClient delegating to the given (non-null) instance of AmqpClient.
    • AmqpClient

      public AmqpClient(Object delegate)
  • Method Details

    • getDelegate

      public io.vertx.amqp.AmqpClient getDelegate()
      Get the delegate instance.

      This method returns the instance on which this shim is delegating the calls. And so, give you access to the bare API.

      Specified by:
      getDelegate in interface MutinyDelegate
      Returns:
      the delegate instance
    • connect

      @CheckReturnValue public io.smallrye.mutiny.Uni<AmqpConnection> connect()
      Connects to the AMQP broker or router. The location is specified in the AmqpClientOptions as well as the potential credential required.

      Unlike the bare Vert.x variant, this method returns a Uni. The uni emits the result of the operation as item. If the operation fails, the uni emits the failure.

      Don't forget to subscribe on it to trigger the operation.

      Returns:
      A Uni representing the asynchronous result of this operation.
      See Also:
      • AmqpClient.connect()
    • connectAndAwait

      public AmqpConnection connectAndAwait()
      Connects to the AMQP broker or router. The location is specified in the AmqpClientOptions as well as the potential credential required.

      Unlike the bare Vert.x variant, this method returns a AmqpConnection. This method awaits indefinitely 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 operation result
      See Also:
      • AmqpClient.connect()
    • connectAndForget

      public AmqpClient connectAndForget()
      Connects to the AMQP broker or router. The location is specified in the AmqpClientOptions as well as the potential credential required.

      Unlike the bare Vert.x variant, this method ignores the AmqpConnection result or any failure.

      Returns:
      The current instance to chain operations if needed.
      See Also:
      • AmqpClient.connect()
    • close

      @CheckReturnValue public io.smallrye.mutiny.Uni<Void> close()
      Closes the client. The client must always be closed once not needed anymore.

      Unlike the bare Vert.x variant, this method returns a Uni. The uni emits the result of the operation as item. If the operation fails, the uni emits the failure.

      Don't forget to subscribe on it to trigger the operation.

      Returns:
      A Uni representing the asynchronous result of this operation.
      See Also:
      • AmqpClient.close()
    • closeAndAwait

      public void closeAndAwait()
      Closes the client. The client must always be closed once not needed anymore.

      Unlike the bare Vert.x variant, this method returns a Void. This method awaits indefinitely 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).

      See Also:
      • AmqpClient.close()
    • closeAndForget

      public AmqpClient closeAndForget()
      Closes the client. The client must always be closed once not needed anymore.

      Unlike the bare Vert.x variant, this method ignores the Void result or any failure.

      Returns:
      The current instance to chain operations if needed.
      See Also:
      • AmqpClient.close()
    • createReceiver

      @CheckReturnValue public io.smallrye.mutiny.Uni<AmqpReceiver> createReceiver(String address)
      Creates a receiver used to consume messages from the given address. The receiver has no handler and won't start receiving messages until a handler is explicitly configured. This method avoids having to connect explicitly. You can retrieve the connection using AmqpReceiver.connection().

      Unlike the bare Vert.x variant, this method returns a Uni. The uni emits the result of the operation as item. If the operation fails, the uni emits the failure.

      Don't forget to subscribe on it to trigger the operation.

      Parameters:
      address - The source address to attach the consumer to, must not be null
      Returns:
      A Uni representing the asynchronous result of this operation.
      See Also:
      • AmqpClient.createReceiver(String)
    • createReceiverAndAwait

      public AmqpReceiver createReceiverAndAwait(String address)
      Creates a receiver used to consume messages from the given address. The receiver has no handler and won't start receiving messages until a handler is explicitly configured. This method avoids having to connect explicitly. You can retrieve the connection using AmqpReceiver.connection().

      Unlike the bare Vert.x variant, this method returns a AmqpReceiver. This method awaits indefinitely 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:
      address - The source address to attach the consumer to, must not be null
      Returns:
      The operation result
      See Also:
      • AmqpClient.createReceiver(String)
    • createReceiverAndForget

      public AmqpClient createReceiverAndForget(String address)
      Creates a receiver used to consume messages from the given address. The receiver has no handler and won't start receiving messages until a handler is explicitly configured. This method avoids having to connect explicitly. You can retrieve the connection using AmqpReceiver.connection().

      Unlike the bare Vert.x variant, this method ignores the AmqpReceiver result or any failure.

      Parameters:
      address - The source address to attach the consumer to, must not be null
      Returns:
      The current instance to chain operations if needed.
      See Also:
      • AmqpClient.createReceiver(String)
    • createReceiver

      @CheckReturnValue public io.smallrye.mutiny.Uni<AmqpReceiver> createReceiver(String address, io.vertx.amqp.AmqpReceiverOptions receiverOptions)
      Creates a receiver used to consumer messages from the given address. This method avoids having to connect explicitly. You can retrieve the connection using AmqpReceiver.connection().

      Unlike the bare Vert.x variant, this method returns a Uni. The uni emits the result of the operation as item. If the operation fails, the uni emits the failure.

      Don't forget to subscribe on it to trigger the operation.

      Parameters:
      address - The source address to attach the consumer to.
      receiverOptions - The options for this receiver.
      Returns:
      A Uni representing the asynchronous result of this operation.
      See Also:
      • AmqpClient.createReceiver(String, AmqpReceiverOptions)
    • createReceiverAndAwait

      public AmqpReceiver createReceiverAndAwait(String address, io.vertx.amqp.AmqpReceiverOptions receiverOptions)
      Creates a receiver used to consumer messages from the given address. This method avoids having to connect explicitly. You can retrieve the connection using AmqpReceiver.connection().

      Unlike the bare Vert.x variant, this method returns a AmqpReceiver. This method awaits indefinitely 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:
      address - The source address to attach the consumer to.
      receiverOptions - The options for this receiver.
      Returns:
      The operation result
      See Also:
      • AmqpClient.createReceiver(String, AmqpReceiverOptions)
    • createReceiverAndForget

      public AmqpClient createReceiverAndForget(String address, io.vertx.amqp.AmqpReceiverOptions receiverOptions)
      Creates a receiver used to consumer messages from the given address. This method avoids having to connect explicitly. You can retrieve the connection using AmqpReceiver.connection().

      Unlike the bare Vert.x variant, this method ignores the AmqpReceiver result or any failure.

      Parameters:
      address - The source address to attach the consumer to.
      receiverOptions - The options for this receiver.
      Returns:
      The current instance to chain operations if needed.
      See Also:
      • AmqpClient.createReceiver(String, AmqpReceiverOptions)
    • createSender

      @CheckReturnValue public io.smallrye.mutiny.Uni<AmqpSender> createSender(String address)
      Creates a sender used to send messages to the given address. The address must be set.

      Unlike the bare Vert.x variant, this method returns a Uni. The uni emits the result of the operation as item. If the operation fails, the uni emits the failure.

      Don't forget to subscribe on it to trigger the operation.

      Parameters:
      address - The target address to attach to, must not be null
      Returns:
      A Uni representing the asynchronous result of this operation.
      See Also:
      • AmqpClient.createSender(String)
    • createSenderAndAwait

      public AmqpSender createSenderAndAwait(String address)
      Creates a sender used to send messages to the given address. The address must be set.

      Unlike the bare Vert.x variant, this method returns a AmqpSender. This method awaits indefinitely 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:
      address - The target address to attach to, must not be null
      Returns:
      The operation result
      See Also:
      • AmqpClient.createSender(String)
    • createSenderAndForget

      public AmqpClient createSenderAndForget(String address)
      Creates a sender used to send messages to the given address. The address must be set.

      Unlike the bare Vert.x variant, this method ignores the AmqpSender result or any failure.

      Parameters:
      address - The target address to attach to, must not be null
      Returns:
      The current instance to chain operations if needed.
      See Also:
      • AmqpClient.createSender(String)
    • createSender

      @CheckReturnValue public io.smallrye.mutiny.Uni<AmqpSender> createSender(String address, io.vertx.amqp.AmqpSenderOptions options)
      Creates a sender used to send messages to the given address. The address must be set.

      Unlike the bare Vert.x variant, this method returns a Uni. The uni emits the result of the operation as item. If the operation fails, the uni emits the failure.

      Don't forget to subscribe on it to trigger the operation.

      Parameters:
      address - The target address to attach to, must not be null
      options - The options for this sender.
      Returns:
      A Uni representing the asynchronous result of this operation.
      See Also:
      • AmqpClient.createSender(String, AmqpSenderOptions)
    • createSenderAndAwait

      public AmqpSender createSenderAndAwait(String address, io.vertx.amqp.AmqpSenderOptions options)
      Creates a sender used to send messages to the given address. The address must be set.

      Unlike the bare Vert.x variant, this method returns a AmqpSender. This method awaits indefinitely 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:
      address - The target address to attach to, must not be null
      options - The options for this sender.
      Returns:
      The operation result
      See Also:
      • AmqpClient.createSender(String, AmqpSenderOptions)
    • createSenderAndForget

      public AmqpClient createSenderAndForget(String address, io.vertx.amqp.AmqpSenderOptions options)
      Creates a sender used to send messages to the given address. The address must be set.

      Unlike the bare Vert.x variant, this method ignores the AmqpSender result or any failure.

      Parameters:
      address - The target address to attach to, must not be null
      options - The options for this sender.
      Returns:
      The current instance to chain operations if needed.
      See Also:
      • AmqpClient.createSender(String, AmqpSenderOptions)
    • create

      public static AmqpClient create(io.vertx.amqp.AmqpClientOptions options)
      Creates a new instance of AmqpClient using an internal Vert.x instance (with default configuration) and the given AMQP client configuration. Note that the created Vert.x instance will be closed when the client is closed.
      Parameters:
      options - the AMQP client options, may be null falling back to the default configuration
      Returns:
      the created instances.
    • create

      public static AmqpClient create(Vertx vertx, io.vertx.amqp.AmqpClientOptions options)
      Creates a new instance of AmqpClient with the given Vert.x instance and the given options.
      Parameters:
      vertx - the vert.x instance, must not be null
      options - the AMQP options, may be @{code null} falling back to the default configuration
      Returns:
      the AMQP client instance
    • newInstance

      public static AmqpClient newInstance(io.vertx.amqp.AmqpClient delegate)
      Creates a new instance of the AmqpClient.
    • hashCode

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

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object