Delayed messages
This section describes what are delayed messages and how to create it.
Last updated
This section describes what are delayed messages and how to create it.
Last updated
All rights reserved to Memphis.dev 2023
Delayed messages allow you to send a received message back to the broker when your consumer application requires extra processing time.
What sets apart Memphis' implementation is the consumer's capability to control this delay independently and atomically.
Within the station, the count of unconsumed messages doesn't impact the consumption of delayed messages. For instance, if a 60-second delay is necessary, it precisely configures the invisibility time for that specific message.
A message is received by the consumer group.
An event occurs, prompting the consumer group to pause processing the message.
Assuming the maxMsgDeliveries
hasn't hit its limit, the consumer will activate message.delay(delayInMilliseconds)
, bypassing the message. Instead of immediately reprocessing the same message, the broker will retain it for the specified duration.
The subsequent message will be consumed.
Once the requested delayInMilliseconds
has passed, the broker will halt the primary message flow and reintroduce the delayed message into circulation.