Added connectToRabbitMQ() function to prevent multiple TCP connections