subscribe
Subscribe to a single topic filter with the specified qos and MQTT 5.0 subscription options.
Only records subscriptions whose SUBACK reason code indicates success.
Parameters
The MQTT topic filter (e.g. "sensors/#").
Maximum QoS level for messages on this subscription.
If true, the server will not forward messages published by this client (§3.8.3.1).
If true, retain flag from original publish is preserved (§3.8.3.1).
Controls when retained messages are sent (§3.8.3.1).
Throws
if the topic filter is invalid (§4.7).
if not connected.
Subscribe to multiple topic filters with per-topic QoS levels.
Only records subscriptions whose SUBACK reason code indicates success.
Parameters
Map of topic filter to maximum QoS level.
Throws
if any topic filter is invalid (§4.7).
if not connected.
Subscribe to multiple topic filters with full subscription options.
Unlike subscribe with Map<String, QoS>, this overload preserves all per-topic MQTT 5.0 subscription options (noLocal, retainAsPublished, retainHandling).
Parameters
List of Subscription objects with per-topic options.
Throws
if any topic filter is invalid (§4.7).
if not connected.