RabbitMQ
- RabbitMQ
- ~Message
- .toString() ⇒
String
- .toJSON() ⇒
Object
- .ack() ⇒
deliveryTag
- .toString() ⇒
- ~RabbitMQ
- new RabbitMQ(exchanger, queue, [queueOptions], [exchangerOptions])
- instance
- .subscribe(callback, [ack], [options]) ⇒
Promise
- .unsubscribe() ⇒
Promise
- .publish(message, [routingKey]) ⇒
Promise
- .bind(routingKeys) ⇒
*
- .unbind(routingKeys) ⇒
*
- .destroy()
- .subscribe(callback, [ack], [options]) ⇒
- static
- ~MessageHandler :
function
- ~Message
RabbitMQ~Message
Message
Kind: inner class of RabbitMQ
- ~Message
- .toString() ⇒
String
- .toJSON() ⇒
Object
- .ack() ⇒
deliveryTag
- .toString() ⇒
String
message.toString() ⇒ Return data as string
Kind: instance method of Message
Returns: String
- - message data
Object
message.toJSON() ⇒ Return data as object (Using JSON.parse)
Kind: instance method of Message
Returns: Object
- - message data
deliveryTag
message.ack() ⇒ Ack message
Kind: instance method of Message
Returns: deliveryTag
- - Delivery tag
RabbitMQ~RabbitMQ
Kind: inner class of RabbitMQ
- ~RabbitMQ
- new RabbitMQ(exchanger, queue, [queueOptions], [exchangerOptions])
- instance
- .subscribe(callback, [ack], [options]) ⇒
Promise
- .unsubscribe() ⇒
Promise
- .publish(message, [routingKey]) ⇒
Promise
- .bind(routingKeys) ⇒
*
- .unbind(routingKeys) ⇒
*
- .destroy()
- .subscribe(callback, [ack], [options]) ⇒
- static
new RabbitMQ(exchanger, queue, [queueOptions], [exchangerOptions])
Param | Type | Default | Description |
---|---|---|---|
exchanger | string |
exchanger name | |
queue | string |
queue name | |
[queueOptions] | object |
queue options [ | |
[queueOptions.bind] | boolean |
true |
bind to exchanger by queue name |
[queueOptions.assert] | boolean |
true |
assert queue |
[exchangerOptions] | object |
exchange options [ |
Promise
rabbitMQ.subscribe(callback, [ack], [options]) ⇒ Subscribe to queue
Kind: instance method of RabbitMQ
Param | Type | Default | Description |
---|---|---|---|
callback | MessageHandler |
message handler | |
[ack] | boolean |
false |
Acknowledge the given message |
[options] | object |
[ |
Promise
rabbitMQ.unsubscribe() ⇒ Unsubscribe from queue
Kind: instance method of RabbitMQ
Promise
rabbitMQ.publish(message, [routingKey]) ⇒ Publish message
Kind: instance method of RabbitMQ
Param | Type | Description |
---|---|---|
message | * |
message for publish |
[routingKey] | string |
publish with routingKey |
*
rabbitMQ.bind(routingKeys) ⇒ Bind queue to exchanger with routing key
Kind: instance method of RabbitMQ
Param | Type | Description |
---|---|---|
routingKeys | string | Array |
Routing keys |
*
rabbitMQ.unbind(routingKeys) ⇒ Unbind queue to exchanger with routing key
Kind: instance method of RabbitMQ
Param | Type | Description |
---|---|---|
routingKeys | string | Array |
Routing keys |
rabbitMQ.destroy()
Remove this object from EventEmmiter WARNING: This function must be called if you not used this object.
Kind: instance method of RabbitMQ
RabbitMQ.on(event, cb)
Kind: static method of RabbitMQ
Param | Type | Description |
---|---|---|
event | string |
event [ |
cb | function |
callback function |
RabbitMQ.reconnect()
Reconnect to RabbitMQ server and resubscribe and bind all queue
Kind: static method of RabbitMQ
function
RabbitMQ~MessageHandler : Kind: inner typedef of RabbitMQ
Param | Type | Description |
---|---|---|
message | Message |
incoming message |