rabbitmq connection refactor