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
FIXED: MQTT retained message consumer creation #5048
Conversation
levb
commented
Feb 7, 2024
- Cleaned up the retained message consumer name so that it does not cause problems
- Per @derekcollison's recommendation, use an ephemeral consumer for retained messages
} | ||
subj := fmt.Sprintf(JSApiDurableCreateT, cfg.Stream, cfg.Config.Durable) |
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.
Why is this durable and one above is not?
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.
I broke out the function into 2 to make it more explicit. Do you prefer to keep it exactly as before, 1 function triggering which API to use based on .Durable
set?
return ccr, ccr.ToError() | ||
} | ||
|
||
func (jsa *mqttJSA) createDurableConsumer(cfg *CreateConsumerRequest) (*JSApiConsumerCreateResponse, error) { |
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.
How is this materially different from createConsumer above?
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
My 2 cents: I had this comment when I implemented MQTT and used a durable for the retained messages:
Granted that was at the very early stages of JetStream and things may be totally different now, but is that concern still valid or not? If still valid, then I wonder why switching to an ephemeral... |
Its not since we can control the inactivity threshold now, vs before it was fixed and fairly low, IIRC 5s. |
I see, great! |
- Cleaned up the retained message consumer name so that it does not cause problems - Per @derekcollison's recommendation, use an ephemeral consumer for retained messages