You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to understand what kinds of failure scenarios can happen if I use JetStream's PublishAsync instead of Publish. I have two related questions:
Right after PublishAsync returns, what is the risk in assuming that the message will be persisted by JetStream? For example, suppose that the application is a microservice that, as part of its request handling, calls PublishAsync to record an event for another part of the system, and then immediately responds to its caller, assuming the event will eventually get processed. However, suppose that the application crashes before all pending acks have been received by the NATS client. Can there be data loss? What are the possible failure scenarios here?
On a related question, if I use NoAck=true on a stream and call Publish without caring about acks, or just use Core NATS to send messages to a stream-backed subject (again, without caring about acks), how likely is it that the stream didn't capture the message?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hello,
I'm trying to understand what kinds of failure scenarios can happen if I use JetStream's PublishAsync instead of Publish. I have two related questions:
Right after PublishAsync returns, what is the risk in assuming that the message will be persisted by JetStream? For example, suppose that the application is a microservice that, as part of its request handling, calls PublishAsync to record an event for another part of the system, and then immediately responds to its caller, assuming the event will eventually get processed. However, suppose that the application crashes before all pending acks have been received by the NATS client. Can there be data loss? What are the possible failure scenarios here?
On a related question, if I use NoAck=true on a stream and call Publish without caring about acks, or just use Core NATS to send messages to a stream-backed subject (again, without caring about acks), how likely is it that the stream didn't capture the message?
Thank you.
Beta Was this translation helpful? Give feedback.
All reactions