You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The scenario is to store the messages with packet identifier for QoS>0 on the filesystem before publishing them to the MQTT Broker. Storing the messages on the filesystem helps to survive the system/mqtt client crashes.
Currently the MQTTNet does not expose any method to set the PacketIdentifier directly in the MqttApplicationMessage and the PacketIdentifier is only available in the response of PublishAsync method.
In the reconnection scenario, Due to the Reset() method from MqttPacketIdentifierProvider being called in the ConnectAsync() the packet identifier is reset to 1, if there are messages already stored in the filesystem from the last connection that will then cause the packet id conflict.
Which project is your feature request related to?
Client
Describe the solution you'd like
Following are possible solutions.
Introducing Get property in the MqttPacketIdentifierProvider so that the current value could be read.
Making the call to Reset() method optional in ConnectAsync() method.
Another approach for the point 1 would be to make it possible to directly assign the packet identifier in the MqttApplicationMessage and create the interface for MqttPacketIdentifierProvider so user can provide custom packet identifier provider.
The text was updated successfully, but these errors were encountered:
I prefer to expose the packet identifier in the MqttApplicationMessage. If it is left 0 a new one will be created using the identifier provider. Additionally, I will add a new parameter to the client options which allows to setup the offset of the identifier values when connecting with the server. The client will also get a new property which exposes (read only) the latest used packet identifier so that you can store it after disconnecting and reuse it when connecting. What do you think?
Describe the feature request
The scenario is to store the messages with packet identifier for QoS>0 on the filesystem before publishing them to the MQTT Broker. Storing the messages on the filesystem helps to survive the system/mqtt client crashes.
Currently the MQTTNet does not expose any method to set the PacketIdentifier directly in the MqttApplicationMessage and the PacketIdentifier is only available in the response of PublishAsync method.
In the reconnection scenario, Due to the Reset() method from MqttPacketIdentifierProvider being called in the ConnectAsync() the packet identifier is reset to 1, if there are messages already stored in the filesystem from the last connection that will then cause the packet id conflict.
Which project is your feature request related to?
Describe the solution you'd like
Following are possible solutions.
Another approach for the point 1 would be to make it possible to directly assign the packet identifier in the MqttApplicationMessage and create the interface for MqttPacketIdentifierProvider so user can provide custom packet identifier provider.
The text was updated successfully, but these errors were encountered: