Knp\Bundle\KnpBundlesBundle\Producer\ExecutorProducer::publish PHP Метод

publish() публичный Метод

public publish ( $msgBody, $routingKey = '' )
    public function publish($msgBody, $routingKey = '')
    {
        $msg = new AMQPMessage($msgBody);
        $this->consumer->execute($msg);
    }

Usage Example

Пример #1
0
 public function testExecution()
 {
     $consumer = $this->getMock('OldSound\\RabbitMqBundle\\RabbitMq\\ConsumerInterface');
     $consumer->expects($this->once())->method('execute');
     $producer = new ExecutorProducer($consumer);
     $producer->publish('a message');
 }
ExecutorProducer