# Class: RabbitMQClient

## vertx-rabbitmq-js/rabbit_mq_client~ RabbitMQClient

#### new RabbitMQClient()

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

### 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 44

#### 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 110

#### 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 87

#### 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 66

#### 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 151

#### 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 220

#### 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 171

#### 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 294

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

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

##### Parameters:

Name | Type | Description
--- | --- | ---
`exchange` | string |
`type` | string |
`durable` | boolean |
`autoDelete` | boolean |
`config` | Object |
`resultHandler` | function |

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

#### 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 272

#### 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 316

#### isConnected() → {boolean}

Check if a connection is open

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

##### 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 523

##### 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 451

#### 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 431

#### 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` | Object |
`resultHandler` | function |

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

#### 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 335

#### 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 387

#### 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 409

#### 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 470

#### 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 489

#### 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 191