Skip to content

Latest commit

 

History

History
117 lines (68 loc) · 2.78 KB

ConsumerGroups.md

File metadata and controls

117 lines (68 loc) · 2.78 KB

RedisSMQ / Docs / API Reference / ConsumerGroups

Class: 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.

Table of contents

Constructors

Methods

Constructors

constructor

new ConsumerGroups(): ConsumerGroups

Returns

ConsumerGroups

Methods

deleteConsumerGroup

deleteConsumerGroup(queue, groupId, cb): void

Delete Consumer Group

Deletes a consumer group from a specific queue.

Parameters

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.

Returns

void


getConsumerGroups

getConsumerGroups(queue, cb): void

Get Consumer Groups

Retrieves a list of consumer group IDs associated with a specific queue.

Parameters

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.

Returns

void


saveConsumerGroup

saveConsumerGroup(queue, groupId, cb): void

Save Consumer Group

Saves a consumer group to a specific queue.

Parameters

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.

Returns

void


shutdown

shutdown(cb): void

Shutdown

Shuts down the consumer groups manager and cleans up resources.

Parameters

Name Type Description
cb ICallback<void> Callback function to handle the result of the shutdown operation.

Returns

void