Messages can be deduplicated to prevent duplicate messages from being sent. When a duplicate message is detected, it is accepted by QStash but not enqueued. This can be useful when the connection between your service and QStash fails, and you never receive the acknowledgement. You can simply retry publishing and can be sure that the message will enqueued only once. In case a message is a duplicate, we will accept the request and return the messageID of the existing message. The only difference will be the response status code. We’ll send HTTPDocumentation Index
Fetch the complete documentation index at: https://upstash.com/docs/llms.txt
Use this file to discover all available pages before exploring further.
202 Accepted code in case of a duplicate message.
Deduplication ID
To deduplicate a message, you can send theUpstash-Deduplication-Id header
when publishing the message.
Content Based Deduplication
If you want to deduplicate messages automatically, you can set theUpstash-Content-Based-Deduplication header to true.
- Destination: The URL Group or endpoint you are publishing the message to.
- Body: The body of the message.
-
Header: This includes the
Content-Typeheader and all headers, that you forwarded with theUpstash-Forward-prefix. See custom HTTP headers section.
The deduplication window is 10 minutes. After that, messages with the same ID or content can be sent again.