I'm trying to subscribe to multiple topics using HiveMQ client. This page suggests that the MQTT subscribe message can carry multiple subscriptions.
I tried this code but it only subscribes to the last topic (Topic2 in this example)
val mqttClient: Mqtt3AsyncClient
// Client instantiation ommited for brevity
mqttClient.subscribeWith()
.topicFilter("Topic1")
.topicFilter("Topic2")
.callback(::onMessageReceived)
.send()
If possible, I would like to avoid having to send multiple separate subscriptions.