Implemented the event publish and listen sample.