io.vertx.amqp

## Interface AmqpClient

-     public interface AmqpClient

  AMQP Client entry point. Use this interface to create an instance of `AmqpClient` and connect to a broker and server.

- - ### Method Summary

    All Methods Static Methods Instance Methods Abstract Methods Default Methods Deprecated Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `close(Handler<AsyncResult<Void>> closeHandler)` Closes the client.
    `AmqpClient` | `connect(Handler<AsyncResult<AmqpConnection>> connectionHandler)` Connects to the AMQP broker or router.
    `static AmqpClient` | `create(AmqpClientOptions options)` Creates a new instance of `AmqpClient` using an internal Vert.x instance (with default configuration) and the given AMQP client configuration.
    `static AmqpClient` | `create(Vertx vertx, AmqpClientOptions options)` Creates a new instance of `AmqpClient` with the given Vert.x instance and the given options.
    `AmqpClient` | `createReceiver(String address, AmqpReceiverOptions receiverOptions, Handler<AmqpMessage> messageHandler, Handler<AsyncResult<AmqpReceiver>> completionHandler)` Deprecated. use instead `createReceiver(String, AmqpReceiverOptions, Handler)` and then use `AmqpReceiver.handler(io.vertx.core.Handler<io.vertx.amqp.AmqpMessage>)`
    `AmqpClient` | `createReceiver(String address, AmqpReceiverOptions receiverOptions, Handler<AsyncResult<AmqpReceiver>> completionHandler)` Creates a receiver used to consumer messages from the given address.
    `AmqpClient` | `createReceiver(String address, Handler<AmqpMessage> messageHandler, Handler<AsyncResult<AmqpReceiver>> completionHandler)` Deprecated. use instead `createReceiver(String, Handler)` and then use `AmqpReceiver.handler(io.vertx.core.Handler<io.vertx.amqp.AmqpMessage>)`
    `AmqpClient` | `createReceiver(String address, Handler<AsyncResult<AmqpReceiver>> completionHandler)` Creates a receiver used to consume messages from the given address.
    `AmqpClient` | `createSender(String address, AmqpSenderOptions options, Handler<AsyncResult<AmqpSender>> completionHandler)` Creates a sender used to send messages to the given address.
    `AmqpClient` | `createSender(String address, Handler<AsyncResult<AmqpSender>> completionHandler)` Creates a sender used to send messages to the given address.

- - ### Method Detail

    - #### create

          static AmqpClient create(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

          static AmqpClient create(Vertx vertx,
                                   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

    - #### connect

          AmqpClient connect(Handler<AsyncResult<AmqpConnection>> connectionHandler)

      Connects to the AMQP broker or router. The location is specified in the `AmqpClientOptions` as well as the potential credential required.
      Parameters:
        `connectionHandler` - handler that will process the result, giving either the connection or failure cause. Must not be `null`.

    - #### close

          void close(Handler<AsyncResult<Void>> closeHandler)

      Closes the client. The client must always be closed once not needed anymore.
      Parameters:
        `closeHandler` - the close handler notified when the operation completes. It can be `null`.

    - #### createReceiver

          AmqpClient 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. This method avoids having to connect explicitly. You can retrieve the connection using `AmqpReceiver.connection()`.
      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 client.

    - #### createReceiver

          @Deprecated
          AmqpClient createReceiver(String address,
                                                Handler<AmqpMessage> messageHandler,
                                                Handler<AsyncResult<AmqpReceiver>> completionHandler)

      Deprecated. use instead `createReceiver(String, Handler)` and then use `AmqpReceiver.handler(io.vertx.core.Handler<io.vertx.amqp.AmqpMessage>)`
      Creates a receiver used to consume messages from the given address. This method avoids having to connect explicitly. You can retrieve the connection using `AmqpReceiver.connection()`.
      Parameters:
        `address` - The source address to attach the consumer to, must not be `null`
        `messageHandler` - The message handler, must not be `null`
        `completionHandler` - the handler called with the receiver that has been opened. Note that the `messageHandler` can be called before the `completionHandler` if messages are awaiting delivery.
      Returns:
        the client.

    - #### createReceiver

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

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

          @Deprecated
          AmqpClient createReceiver(String address,
                                                AmqpReceiverOptions receiverOptions,
                                                Handler<AmqpMessage> messageHandler,
                                                Handler<AsyncResult<AmqpReceiver>> completionHandler)

      Deprecated. use instead `createReceiver(String, AmqpReceiverOptions, Handler)` and then use `AmqpReceiver.handler(io.vertx.core.Handler<io.vertx.amqp.AmqpMessage>)`
      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()`.
      Parameters:
        `address` - The source address to attach the consumer to.
        `receiverOptions` - The options for this receiver.
        `messageHandler` - The message handler, must not be `null`
        `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.

    - #### createSender

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

      Creates a sender used to send messages to the given address. The address must be set.
      Parameters:
        `address` - The target address to attach to, must not be `null`
        `completionHandler` - The handler called with the sender, once opened
      Returns:
        the client.

    - #### createSender

          AmqpClient 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.
      Parameters:
        `address` - The target address to attach to, must not be `null`
        `options` - The options for this sender.
        `completionHandler` - The handler called with the sender, once opened
      Returns:
        the client.

Copyright © 2019 Eclipse. All rights reserved.