use enum to handle MQTT event