Skip to content

How to determine if PublishAsync (not Jetstream's) succeeded? #278

Closed Answered by mtmk
robertmircea asked this question in Q&A
Discussion options

You must be logged in to vote

There are no delivery guaranties for core NATS publish. It's essentially fire-and-forget: https://docs.nats.io/nats-concepts/what-is-nats#nats-quality-of-service-qos.

However there are a couple of things you can do with PublishAsync to make sure at least the message is written to TCP stream as close as possible by setting the option WaitUntilSent to true. If WaitUntilSent is set to false messages will be queued up for faster send rate so another thing is to make sure to handle errors (usually serialization errors) by subscribing to the publish options ErrorHandler.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by robertmircea
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants