Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
JetStream ordered consume stability fixes (#202)
* JetStream ordered consume stability fixes Because ordered consume operations use ephemeral consumers it's important to be able to create new consumers when things go wrong. There are two major events that might strongly indicate we won't be able to find our consumer on the server: disconnects and idle heartbeat timeouts. With this approach introduced with this fix, we recreate the consumer on server disconnects and idle heartbeat timeouts, making sure the consumer can carry on from where it's left off (sequence state is maintained when this happens). Justification for large code duplication: NatsJSOrderedConsume.cs is a copy of NatsJSConsume.cs subscription class. Reason for this is to maintain stability of the normal consumer since the main behaviour is fairly different. There is also a chance the behaviours might diverge even greater as we discover other issues. We may consider to merge these classes in a tidy-up effort later on. We also introduced a general timeout (same as connection request timeout) for all JetStream API calls. We needed this because the consumer deletion process was sometimes hanging due to the server receiving the request being killed and never sending a response back. Before this we were relying on the CommandTimeout (which is 1 minute by default) to kick in. Now we use RequestTimeout (5 seconds by default) on the subscription waiting for the reply. * Consume memory test fixes * Ordered consumer create retries
- Loading branch information