eclipse-paho / paho.mqtt.java

Eclipse Paho Java MQTT client library. Paho is an Eclipse IoT project.
https://eclipse.org/paho
Other
2.14k stars 886 forks source link

Documentation not clear about MqttSubscription.retainHandling #971

Open grillsoftware opened 1 year ago

grillsoftware commented 1 year ago

Please fill out the form below before submitting, thank you!

The javadoc of the method validateRetainHandling seems a copy of the method validateQos.

I'm trying to find what the values for MqttSubscription.retainHandling means.

My goal is not to process retained messages on subscription. Since retainHandling defaults to 0 I'm guessing 0 means to handle the retained message. What does 1 and 2 means?

grillsoftware commented 1 year ago

Found this enum in the MQTTnet library:

SendAtSubscribe = 0, SendAtSubscribeIfNewSubscriptionOnly = 1, DoNotSendOnSubscribe = 2

In case someone is having the same issue.