new RabbitMQClient()
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 |
basicConsume(queue, address, autoAck, resultHandler)
Start a non-nolocal, non-exclusive consumer, with a server-generated consumerTag.
Parameters:
Name | Type | Description |
---|---|---|
queue |
string | |
address |
string | |
autoAck |
boolean | |
resultHandler |
function |
basicGet(queue, autoAck, resultHandler)
Retrieve a message from a queue using AMQP.Basic.Get
Parameters:
Name | Type | Description |
---|---|---|
queue |
string | |
autoAck |
boolean | |
resultHandler |
function |
basicNack(deliveryTag, multiple, requeue, resultHandler)
Reject one or several received messages.
Parameters:
Name | Type | Description |
---|---|---|
deliveryTag |
number | |
multiple |
boolean | |
requeue |
boolean | |
resultHandler |
function |
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 |
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 |
exchangeBind(destination, source, routingKey, resultHandler)
Bind an exchange to an exchange.
Parameters:
Name | Type | Description |
---|---|---|
destination |
string | |
source |
string | |
routingKey |
string | |
resultHandler |
function |
exchangeDeclare(exchange, type, durable, autoDelete, resultHandler)
Declare an exchange.
Parameters:
Name | Type | Description |
---|---|---|
exchange |
string | |
type |
string | |
durable |
boolean | |
autoDelete |
boolean | |
resultHandler |
function |
exchangeDelete(exchange, resultHandler)
Delete an exchange, without regard for whether it is in use or not.
Parameters:
Name | Type | Description |
---|---|---|
exchange |
string | |
resultHandler |
function |
exchangeUnbind(destination, source, routingKey, resultHandler)
Unbind an exchange from an exchange.
Parameters:
Name | Type | Description |
---|---|---|
destination |
string | |
source |
string | |
routingKey |
string | |
resultHandler |
function |
isConnected() → {boolean}
Check if a connection is open
Returns:
true when the connection is open, false otherwise
- Type
- boolean
isOpenChannel() → {boolean}
Check if a channel is open
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 |
queueBind(queue, exchange, routingKey, resultHandler)
Bind a queue to an exchange
Parameters:
Name | Type | Description |
---|---|---|
queue |
string | |
exchange |
string | |
routingKey |
string | |
resultHandler |
function |
queueDeclare(queue, durable, exclusive, autoDelete, resultHandler)
Declare a queue
Parameters:
Name | Type | Description |
---|---|---|
queue |
string | |
durable |
boolean | |
exclusive |
boolean | |
autoDelete |
boolean | |
resultHandler |
function |
queueDeclareAuto(resultHandler)
Actively declare a server-named exclusive, autodelete, non-durable queue.
Parameters:
Name | Type | Description |
---|---|---|
resultHandler |
function |
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 |
queueDeleteIf(queue, ifUnused, ifEmpty, resultHandler)
Delete a queue
Parameters:
Name | Type | Description |
---|---|---|
queue |
string | |
ifUnused |
boolean | |
ifEmpty |
boolean | |
resultHandler |
function |
start(resultHandler)
Start the rabbitMQ client. Create the connection and the chanel.
Parameters:
Name | Type | Description |
---|---|---|
resultHandler |
function |
stop(resultHandler)
Stop the rabbitMQ client. Close the connection and its chanel.
Parameters:
Name | Type | Description |
---|---|---|
resultHandler |
function |