RedisSMQ / Docs / API Reference / Message
The Message class provides methods for interacting with Redis-SMQ messages. It utilizes the RedisClientInstance to perform operations on Redis.
- deleteMessageById
- deleteMessagesByIds
- getMessageById
- getMessageState
- getMessageStatus
- getMessagesByIds
- requeueMessageById
- shutdown
• new Message(): Message
▸ deleteMessageById(id
, cb
): void
Deletes a message with the given ID.
Name | Type | Description |
---|---|---|
id |
string |
The ID of the message to delete. |
cb |
ICallback <void > |
A callback function that will be called with the result. If an error occurs, the first parameter will be an Error object. Otherwise, the second parameter will be undefined. |
void
▸ deleteMessagesByIds(ids
, cb
): void
Deletes messages with the given IDs.
Name | Type | Description |
---|---|---|
ids |
string [] |
An array of IDs of the messages to delete. |
cb |
ICallback <void > |
A callback function that will be called with the result. If an error occurs, the first parameter will be an Error object. Otherwise, the second parameter will be undefined. |
void
▸ getMessageById(messageId
, cb
): void
Retrieves a message with the given ID.
Name | Type | Description |
---|---|---|
messageId |
string |
The ID of the message to retrieve. |
cb |
ICallback <IMessageTransferable > |
A callback function that will be called with the result. If an error occurs, the first parameter will be an Error object. Otherwise, the second parameter will be the message object. |
void
▸ getMessageState(messageId
, cb
): void
Retrieves the state of a message with the given ID.
Name | Type | Description |
---|---|---|
messageId |
string |
The ID of the message to retrieve the state for. |
cb |
ICallback <IMessageStateTransferable > |
A callback function that will be called with the result. If an error occurs, the first parameter will be an Error object. Otherwise, the second parameter will be the state of the message. |
void
▸ getMessageStatus(messageId
, cb
): void
Retrieves the status of a message with the given ID.
Name | Type | Description |
---|---|---|
messageId |
string |
The ID of the message to retrieve the status for. |
cb |
ICallback <EMessagePropertyStatus > |
A callback function that will be called with the result. If an error occurs, the first parameter will be an Error object. Otherwise, the second parameter will be the status of the message. |
void
▸ getMessagesByIds(messageIds
, cb
): void
Retrieves messages with the given IDs.
Name | Type | Description |
---|---|---|
messageIds |
string [] |
An array of IDs of the messages to retrieve. |
cb |
ICallback <IMessageTransferable []> |
A callback function that will be called with the result. If an error occurs, the first parameter will be an Error object. Otherwise, the second parameter will be an array of message objects. |
void
▸ requeueMessageById(messageId
, cb
): void
Requeues a message with the given ID.
Name | Type | Description |
---|---|---|
messageId |
string |
The ID of the message to requeue. |
cb |
ICallback <void > |
A callback function that will be called with the result. If an error occurs, the first parameter will be an Error object. Otherwise, the second parameter will be undefined. |
void
▸ shutdown(cb
): void
Shuts down the Redis client and performs cleanup operations.
Name | Type | Description |
---|---|---|
cb |
ICallback <void > |
A callback function that will be called with the result. If an error occurs, the first parameter will be an Error object. Otherwise, the second parameter will be undefined. |
void