ProducibleMessage Class
is responsible for carrying application data, sometimes referred to as message payload
, which may be delivered to a consumer to be processed asynchronously.
The message payload can be of any valid JSON data type. It may be a simple text message like Hello world
or a complex data type like {hello: 'world'}
.
const { ProducibleMessage } = require('redis-smq');
const msg = new ProducibleMessage();
msg.setBody({ hello: 'world' }).setTTL(3600000).setRetryThreshold(5);
The ProducibleMessage
class provides many methods for setting up different delivery/consumption parameters such as message priority, message TTL, retry threshold, etc.
See:
- ProducibleMessage Class - To set up various message parameters before publishing it;
- Message Class - To fetch/delete a message or a list of messages from a queue;
- QueueMessages Class - To manage queue messages;
- QueuePendingMessages Class - To manage queue pending messages
- QueueAcknowledgedMessages Class - To manage queue acknowledged messages
- QueueDeadLetteredMessages Class - To manage queue dead-lettered messages
- QueueScheduledMessages Class - To manage queue scheduled messages