diff --git a/src/async_client.rs b/src/async_client.rs index 6a1f90a..29a9f70 100644 --- a/src/async_client.rs +++ b/src/async_client.rs @@ -811,11 +811,17 @@ impl AsyncClient { let n = topics.len(); // TOOD: Make sure topics & qos are same length (or use min) let tok = Token::from_request(ServerRequest::SubscribeMany(n)); - let mut rsp_opts = ResponseOptionsBuilder::new() - .token(tok.clone()) + let mut rsp_opts = ResponseOptionsBuilder::new(); + rsp_opts.token(tok.clone()) .subscribe_many_options(opts) - .properties(props.into().unwrap_or_default()) - .finalize(); + .properties(props.into().unwrap_or_default()); + + // This is necessary, as the `MQTTAsync_subscribeMany` paho.mqtt.c function uses `opts` over `optlist` when `count <= 1` + if let [opts] = opts { + rsp_opts.subscribe_options(*opts); + } + + let mut rsp_opts = rsp_opts.finalize(); let topics = StringCollection::new(topics);