vertx / io.vertx.reactivex.mqtt / MqttClient / subscribe

# subscribe

`open fun subscribe(topic: String, qos: Int): MqttClient`

Subscribes to the topic with a specified QoS level

### Parameters

`topic` - topic you subscribe on

`qos` - QoS level

Return
current MQTT client instance

`open fun subscribe(topic: String, qos: Int, subscribeSentHandler: Handler<AsyncResult<Int>>): MqttClient`

Subscribes to the topic with a specified QoS level

### Parameters

`topic` - topic you subscribe on

`qos` - QoS level

`subscribeSentHandler` - handler called after SUBSCRIBE packet sent with packetid

Return
current MQTT client instance

`open fun subscribe(topics: MutableMap<String, Int>): MqttClient`

Subscribes to the topics with related QoS levels

### Parameters

`topics` - topics and related QoS levels to subscribe to

Return
current MQTT client instance

`open fun subscribe(topics: MutableMap<String, Int>, subscribeSentHandler: Handler<AsyncResult<Int>>): MqttClient`

Subscribes to the topic and adds a handler which will be called after the request is sent

### Parameters

`topics` - topics you subscribe on

`subscribeSentHandler` - handler called after SUBSCRIBE packet sent with packetid

Return
current MQTT client instance