Finish MQTT protocol publishing and subscribing.