Last updated: 2020-02-26 20:48:47PDF
CMQ provides messaging capabilities similar to kafka rewind. Using message rewind, you can re-consume deleted messages after the business successfully consumes and deletes messages. This function is convenient for core financial business to do business reconciliation, business system retry and other operations.
As shown in the figure above, the life cycle of the message is the fragment in the blue box. When the message rewind ability is enabled, messages that have been consumed by consumers and confirmed to be deleted will enter The news can be rewind Zone, the CMQ backend will also save this information. However, when a message exceeds the message life cycle of Queue (assuming 1 day), when it reaches its life cycle, the message will be deleted automatically, not rewind. The specific product logic is as follows:
- ** Enable: ** If the message rewind feature is not enabled, the message that the consumer has consumed and confirmed to be deleted will be deleted immediately. When this feature is enabled, the rewind cycle of rewind must be specified, but the range of rewind cycle must be less than or equal to the life cycle of the message.
Milestone: Based on the above policy, after the message rewind is enabled, the number of rewindable messages will increase as messages are repeatedly consumed and deleted by the consumer.
Disabling: If the message rewind is disabled, the messages in the "message for rewind" zone will be deleted immediately and cannot be rewound.
- ** Queue Properties: ** Message rewind is an attribute of Queue, which can be set at creation time or at the place where the configuration is modified. After appointing point in time of rewind (rewind), all consumers will spend money from the news of point in time.
** Billing: ** After the message rewind is enabled, rewindable message will generate some retention fees. The unit price will be calculated together with the message retention fee.
** Designate rewind point in time: ** When consumers initiate rewind consumption, they need to specify Queue Name and specific rewind time. And from the farthest point in time, back to rewind. Time is key, irreversible consumption. As shown in the figure, you can only consume from timeA to timeB/timeC, and reverse consumption is not supported.
** Specify rewind time range: ** Within 0-15 days, the deleted messages can only be deleted by rewind after this capability is enabled on the console. Key applications are recommended to enable the ability of rewind to send messages for a long time. And the message rewind cycle is set to be consistent with the message life cycle.
The retained messages cannot be specified for rewind: If a message is retained and not consumed, you cannot specify a specific location for consumption.
Max can be rewind point in time = current time-the length of rewind that can be set. The message production time before this value can not be rewind, and then can rewind, as shown in the following figure:
Message rewind The messages for rewind will be sorted based on their production time rather than the deletion time.