nats-io / nats-server

High-Performance server for NATS.io, the cloud and edge native messaging system.
https://nats.io
Apache License 2.0
15.76k stars 1.4k forks source link

Optional delay for InProgress acknowledgement #3549

Open grom-42 opened 2 years ago

grom-42 commented 2 years ago

Feature Request

Hello! I'm a teammate of @JulienVDG.

Currently the NATS protocol provides an optional delay while acknowledging a JetStream message using a Nack ("-NAK"), but we would like to have also this optional delay using the InProgress ("+WPI") acknowledgement type. Do you have this feature in your roadmap?

Use Case:

Context: We are going to map the change visibility timeout feature of AWS SQS using NATS as underlying techno.

So, while a user changes the visibility timeout of a message in an SQS queue, we acknowledge the message using an InProgress acknowledgment type with the provided timeout as the optional delay.

Proposed Change:

Implementing an optional delay on the InProgress ("+WPI") acknowledgement, like it was done on the Nack ("-NAK").

Who Benefits From The Change(s)?

All NATS users wanting to solve the kind of problems solved by the visibility timeout feature of SQS protocol. :)

Alternative Approaches

We did not find other approaches yet.

derekcollison commented 2 years ago

The WPI does reset to the AckWait configured for the consumer. You want though to have a custom value assigned to that wait period yes?

grom-42 commented 2 years ago

Hi Derek! Yes, we want to have the possibility to set dynamically and per message this wait period. So we can fully control the visibility of each message in a stream.

derekcollison commented 2 years ago

ok, we have a bunch of other high priority work items but will see what we can do.

grom-42 commented 1 year ago

Ok, thanks a lot for trying. :)