How to listen events from another application

check this if it helps Sample app to publish and subscribe to MQTT5