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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NATS: Support ExactlyOnce QOS #168

Closed
AlexCuse opened this issue Aug 20, 2022 · 0 comments · Fixed by #179
Closed

NATS: Support ExactlyOnce QOS #168

AlexCuse opened this issue Aug 20, 2022 · 0 comments · Fixed by #179
Labels
enhancement New feature or request

Comments

@AlexCuse
Copy link
Contributor

🚀 Feature Request

Relevant Package [REQUIRED]

This feature request is for...

NATS MessageBus client

Description [REQUIRED]

In JetStream mode the nats.go client can support Exactly Once delivery (equivalent to MQTT QOS 2) - see https://docs.nats.io/using-nats/developer/develop_jetstream/model_deep_dive#exactly-once-semantics

This is set up in the client with a combination of options:

  • on publish set a dedicated header using the publish option nats.MessageID("my-correlation-id")
  • on subscribe use synchronous acknowledgement via msg.AckSync()

The EdgeX client could be extended to support this mode as well

Describe the solution you'd like

Client needs to ack messages explicitly rather than relying on auto-ack. It should default to msg.Ack but allow calling msg.AckSync if needed.

Publish needs to support the additional option again based on the new setting flag.

Describe alternatives you've considered

It may be worth configuring synchronous acks and msgID header usage through separate options.

@AlexCuse AlexCuse added the enhancement New feature or request label Aug 20, 2022
AlexCuse added a commit to AlexCuse/go-mod-messaging that referenced this issue Oct 14, 2022
This can also be used to opt-in to message deduplication on the broker
when running in core-nats mode.  Fixes edgexfoundry#168

Signed-off-by: Alex Ullrich <alex.ullrich@gmail.com>
AlexCuse added a commit to AlexCuse/go-mod-messaging that referenced this issue Oct 15, 2022
This can also be used to opt-in to message deduplication on the broker
when running in nats-core mode.  Fixes edgexfoundry#168

Signed-off-by: Alex Ullrich <alex.ullrich@gmail.com>
AlexCuse added a commit to AlexCuse/go-mod-messaging that referenced this issue Oct 15, 2022
This can also be used to opt-in to message deduplication on the broker
when running in nats-core mode.  Fixes edgexfoundry#168

Signed-off-by: Alex Ullrich <alex.ullrich@gmail.com>
AlexCuse added a commit to AlexCuse/go-mod-messaging that referenced this issue Oct 16, 2022
This option can be used to force use of the Nats-Msg-Id header for
deduplication by ClientID + CorrelationID combination.  Also forces
synchronous acknowledgement on subscriber side.  Fixes edgexfoundry#168

Signed-off-by: Alex Ullrich <alex.ullrich@gmail.com>
AlexCuse added a commit to AlexCuse/go-mod-messaging that referenced this issue Jun 14, 2023
This option can be used to force use of the Nats-Msg-Id header for
deduplication by ClientID + CorrelationID combination.  Also forces
synchronous acknowledgement on subscriber side.  Fixes edgexfoundry#168

Signed-off-by: Alex Ullrich <alex.ullrich@gmail.com>
AlexCuse added a commit to AlexCuse/go-mod-messaging that referenced this issue Jul 12, 2023
This option can be used to force use of the Nats-Msg-Id header for
deduplication by ClientID + CorrelationID combination.  Also forces
synchronous acknowledgement on subscriber side.  Fixes edgexfoundry#168

Signed-off-by: Alex Ullrich <alex.ullrich@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant