/**
  * @param Consumer $consumer
  */
 public function registerConsumer(Consumer $consumer)
 {
     foreach ($consumer->getQueueOptions()['routing_keys'] as $routingKey) {
         $this->dispatcher->addListener($routingKey, [new AMQPMessageListener($consumer, $routingKey), 'execute']);
     }
 }
 public function execute(AMQPMessageEvent $event)
 {
     call_user_func($this->consumer->getCallback(), new AMQPMessage($event->getMessage()));
 }