GH-4014: MQTT ClientManager: completion timeouts #8552
Merged
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.
Fixes #4014
The
ClientManager
implementations uses by mistake aconnectionTimeout
for operations with completion waitcompletionTimeout
anddisconnectCompletionTimeout
forClientManager
abstraction to realign the logic with existing channel adapters and Paho Client by itself.DEFAULT_COMPLETION_TIMEOUT
andDISCONNECT_COMPLETION_TIMEOUT
constants in theAbstractMqttMessageDrivenChannelAdapter
in favor of respective replacement in theClientManager
disconnectCompletionTimeout
property from theMqttPahoMessageDrivenChannelAdapter
to its superclassdisconnectCompletionTimeout
in theMqttv5PahoMessageDrivenChannelAdapter
for similardisconnectForcibly()
callClientManager
is started by the outbound channel adapter (Integer.MIN_VALUE
phase and auto-startup - seeDefaultLifecycleProcessor.doStart()
and logic arounddependencies
) which is much earlier thanMessageProducerSupport
(Integer.MAX_VALUE / 2
phase) and there aconnectComplete()
callback might be called before theMessageProducerSupport.start()
. For that purpose check for anisRunning()
in theconnectComplete()
before subscribing and setreadyToSubscribeOnStart
flag tosubscribe()
in adoStart()
of thisMqttMessageDrivenChannelAdapter
MqttPahoMessageDrivenChannelAdapter.cleanSession
property in favor ofthis.clientFactory.getConnectionOptions().isCleanSession()
callGH-8550: MQTT: Always re-subscribe on re-connect
Fixes #8550
Turns out the Paho MQTT client does not re-subscribe when connection re-established on automatic reconnection
AbstractMqttMessageDrivenChannelAdapter
to always subscribe to their topics in theconnectComplete()
independently of thereconnect
statusMOSQUITTO_CONTAINER
image restart in Docker