RedisSMQ / Docs / API Reference / ConsumerGroups
ConsumerGroups Class
The ConsumerGroups
class is responsible for managing consumer groups within the RedisSMQ MQ.
It provides functionality to save, delete, and retrieve consumer groups associated with specific queues.
The class uses Redis as a backend and employs an event bus for managing events related to consumer groups.
• new ConsumerGroups(): ConsumerGroups
▸ deleteConsumerGroup(queue
, groupId
, cb
): void
Delete Consumer Group
Deletes a consumer group from a specific queue.
Name | Type | Description |
---|---|---|
queue |
string | IQueueParams |
The queue from which to delete the consumer group. |
groupId |
string |
The ID of the consumer group to delete. |
cb |
ICallback <void > |
Callback function to handle the result or error. |
void
▸ getConsumerGroups(queue
, cb
): void
Get Consumer Groups
Retrieves a list of consumer group IDs associated with a specific queue.
Name | Type | Description |
---|---|---|
queue |
string | IQueueParams |
The queue from which to retrieve consumer groups. |
cb |
ICallback <string []> |
Callback function to handle the result or error. |
void
▸ saveConsumerGroup(queue
, groupId
, cb
): void
Save Consumer Group
Saves a consumer group to a specific queue.
Name | Type | Description |
---|---|---|
queue |
string | IQueueParams |
The queue to which the consumer group belongs. |
groupId |
string |
The ID of the consumer group to save. |
cb |
ICallback <number > |
Callback function to handle the result or error. |
void
▸ shutdown(cb
): void
Shutdown
Shuts down the consumer groups manager and cleans up resources.
Name | Type | Description |
---|---|---|
cb |
ICallback <void > |
Callback function to handle the result of the shutdown operation. |
void