Optimized handling of MQTT message