Azure / azure-iot-protocol-gateway

Azure IoT protocol gateway enables protocol translation for Azure IoT Hub
Other
224 stars 152 forks source link

Change the way MqttAdapter handles saving of transient sessions. #146

Closed avinashchandru closed 5 years ago

avinashchandru commented 5 years ago

1) We need to let the Session state manager decide what it needs to do with transient sessions and how. To that effect - we will remove the isTransient check and always call the SetAsync on the sessionStateManager 2) Given that we are lettitng the sessionStateManager decide what to do with transient sessions, we also need to provide a way to clean up during establishing a clean session... Assuming that GetAsync can potentially return a previous session that can be transient, we need to also check for the "transient-ness" of the previous session and delete it if necessary!

BlobStatePersistanceProvider : Changed the code in BlobStatePersistanceProvider to return instead of throwing if we call the set async on a session that is transient.