vertx / io.vertx.rabbitmq / RabbitMQClient

# RabbitMQClient

`interface RabbitMQClient`

Author
Nick Scavelli

### Functions

basicAck | `abstract fun basicAck(deliveryTag: Long, multiple: Boolean, resultHandler: Handler<AsyncResult<JsonObject>>): Unit` Acknowledge one or several received messages. Supply the deliveryTag from the AMQP.Basic.GetOk or AMQP.Basic.Deliver method containing the received message being acknowledged.
basicConsume | `abstract fun basicConsume(queue: String, address: String, resultHandler: Handler<AsyncResult<Void>>): Unit` Start a non-nolocal, non-exclusive consumer, with auto acknowledgement and a server-generated consumerTag. `abstract fun basicConsume(queue: String, address: String, autoAck: Boolean, resultHandler: Handler<AsyncResult<Void>>): Unit` Start a non-nolocal, non-exclusive consumer, with a server-generated consumerTag. `abstract fun basicConsume(queue: String, address: String, autoAck: Boolean, resultHandler: Handler<AsyncResult<Void>>, errorHandler: Handler<Throwable>): Unit` Start a non-nolocal, non-exclusive consumer, with a server-generated consumerTag and error handler
basicGet | `abstract fun basicGet(queue: String, autoAck: Boolean, resultHandler: Handler<AsyncResult<JsonObject>>): Unit` Retrieve a message from a queue using AMQP.Basic.Get
basicNack | `abstract fun basicNack(deliveryTag: Long, multiple: Boolean, requeue: Boolean, resultHandler: Handler<AsyncResult<JsonObject>>): Unit` Reject one or several received messages.
basicPublish | `abstract fun basicPublish(exchange: String, routingKey: String, message: JsonObject, resultHandler: Handler<AsyncResult<Void>>): Unit` Publish a message. Publishing to a non-existent exchange will result in a channel-level protocol exception, which closes the channel. Invocations of Channel#basicPublish will eventually block if a resource-driven alarm is in effect.
basicQos | `abstract fun basicQos(prefetchCount: Int, resultHandler: Handler<AsyncResult<Void>>): Unit` Request specific "quality of service" settings, Limiting the number of unacknowledged messages on a channel (or connection). This limit is applied separately to each new consumer on the channel.
confirmSelect | `abstract fun confirmSelect(resultHandler: Handler<AsyncResult<Void>>): Unit` Enables publisher acknowledgements on this channel. Can be called once during client initialisation. Calls to basicPublish() will have to be confirmed.
create | `open static fun create(vertx: Vertx, config: RabbitMQOptions): RabbitMQClient` Create and return a client. `open static fun create(vertx: Vertx, config: JsonObject): RabbitMQClient` Like `#create(Vertx, RabbitMQOptions)` but with a JsonObject config object.
exchangeBind | `abstract fun exchangeBind(destination: String, source: String, routingKey: String, resultHandler: Handler<AsyncResult<Void>>): Unit` Bind an exchange to an exchange.
exchangeDeclare | `abstract fun exchangeDeclare(exchange: String, type: String, durable: Boolean, autoDelete: Boolean, resultHandler: Handler<AsyncResult<Void>>): Unit` Declare an exchange. `abstract fun exchangeDeclare(exchange: String, type: String, durable: Boolean, autoDelete: Boolean, config: JsonObject, resultHandler: Handler<AsyncResult<Void>>): Unit` Declare an exchange with additional parameters such as dead lettering, an alternate exchange or TTL.
exchangeDelete | `abstract fun exchangeDelete(exchange: String, resultHandler: Handler<AsyncResult<Void>>): Unit` Delete an exchange, without regard for whether it is in use or not.
exchangeUnbind | `abstract fun exchangeUnbind(destination: String, source: String, routingKey: String, resultHandler: Handler<AsyncResult<Void>>): Unit` Unbind an exchange from an exchange.
isConnected | `abstract fun isConnected(): Boolean` Check if a connection is open
isOpenChannel | `abstract fun isOpenChannel(): Boolean` Check if a channel is open
messageCount | `abstract fun messageCount(queue: String, resultHandler: Handler<AsyncResult<JsonObject>>): Unit` Returns the number of messages in a queue ready to be delivered.
queueBind | `abstract fun queueBind(queue: String, exchange: String, routingKey: String, resultHandler: Handler<AsyncResult<Void>>): Unit` Bind a queue to an exchange
queueDeclare | `abstract fun queueDeclare(queue: String, durable: Boolean, exclusive: Boolean, autoDelete: Boolean, resultHandler: Handler<AsyncResult<JsonObject>>): Unit` Declare a queue `abstract fun queueDeclare(queue: String, durable: Boolean, exclusive: Boolean, autoDelete: Boolean, config: JsonObject, resultHandler: Handler<AsyncResult<JsonObject>>): Unit` Declare a queue with config options
queueDeclareAuto | `abstract fun queueDeclareAuto(resultHandler: Handler<AsyncResult<JsonObject>>): Unit` Actively declare a server-named exclusive, autodelete, non-durable queue.
queueDelete | `abstract fun queueDelete(queue: String, resultHandler: Handler<AsyncResult<JsonObject>>): Unit` Delete a queue, without regard for whether it is in use or has messages on it
queueDeleteIf | `abstract fun queueDeleteIf(queue: String, ifUnused: Boolean, ifEmpty: Boolean, resultHandler: Handler<AsyncResult<JsonObject>>): Unit` Delete a queue
start | `abstract fun start(resultHandler: Handler<AsyncResult<Void>>): Unit` Start the rabbitMQ client. Create the connection and the chanel.
stop | `abstract fun stop(resultHandler: Handler<AsyncResult<Void>>): Unit` Stop the rabbitMQ client. Close the connection and its chanel.
waitForConfirms | `abstract fun waitForConfirms(resultHandler: Handler<AsyncResult<Void>>): Unit` Wait until all messages published since the last call have been either ack'd or nack'd by the broker. This will incur slight performance loss at the expense of higher write consistency. If desired, multiple calls to basicPublish() can be batched before confirming. `abstract fun waitForConfirms(timeout: Long, resultHandler: Handler<AsyncResult<Void>>): Unit` Wait until all messages published since the last call have been either ack'd or nack'd by the broker; or until timeout elapses. If the timeout expires a TimeoutException is thrown.