RedisClient

module:queue. RedisClient

Queue client based on Redis server using https://github.com/NodeRedis/node_redis3

The queue client implements reliable queue using sorted sets, one for the new messages and one for the messages that are being processed if timeout is provided. With the timeout this queue works similar to AWS SQS.

Constructor

new RedisClient()

Source:
Parameters:
Name Type Attributes Description
options.interval int <optional>

config property defines in ms how often to check for new messages after processing a message, i.e. after a messages processed it can poll immediately or after this amount of time

options.retryInterval int <optional>

config property defines in ms how often to check for new messages after an error or no data, i.e. on empty pool when no messages are processed it can poll immediately or after this amount of time

options.visibilityTimeout int <optional>

property specifies to use a shadow queue where all messages that are being processed are stored, while the message is processed the timestamp will be updated so the message stays in the queue, if a worker exists or crashes without confirming the message finished it will be put back into the work queue after visibilityTimeout milliseconds. The queue name that keeps active messages is appended with #.

options.threshold int <optional>

property defines the upper limit of how many active messages can be in the queue when to show an error message, this is for monitoring queue performance

options.tls boolean | int | object <optional>

can be true or 1 to just enable default TLS properties

Example
-queue-default=redis://host1
 -queue-default-options-interval=1000
 -queue-redis=redis://host1?bk-visibilityTimeout=30000&bk-count=2
 -queue-default=redis://host1?bk-tls=1