# Class: RabbitMQClient

## vertx-rabbitmq-js/rabbit_mq_client~ RabbitMQClient

#### new RabbitMQClient()

Source:
  - vertx-rabbitmq-js/rabbit_mq_client.js, line 29

### Methods

#### basicAck(deliveryTag, multiple, resultHandler)

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.

##### Parameters:

Name | Type | Description
--- | --- | ---
`deliveryTag` | number |
`multiple` | boolean |
`resultHandler` | function |

Source:
  - vertx-rabbitmq-js/rabbit_mq_client.js, line 43

#### basicConsume(queue, address, autoAck, resultHandler, errorHandler)

Start a non-nolocal, non-exclusive consumer, with a server-generated consumerTag and error handler

##### Parameters:

Name | Type | Description
--- | --- | ---
`queue` | string |
`address` | string |
`autoAck` | boolean |
`resultHandler` | function |
`errorHandler` | function |

Source:
  - vertx-rabbitmq-js/rabbit_mq_client.js, line 109

#### basicGet(queue, autoAck, resultHandler)

Retrieve a message from a queue using AMQP.Basic.Get

##### Parameters:

Name | Type | Description
--- | --- | ---
`queue` | string |
`autoAck` | boolean |
`resultHandler` | function |

Source:
  - vertx-rabbitmq-js/rabbit_mq_client.js, line 86

#### basicNack(deliveryTag, multiple, requeue, resultHandler)

Reject one or several received messages.

##### Parameters:

Name | Type | Description
--- | --- | ---
`deliveryTag` | number |
`multiple` | boolean |
`requeue` | boolean |
`resultHandler` | function |

Source:
  - vertx-rabbitmq-js/rabbit_mq_client.js, line 65

#### basicPublish(exchange, routingKey, message, resultHandler)

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.

##### Parameters:

Name | Type | Description
--- | --- | ---
`exchange` | string |
`routingKey` | string |
`message` | Object |
`resultHandler` | function |

Source:
  - vertx-rabbitmq-js/rabbit_mq_client.js, line 150

#### basicQos(prefetchCount, resultHandler)

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.

##### Parameters:

Name | Type | Description
--- | --- | ---
`prefetchCount` | number |
`resultHandler` | function |

Source:
  - vertx-rabbitmq-js/rabbit_mq_client.js, line 219

#### confirmSelect(resultHandler)

Enables publisher acknowledgements on this channel. Can be called once during client initialisation. Calls to basicPublish() will have to be confirmed.

##### Parameters:

Name | Type | Description
--- | --- | ---
`resultHandler` | function |

Source:
  - vertx-rabbitmq-js/rabbit_mq_client.js, line 170

#### exchangeBind(destination, source, routingKey, resultHandler)

Bind an exchange to an exchange.

##### Parameters:

Name | Type | Description
--- | --- | ---
`destination` | string |
`source` | string |
`routingKey` | string |
`resultHandler` | function |

Source:
  - vertx-rabbitmq-js/rabbit_mq_client.js, line 293

#### exchangeDeclare(exchange, type, durable, autoDelete, config, resultHandler)

Declare an exchange with additional parameters such as dead lettering or an alternate exchnage.

##### Parameters:

Name | Type | Description
--- | --- | ---
`exchange` | string |
`type` | string |
`durable` | boolean |
`autoDelete` | boolean |
`config` | Array.<string> |
`resultHandler` | function |

Source:
  - vertx-rabbitmq-js/rabbit_mq_client.js, line 243

#### exchangeDelete(exchange, resultHandler)

Delete an exchange, without regard for whether it is in use or not.

##### Parameters:

Name | Type | Description
--- | --- | ---
`exchange` | string |
`resultHandler` | function |

Source:
  - vertx-rabbitmq-js/rabbit_mq_client.js, line 271

#### exchangeUnbind(destination, source, routingKey, resultHandler)

Unbind an exchange from an exchange.

##### Parameters:

Name | Type | Description
--- | --- | ---
`destination` | string |
`source` | string |
`routingKey` | string |
`resultHandler` | function |

Source:
  - vertx-rabbitmq-js/rabbit_mq_client.js, line 315

#### isConnected() → {boolean}

Check if a connection is open

Source:
  - vertx-rabbitmq-js/rabbit_mq_client.js, line 508

##### Returns:

true when the connection is open, false otherwise

Type
  boolean

#### isOpenChannel() → {boolean}

Check if a channel is open

Source:
  - vertx-rabbitmq-js/rabbit_mq_client.js, line 522

##### Returns:

true when the connection is open, false otherwise

Type
  boolean

#### messageCount(queue, resultHandler)

Returns the number of messages in a queue ready to be delivered.

##### Parameters:

Name | Type | Description
--- | --- | ---
`queue` | string |
`resultHandler` | function |

Source:
  - vertx-rabbitmq-js/rabbit_mq_client.js, line 450

#### queueBind(queue, exchange, routingKey, resultHandler)

Bind a queue to an exchange

##### Parameters:

Name | Type | Description
--- | --- | ---
`queue` | string |
`exchange` | string |
`routingKey` | string |
`resultHandler` | function |

Source:
  - vertx-rabbitmq-js/rabbit_mq_client.js, line 430

#### queueDeclare(queue, durable, exclusive, autoDelete, config, resultHandler)

Declare a queue with config options

##### Parameters:

Name | Type | Description
--- | --- | ---
`queue` | string |
`durable` | boolean |
`exclusive` | boolean |
`autoDelete` | boolean |
`config` | Array.<string> |
`resultHandler` | function |

Source:
  - vertx-rabbitmq-js/rabbit_mq_client.js, line 358

#### queueDeclareAuto(resultHandler)

Actively declare a server-named exclusive, autodelete, non-durable queue.

##### Parameters:

Name | Type | Description
--- | --- | ---
`resultHandler` | function |

Source:
  - vertx-rabbitmq-js/rabbit_mq_client.js, line 334

#### queueDelete(queue, resultHandler)

Delete a queue, without regard for whether it is in use or has messages on it

##### Parameters:

Name | Type | Description
--- | --- | ---
`queue` | string |
`resultHandler` | function |

Source:
  - vertx-rabbitmq-js/rabbit_mq_client.js, line 386

#### queueDeleteIf(queue, ifUnused, ifEmpty, resultHandler)

Delete a queue

##### Parameters:

Name | Type | Description
--- | --- | ---
`queue` | string |
`ifUnused` | boolean |
`ifEmpty` | boolean |
`resultHandler` | function |

Source:
  - vertx-rabbitmq-js/rabbit_mq_client.js, line 408

#### start(resultHandler)

Start the rabbitMQ client. Create the connection and the chanel.

##### Parameters:

Name | Type | Description
--- | --- | ---
`resultHandler` | function |

Source:
  - vertx-rabbitmq-js/rabbit_mq_client.js, line 469

#### stop(resultHandler)

Stop the rabbitMQ client. Close the connection and its chanel.

##### Parameters:

Name | Type | Description
--- | --- | ---
`resultHandler` | function |

Source:
  - vertx-rabbitmq-js/rabbit_mq_client.js, line 488

#### waitForConfirms(timeout, resultHandler)

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.

##### Parameters:

Name | Type | Description
--- | --- | ---
`timeout` | number |
`resultHandler` | function |

Source:
  - vertx-rabbitmq-js/rabbit_mq_client.js, line 190