Fixed a typo in the code where I still referred to the old mosquitto code. Everything seems to work now. Commented out the on_publish event handler - that's for debugging only.