Set durable annotation for MQTT messages (backport #11057) #11059
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is a follow up to #11012
What?
For incoming MQTT messages, always set the
durable
message container annotation.Why?
Even though defaulting to
durable=true
when no durable annotation is set, as prior to this commit, is good enough, explicitly setting the durable annotation makes the code a bit more future proof and maintainable going forward in 4.0 where we will rely more on the durable annotation because AMQP 1.0 message headers will be omitted in classic and quorum queues (see #10964)For MQTT messages, it's important to know whether the message was published with QoS 0 or QoS 1 because it affects the QoS of the MQTT message that will delivered to the MQTT subscriber.
The performance impact of always setting the durable annotation is negligible.
This is an automatic backport of pull request #11057 done by Mergify.