Use libmosquitto's own message handling functions