Class AmqpConnection

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

public class AmqpConnection extends Object implements MutinyDelegate
Once connected to the broker or router, you get a connection. This connection is automatically opened.

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

See Also:
  • AmqpConnection
  • Field Details

  • Constructor Details

    • AmqpConnection

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

      public AmqpConnection(Object delegate)
  • Method Details

    • getDelegate

      public io.vertx.amqp.AmqpConnection 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
    • close

      @CheckReturnValue public io.smallrye.mutiny.Uni<Void> close()
      Closes the AMQP connection, i.e. allows the Close frame to be emitted.

      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:
      • AmqpConnection.close()
    • closeAndAwait

      public void closeAndAwait()
      Closes the AMQP connection, i.e. allows the Close frame to be emitted.

      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:
      • AmqpConnection.close()
    • closeAndForget

      public AmqpConnection closeAndForget()
      Closes the AMQP connection, i.e. allows the Close frame to be emitted.

      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:
      • AmqpConnection.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.

      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:
      • AmqpConnection.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.

      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:
      • AmqpConnection.createReceiver(String)
    • createReceiverAndForget

      public AmqpConnection 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.

      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:
      • AmqpConnection.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.

      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:
      • AmqpConnection.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.

      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:
      • AmqpConnection.createReceiver(String, AmqpReceiverOptions)
    • createReceiverAndForget

      public AmqpConnection createReceiverAndForget(String address, io.vertx.amqp.AmqpReceiverOptions receiverOptions)
      Creates a receiver used to consumer messages from the given address.

      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:
      • AmqpConnection.createReceiver(String, AmqpReceiverOptions)
    • createDynamicReceiver

      @CheckReturnValue public io.smallrye.mutiny.Uni<AmqpReceiver> createDynamicReceiver()
      Creates a dynamic receiver. The address is provided by the broker and is available in the completionHandler, using the AmqpReceiver.address() method. this method is useful for request-reply to generate a unique reply address.

      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:
      • AmqpConnection.createDynamicReceiver()
    • createDynamicReceiverAndAwait

      public AmqpReceiver createDynamicReceiverAndAwait()
      Creates a dynamic receiver. The address is provided by the broker and is available in the completionHandler, using the AmqpReceiver.address() method. this method is useful for request-reply to generate a unique reply address.

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

      Returns:
      The operation result
      See Also:
      • AmqpConnection.createDynamicReceiver()
    • createDynamicReceiverAndForget

      public AmqpConnection createDynamicReceiverAndForget()
      Creates a dynamic receiver. The address is provided by the broker and is available in the completionHandler, using the AmqpReceiver.address() method. this method is useful for request-reply to generate a unique reply address.

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

      Returns:
      The current instance to chain operations if needed.
      See Also:
      • AmqpConnection.createDynamicReceiver()
    • 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. For anonymous sender, check createAnonymousSender().

      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:
    • createSenderAndAwait

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

      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:
    • createSenderAndForget

      public AmqpConnection createSenderAndForget(String address)
      Creates a sender used to send messages to the given address. The address must be set. For anonymous sender, check createAnonymousSender().

      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:
    • 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. For anonymous sender, check createAnonymousSender().

      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, allowed to be null if the options configures the sender to be attached to a dynamic address (provided by the broker).
      options - The AMQP sender options
      Returns:
      A Uni representing the asynchronous result of this operation.
      See Also:
    • 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. For anonymous sender, check createAnonymousSender().

      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, allowed to be null if the options configures the sender to be attached to a dynamic address (provided by the broker).
      options - The AMQP sender options
      Returns:
      The operation result
      See Also:
    • createSenderAndForget

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

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

      Parameters:
      address - The target address to attach to, allowed to be null if the options configures the sender to be attached to a dynamic address (provided by the broker).
      options - The AMQP sender options
      Returns:
      The current instance to chain operations if needed.
      See Also:
    • createAnonymousSender

      @CheckReturnValue public io.smallrye.mutiny.Uni<AmqpSender> createAnonymousSender()
      Creates an anonymous sender.

      Unlike "regular" sender, this sender is not associated to a specific address, and each message sent must provide an address. This method can be used in request-reply scenarios where you create a sender to send the reply, but you don't know the address, as the reply address is passed into the message you are going to receive.

      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:
      • AmqpConnection.createAnonymousSender()
    • createAnonymousSenderAndAwait

      public AmqpSender createAnonymousSenderAndAwait()
      Creates an anonymous sender.

      Unlike "regular" sender, this sender is not associated to a specific address, and each message sent must provide an address. This method can be used in request-reply scenarios where you create a sender to send the reply, but you don't know the address, as the reply address is passed into the message you are going to receive.

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

      Returns:
      The operation result
      See Also:
      • AmqpConnection.createAnonymousSender()
    • createAnonymousSenderAndForget

      public AmqpConnection createAnonymousSenderAndForget()
      Creates an anonymous sender.

      Unlike "regular" sender, this sender is not associated to a specific address, and each message sent must provide an address. This method can be used in request-reply scenarios where you create a sender to send the reply, but you don't know the address, as the reply address is passed into the message you are going to receive.

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

      Returns:
      The current instance to chain operations if needed.
      See Also:
      • AmqpConnection.createAnonymousSender()
    • closeFuture

      @CheckReturnValue public io.smallrye.mutiny.Uni<Void> closeFuture()

      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:
      • AmqpConnection.closeFuture()
    • closeFutureAndAwait

      public void closeFutureAndAwait()

      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:
      • AmqpConnection.closeFuture()
    • closeFutureAndForget

      public AmqpConnection closeFutureAndForget()

      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:
      • AmqpConnection.closeFuture()
    • exceptionHandler

      public AmqpConnection exceptionHandler(Consumer<Throwable> handler)
      Registers a handler called on disconnection.
      Parameters:
      handler - the exception handler.
      Returns:
      the connection
    • isDisconnected

      public boolean isDisconnected()
      Returns:
      whether the connection has been disconnected.
    • unwrap

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

      public static AmqpConnection newInstance(io.vertx.amqp.AmqpConnection delegate)
      Creates a new instance of the AmqpConnection.
    • 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