upstash / qstash-js

Message queue for serverless
https://docs.upstash.com/qstash
MIT License
135 stars 12 forks source link

Retrying problem with failed request #13

Closed rebaz94 closed 1 year ago

rebaz94 commented 1 year ago

Hi, I have two problem when request failed.

1. When I send a request with specified Upstash-Retries header, the Upstash will retry failed request more than specified retries.

for example I set 3 retries and at first the console shows correct retrying number like 2/3 but after some time it will send another request which will be 4 request in total.

Screen Shot 2022-10-13 at 2 52 38 PM

2. When I send a request with specified Upstash-Deduplication-Id header and the request is failed, I can't publish new message with same id, even if all request is already failed, it will ignore the message.

does it's expected? or how I publish new message that has same failed id but start from scratch?

Thank you

chronark commented 1 year ago
  1. Retries are counted after the first delivery fails, it's not the total number of attempts made If you want 3 total requests, you should set Upstash-Retries: 2

  2. That's how deduplication works, it just prevents you from publishing the same message twice, it does not make any guarantees about successful delivery We'll make the deduplication window configurable soon, currently it's set to 90 days

rebaz94 commented 1 year ago

We'll make the deduplication window configurable soon, currently it's set to 90 days

You mean by configuring window time for example 5 minute, after that you can publish new message with same id?

rebaz94 commented 1 year ago

@chronark do you have any api to get number of failed request for a specified message? or you need to use logs api and manually calculate failed request?

chronark commented 1 year ago

Yes you could set it to X minutes/hours/days and afterwards you can reuse the ID.

No currently the logs is all there is.

rebaz94 commented 1 year ago

Thank you for clarification.

gprieto commented 2 weeks ago

We'll make the deduplication window configurable soon, currently it's set to 90 days

Any updates on this?