io.vertx.amqpbridge

## Interface AmqpBridge

-     public interface AmqpBridge

  Vert.x AMQP Bridge. Facilitates sending and receiving AMQP 1.0 messages.

- - ### Method Summary

    All Methods Static Methods Instance Methods Abstract Methods Default Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `close(Handler<AsyncResult<Void>> resultHandler)` Shuts the bridge down, closing the underlying connection.
    `static AmqpBridge` | `create(Vertx vertx)` Creates a Bridge.
    `static AmqpBridge` | `create(Vertx vertx, AmqpBridgeOptions options)` Creates a Bridge with the given options.
    `<T> MessageConsumer<T>` | `createConsumer(String amqpAddress)` Creates a consumer on the given AMQP address.
    `<T> MessageProducer<T>` | `createProducer(String amqpAddress)` Creates a producer to the given AMQP address.
    `void` | `endHandler(Handler<Void> endHandler)` Set an end handler.
    `void` | `start(String hostname, int port, Handler<AsyncResult<AmqpBridge>> resultHandler)` Starts the bridge, establishing the underlying connection.
    `void` | `start(String hostname, int port, String username, String password, Handler<AsyncResult<AmqpBridge>> resultHandler)` Starts the bridge, establishing the underlying connection.

- - ### Method Detail

    - #### create

          static AmqpBridge create(Vertx vertx)

      Creates a Bridge.
      Parameters:
        `vertx` - the vertx instance to use
      Returns:
        the (not-yet-started) bridge.

    - #### create

          static AmqpBridge create(Vertx vertx,
                                   AmqpBridgeOptions options)

      Creates a Bridge with the given options.
      Parameters:
        `vertx` - the vertx instance to use
        `options` - the options
      Returns:
        the (not-yet-started) bridge.

    - #### start

          void start(String hostname,
                     int port,
                     String username,
                     String password,
                     Handler<AsyncResult<AmqpBridge>> resultHandler)

      Starts the bridge, establishing the underlying connection.
      Parameters:
        `hostname` - the host name to connect to
        `port` - the port to connect to
        `username` - the username
        `password` - the password
        `resultHandler` - the result handler

    - #### start

          void start(String hostname,
                     int port,
                     Handler<AsyncResult<AmqpBridge>> resultHandler)

      Starts the bridge, establishing the underlying connection.
      Parameters:
        `hostname` - the host name to connect to
        `port` - the port to connect to
        `resultHandler` - the result handler

    - #### createConsumer

          <T> MessageConsumer<T> createConsumer(String amqpAddress)
                                         throws IllegalStateException

      Creates a consumer on the given AMQP address. This method MUST be called from the bridge Context thread, as used in the result handler callback from the start methods. The bridge MUST be successfully started before the method is called.
      Parameters:
        `amqpAddress` - the address to consume from
      Returns:
        the consumer
      Throws:
        `IllegalStateException` - if the bridge was not started or the method is invoked on a thread other than the bridge Context thread, as used in the result handler callback from the start methods.

    - #### createProducer

          <T> MessageProducer<T> createProducer(String amqpAddress)
                                         throws IllegalStateException

      Creates a producer to the given AMQP address. This method MUST be called from the bridge Context thread, as used in the result handler callback from the start methods. The bridge MUST be successfully started before the method is called.
      Parameters:
        `amqpAddress` - the address to produce to
      Returns:
        the producer
      Throws:
        `IllegalStateException` - if the bridge was not started or the method is invoked on a thread other than the bridge Context thread, as used in the result handler callback from the start methods.

    - #### close

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

      Shuts the bridge down, closing the underlying connection.
      Parameters:
        `resultHandler` - the result handler

    - #### endHandler

          void endHandler(Handler<Void> endHandler)

      Set an end handler. This will fire if the underlying connection is unexpectedly disconnected or remotely closed.
      Parameters:
        `endHandler` - the handler

Copyright © 2022 Eclipse. All rights reserved.