AMQ MQTT connection autodetection

As discussed in #1617, I've created dedicated PR for the MQTT connection autodetection.