rmqlite
v1.0.1
Published
Lite lib for RabbitMQ
Downloads
29
Readme
RabbitMQ
- RabbitMQ
- ~Message
- .toString() ⇒ String
- .toJSON() ⇒ Object
- .ack() ⇒ deliveryTag
- ~RabbitMQ
- ~MessageHandler : function
- ~Message
RabbitMQ~Message
Message
Kind: inner class of RabbitMQ
- ~Message
- .toString() ⇒ String
- .toJSON() ⇒ Object
- .ack() ⇒ deliveryTag
message.toString() ⇒ String
Return data as string
Kind: instance method of Message
Returns: String - - message data
message.toJSON() ⇒ Object
Return data as object (Using JSON.parse)
Kind: instance method of Message
Returns: Object - - message data
message.ack() ⇒ deliveryTag
Ack message
Kind: instance method of Message
Returns: deliveryTag - - Delivery tag
RabbitMQ~RabbitMQ
Kind: inner class of RabbitMQ
new RabbitMQ(exchanger, queue, [queueOptions], [exchangerOptions])
| Param | Type | Default | Description | | --- | --- | --- | --- | | exchanger | string | | exchanger name | | queue | string | | queue name | | [queueOptions] | object | | queue options | see this | | [queueOptions.bind] | boolean | true | bind to exchanger by queue name | | [queueOptions.assert] | boolean | true | assert queue | | [exchangerOptions] | object | | exchange options | see this |
rabbitMQ.subscribe(callback, [ack], [options]) ⇒ Promise
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 | | | See this |
rabbitMQ.unsubscribe() ⇒ Promise
Unsubscribe from queue
Kind: instance method of RabbitMQ
rabbitMQ.publish(message, [routingKey]) ⇒ Promise
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 | See this and 'connect' event | | cb | function | callback function |
RabbitMQ.reconnect()
Reconnect to RabbitMQ server and resubscribe and bind all queue
Kind: static method of RabbitMQ
RabbitMQ~MessageHandler : function
Kind: inner typedef of RabbitMQ
| Param | Type | Description | | --- | --- | --- | | message | Message | incoming message |