io.vertx.amqp

## Interface AmqpConnection

-     public interface AmqpConnection

  Once connected to the broker or router, you get a connection. This connection is automatically opened.

- - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method and Description
    --- | ---
    `Future<Void>` | `close()` Like `close(Handler)` but returns a `Future` of the asynchronous result
    `AmqpConnection` | `close(Handler<AsyncResult<Void>> done)` Closes the AMQP connection, i.e.
    `Future<AmqpSender>` | `createAnonymousSender()` Like `createAnonymousSender(Handler)` but returns a `Future` of the asynchronous result
    `AmqpConnection` | `createAnonymousSender(Handler<AsyncResult<AmqpSender>> completionHandler)` Creates an anonymous sender.
    `Future<AmqpReceiver>` | `createDynamicReceiver()` Like `createDynamicReceiver(Handler)` but returns a `Future` of the asynchronous result
    `AmqpConnection` | `createDynamicReceiver(Handler<AsyncResult<AmqpReceiver>> completionHandler)` Creates a dynamic receiver.
    `Future<AmqpReceiver>` | `createReceiver(String address)` Like `createReceiver(String, Handler)` but returns a `Future` of the asynchronous result
    `Future<AmqpReceiver>` | `createReceiver(String address, AmqpReceiverOptions receiverOptions)` Like `createReceiver(String, AmqpReceiverOptions, Handler)` but returns a `Future` of the asynchronous result
    `AmqpConnection` | `createReceiver(String address, AmqpReceiverOptions receiverOptions, Handler<AsyncResult<AmqpReceiver>> completionHandler)` Creates a receiver used to consumer messages from the given address.
    `AmqpConnection` | `createReceiver(String address, Handler<AsyncResult<AmqpReceiver>> completionHandler)` Creates a receiver used to consume messages from the given address.
    `Future<AmqpSender>` | `createSender(String address)` Like `createSender(String, Handler)` but returns a `Future` of the asynchronous result
    `Future<AmqpSender>` | `createSender(String address, AmqpSenderOptions options)` Like `createSender(String, AmqpSenderOptions, Handler)` but returns a `Future` of the asynchronous result
    `AmqpConnection` | `createSender(String address, AmqpSenderOptions options, Handler<AsyncResult<AmqpSender>> completionHandler)` Creates a sender used to send messages to the given address.
    `AmqpConnection` | `createSender(String address, Handler<AsyncResult<AmqpSender>> completionHandler)` Creates a sender used to send messages to the given address.
    `AmqpConnection` | `exceptionHandler(Handler<Throwable> handler)` Registers a handler called on disconnection.
    `boolean` | `isDisconnected()`

- - ### Method Detail

    - #### exceptionHandler

          AmqpConnection exceptionHandler(Handler<Throwable> handler)

      Registers a handler called on disconnection.
      Parameters:
        `handler` - the exception handler.
      Returns:
        the connection

    - #### close

          AmqpConnection close(Handler<AsyncResult<Void>> done)

      Closes the AMQP connection, i.e. allows the Close frame to be emitted.
      Parameters:
        `done` - the close handler notified when the connection is closed. May be `null`.
      Returns:
        the connection

    - #### close

          Future<Void> close()

      Like `close(Handler)` but returns a `Future` of the asynchronous result

    - #### createReceiver

          AmqpConnection createReceiver(String address,
                                        Handler<AsyncResult<AmqpReceiver>> completionHandler)

      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.
      Parameters:
        `address` - The source address to attach the consumer to, must not be `null`
        `completionHandler` - the handler called with the receiver. The receiver has been opened.
      Returns:
        the connection.

    - #### createReceiver

          Future<AmqpReceiver> createReceiver(String address)

      Like `createReceiver(String, Handler)` but returns a `Future` of the asynchronous result

    - #### createReceiver

          AmqpConnection createReceiver(String address,
                                        AmqpReceiverOptions receiverOptions,
                                        Handler<AsyncResult<AmqpReceiver>> completionHandler)

      Creates a receiver used to consumer messages from the given address.
      Parameters:
        `address` - The source address to attach the consumer to.
        `receiverOptions` - The options for this receiver.
        `completionHandler` - The handler called with the receiver, once opened. Note that the `messageHandler` can be called before the `completionHandler` if messages are awaiting delivery.
      Returns:
        the connection.

    - #### createReceiver

          Future<AmqpReceiver> createReceiver(String address,
                                              AmqpReceiverOptions receiverOptions)

      Like `createReceiver(String, AmqpReceiverOptions, Handler)` but returns a `Future` of the asynchronous result

    - #### createDynamicReceiver

          AmqpConnection createDynamicReceiver(Handler<AsyncResult<AmqpReceiver>> completionHandler)

      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.
      Parameters:
        `completionHandler` - the completion handler, called when the receiver has been created and opened.
      Returns:
        the connection.

    - #### createDynamicReceiver

          Future<AmqpReceiver> createDynamicReceiver()

      Like `createDynamicReceiver(Handler)` but returns a `Future` of the asynchronous result

    - #### createSender

          AmqpConnection createSender(String address,
                                      Handler<AsyncResult<AmqpSender>> completionHandler)

      Creates a sender used to send messages to the given address. The address must be set. For anonymous sender, check `createAnonymousSender(Handler)`.
      Parameters:
        `address` - The target address to attach to, must not be `null`
        `completionHandler` - The handler called with the sender, once opened
      Returns:
        the connection.
      See Also:
        `createAnonymousSender(Handler)`

    - #### createSender

          Future<AmqpSender> createSender(String address)

      Like `createSender(String, Handler)` but returns a `Future` of the asynchronous result

    - #### createSender

          AmqpConnection createSender(String address,
                                      AmqpSenderOptions options,
                                      Handler<AsyncResult<AmqpSender>> completionHandler)

      Creates a sender used to send messages to the given address. The address must be set. For anonymous sender, check `createAnonymousSender(Handler)`.
      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
        `completionHandler` - The handler called with the sender, once opened
      Returns:
        the connection.
      See Also:
        `createAnonymousSender(Handler)`

    - #### createSender

          Future<AmqpSender> createSender(String address,
                                          AmqpSenderOptions options)

      Like `createSender(String, AmqpSenderOptions, Handler)` but returns a `Future` of the asynchronous result

    - #### createAnonymousSender

          AmqpConnection createAnonymousSender(Handler<AsyncResult<AmqpSender>> completionHandler)

      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.

      Parameters:
        `completionHandler` - The handler called with the created sender, once opened
      Returns:
        the connection.

    - #### createAnonymousSender

          Future<AmqpSender> createAnonymousSender()

      Like `createAnonymousSender(Handler)` but returns a `Future` of the asynchronous result

    - #### isDisconnected

          boolean isDisconnected()

      Returns:
        whether the connection has been disconnected.

Copyright © 2020 Eclipse. All rights reserved.