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
Looking into the GetConfiguration method there seems to be a line that ensures the deserializer uses pascal casing for the keys CamelCaseNamingConvention.Instance
This might cause some interesting situation since the pascal case representation of qos should be Qos, and the Configuration objects have a property called QoS which does not match
This is similar to how the tls or pem fields are set on the configurations of the MqttClients, where the corresponding fields on the configuration objects are Tls and Pem
I have made a PR where I replaced all instances of QoS with Qos in the repo and tested and that seems to do the trick
The text was updated successfully, but these errors were encountered:
Thanks! Yes I saw an issue with this as well and had to use the "qoS" in yaml for it to deserialize. I like your solution better as that makes it less prone to error.
Hi @PatrickRitchie
I started testing the up to date master branch and realized that the QoS was still not getting set in the MqttRelay when sending messages
My mqtt relay config still looks like this
I started printing the resulting QoS value when we parse the configuration and create the
_configuration
object, which was still returning 0MTConnect.NET/agent/Modules/MTConnect.NET-AgentModule-MqttRelay/Module.cs
Lines 39 to 52 in 816844d
Looking into the
GetConfiguration
method there seems to be a line that ensures the deserializer uses pascal casing for the keysCamelCaseNamingConvention.Instance
MTConnect.NET/libraries/MTConnect.NET-Common/Configurations/AdapterApplicationConfiguration.cs
Lines 490 to 512 in 816844d
Here is the reference of what that naming convention implies on the library that is used to serialize and deserialize yaml
https://github.com/aaubry/YamlDotNet/blob/7923dd8e600f7fea7710f3b45f3fadcfa1aa589c/YamlDotNet/Serialization/NamingConventions/CamelCaseNamingConvention.cs#L25-L52
This might cause some interesting situation since the pascal case representation of
qos
should beQos
, and the Configuration objects have a property calledQoS
which does not matchThis is similar to how the
tls
orpem
fields are set on the configurations of the MqttClients, where the corresponding fields on the configuration objects areTls
andPem
I have made a PR where I replaced all instances of
QoS
withQos
in the repo and tested and that seems to do the trickThe text was updated successfully, but these errors were encountered: