Class: RabbitMQClient

vertx-rabbitmq-js/rabbit_mq_client~ RabbitMQClient

new RabbitMQClient()

Source:

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:

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:

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:

basicNack(deliveryTag, multiple, requeue, resultHandler)

Reject one or several received messages.
Parameters:
Name Type Description
deliveryTag number
multiple boolean
requeue boolean
resultHandler function
Source:

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:

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:

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:

exchangeBind(destination, source, routingKey, resultHandler)

Bind an exchange to an exchange.
Parameters:
Name Type Description
destination string
source string
routingKey string
resultHandler function
Source:

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:

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:

exchangeUnbind(destination, source, routingKey, resultHandler)

Unbind an exchange from an exchange.
Parameters:
Name Type Description
destination string
source string
routingKey string
resultHandler function
Source:

isConnected() → {boolean}

Check if a connection is open
Source:
Returns:
true when the connection is open, false otherwise
Type
boolean

isOpenChannel() → {boolean}

Check if a channel is open
Source:
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:

queueBind(queue, exchange, routingKey, resultHandler)

Bind a queue to an exchange
Parameters:
Name Type Description
queue string
exchange string
routingKey string
resultHandler function
Source:

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:

queueDeclareAuto(resultHandler)

Actively declare a server-named exclusive, autodelete, non-durable queue.
Parameters:
Name Type Description
resultHandler function
Source:

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:

queueDeleteIf(queue, ifUnused, ifEmpty, resultHandler)

Delete a queue
Parameters:
Name Type Description
queue string
ifUnused boolean
ifEmpty boolean
resultHandler function
Source:

start(resultHandler)

Start the rabbitMQ client. Create the connection and the chanel.
Parameters:
Name Type Description
resultHandler function
Source:

stop(resultHandler)

Stop the rabbitMQ client. Close the connection and its chanel.
Parameters:
Name Type Description
resultHandler function
Source:

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: