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
| if err != nil { | ||
| return nil, err | ||
| } | ||
| subj := fmt.Sprintf(JSApiDurableCreateT, cfg.Stream, cfg.Config.Durable) |
There was a problem hiding this comment.
Why is this durable and one above is not?
There was a problem hiding this comment.
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.
How is this materially different from createConsumer above?
|
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