How to determine if PublishAsync (not Jetstream's) succeeded? #278
-
Is there a way to check if
For |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
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 |
Beta Was this translation helpful? Give feedback.
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 optionWaitUntilSent
totrue
. IfWaitUntilSent
is set tofalse
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 optionsErrorHandler
.