Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature Request: Add option to ServerConsumerOptions to automatically ack messages #1

Closed
demelvin opened this issue Feb 4, 2023 · 0 comments

Comments

@demelvin
Copy link

demelvin commented Feb 4, 2023

Hello 馃憢

Thanks for creating this library (or forking and improving). I'm just getting started with Jetstream and decided to give this library a try instead of re-writing my own Nats Streaming strategy for Jetstream. I have a feature request if you are taking them? Please see below.

Request

Add an option to the ServerConsumerOptions automatically ack messages if the subscriber function executes successfully (e.g. automaticAck: true | false (Default: false)).

Benefit of Automatic Ack's

If ServerConsumerOptions. manualAck = true there is no need to invoke the context.message.ack() within each subscriber method which becomes repetitive. Developers will have the option to enable this and not have to add the ack code to each method they wish to manually ack.

This could be taken a step further by adding an additional setting that supports the nak(millis?)option to tell nats to wait (or not) and resend the message but I'm getting ahead of myself.

Suggestion

Add the NatsJetStreamServer (line 103) when the message is sent to the eventHandler by subscribing to the Observable and checking if manualAck is true then automatically ack'ing the message.

Please let me know if you have questions. I'm happy to contribute and submit a PR if you are accepting them.

Thanks,

Derek

@demelvin demelvin closed this as not planned Won't fix, can't repro, duplicate, stale Feb 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant