Skip to content

Latest commit

 

History

History
34 lines (25 loc) · 1.9 KB

messages.md

File metadata and controls

34 lines (25 loc) · 1.9 KB

RedisSMQ / Docs / Messages

Messages

The ProducibleMessage Class handles application data, commonly known as the message payload, that can be delivered to a consumer for asynchronous processing.

The message payload can consist of any valid JSON data type. It may be as simple as a text message like Hello world or as complex as an object like { hello: 'world' }.

const { ProducibleMessage } = require('redis-smq');

const msg = new ProducibleMessage();
msg.setBody({ hello: 'world' })
  .setTTL(3600000) // Sets Time-To-Live to 1 hour
  .setRetryThreshold(5); // Sets maximum retries to 5

The ProducibleMessage Class offers a variety of methods to configure different delivery and consumption parameters, including message priority, time-to-live (TTL), and retry threshold.

For more details, refer to the following resources:

By utilizing these classes effectively, you can optimize message handling and improve the efficiency of your application's asynchronous processing.