adding code to send the events through rabbitmq