Nats jetstream publish async #1144
-
Hi can some one provide any better example for nats publish in asynchronous i have tried in the below format , its keep on going to else condition , streamContext, err := connection.JetStream(nats.PublishAsyncMaxPending(1000)) <<--- wait for 1000 ack pending msgs am i doing anything wrong , any suggestions would be appreciated
|
Beta Was this translation helpful? Give feedback.
Replies: 3 comments
-
The system will automatically gate if the pubacks outstanding is >= the max, no need to test. |
Beta Was this translation helpful? Give feedback.
-
what is maximum value for AsyncMaxPending we can provide ? , will it cause any blocks or holds any memory if it reaches to the max and waiting for acks |
Beta Was this translation helpful? Give feedback.
-
No limits, will just hold all pending acks in memory so they can be checked. If the client reaches the max it will wait til pending is below the threshold. |
Beta Was this translation helpful? Give feedback.
The system will automatically gate if the pubacks outstanding is >= the max, no need to test.