Java Refactor for RabbitMQ Working