forked from php-amqplib/RabbitMqBundle
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathAMQPLoggedChannel.php
35 lines (28 loc) · 885 Bytes
/
AMQPLoggedChannel.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
<?php
namespace OldSound\RabbitMqBundle\RabbitMq;
use PhpAmqpLib\Channel\AMQPChannel;
/**
* AMQPLoggedChannel.
*
* @author Marc Weistroff <[email protected]>
*/
class AMQPLoggedChannel extends AMQPChannel
{
private $basicPublishLog = array();
public function basic_publish($msg, $exchange = '', $routingKey = '', $mandatory = false, $immediate = false, $ticket = NULL)
{
$this->basicPublishLog[] = array(
'msg' => $msg,
'exchange' => $exchange,
'routing_key' => $routingKey,
'mandatory' => $mandatory,
'immediate' => $immediate,
'ticket' => $ticket
);
parent::basic_publish($msg, $exchange, $routingKey, $mandatory, $immediate, $ticket);
}
public function getBasicPublishLog()
{
return $this->basicPublishLog;
}
}