Description
We use MQTT server with Keycloak requiring us to generate a token with Keycloak before we start a connection between our spring boot application and MQTT. On occasions for whatever reason that connection gets dropped, current behaviour means it will try to reconnect when the next message is published. When this occurs the existing connection details are used which potentially contains an expired token.
There doesn't seem to be to way that we can alter the connection options or at least have some flexibility when the connection is lost. My proposal includes something that has already been implemented in the MqttPahoMessageDrivenChannelAdapter class where a MqttConnectionFailedEvent is published. The same would be published on the producer side in the MqttPahoMessageHandler class enabling us to have some sort of flexibility in dealing with lost connection issues.