- modified to use synchronous MqttClient