-
Notifications
You must be signed in to change notification settings - Fork 53
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Ordered consumer changes #376
Conversation
nats-base-client/jsclient.ts
Outdated
return false; | ||
} | ||
// reset the consumer | ||
const seq = this.info?.ordered_consumer_sequence?.delivery_seq; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is possibly not right either - the sequence if we have one, should be incremeted
nats-base-client/jsclient.ts
Outdated
return false; | ||
} | ||
// reset the consumer | ||
const seq = this.info?.ordered_consumer_sequence?.delivery_seq || 0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The sequence needs to be the stream sequence, not the consumer sequence.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That is, the library needs to keep track of the stream sequence in the message's reply (the meta data) and when resetting, need to reset at that sequence + 1.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good catch -fixed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
[CHANGE] [JS] ordered consumers now default to memory storage and no replicas
[CHANGE] [JS] ordered consumers now recreate the consumer if heartbeats are missed. Note that the client will not get a notification since the client will try to recover. This is also a change for iterators since the ordered consumer iterator will now resume when the consumer
is recreated. For non-ordered consumers, any error will be notified on the callback until the subcription ends. Iterator based consumers will stop with the missed heartbeat error.
[FIX] [JS] publishing retries now properly handle timeouts
FIX #375