for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace OldSound\RabbitMqBundle\DataCollector;
use Symfony\Component\HttpKernel\DataCollector\DataCollector;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
/**
* MessageDataCollector
*
* @author Marc Weistroff <[email protected]>
*/
class MessageDataCollector extends DataCollector
{
private $channels;
public function __construct($channels)
$this->channels = $channels;
$this->data = [];
}
public function collect(Request $request, Response $response, ?\Throwable $exception = null)
foreach ($this->channels as $channel) {
foreach ($channel->getBasicPublishLog() as $log) {
$this->data[] = $log;
public function getName()
return 'rabbit_mq';
public function getPublishedMessagesCount()
return count($this->data);
public function getPublishedMessagesLog()
return $this->data;
public function reset()