check if subscribe-qos was set before writing a zero value
@@ -392,10 +392,12 @@ func setSubscriptionDefaults(sub *collector.SubscriptionConfig) {
sub.StreamMode = viper.GetString("subscribe-stream-mode")
}
if sub.Qos == nil {
+ if viper.IsSet("subscribe-qos") {
q := viper.GetUint32("subscribe-qos")
sub.Qos = &q
}
}
+}
func readSubscriptionsFromCfg() []*collector.SubscriptionConfig {
subDef := viper.GetStringMap("subscriptions")
subscriptions := make([]*collector.SubscriptionConfig, 0)
