/** * @param ConsumerEvent $event */ public function preConsume(ConsumerEvent $event) { $container = $event->getConsumerContainer(); $message = sprintf("Processing message [%s] for consumer [%s] with payload [%s]", $container->getRoutingKey(), $container->getMethodName(), $event->getMessage()->body); $this->logger->debug($message); }
/** * @param ConsumerEvent $args * * @return string */ private function getEventName(ConsumerEvent $args) { $name = $args->getConsumerContainer()->getConsumerName(); $tag = $args->getMessage()->delivery_info['delivery_tag']; return sprintf('%s-%s', $name, $tag); }