Exemplo n.º 1
0
 protected function createProducer($name)
 {
     $conf = $this->config['producers'][$name];
     $conn = $this->connFactory->getConnection($conf['connection']);
     $producer = new Producer(new AMQPChannel($conn));
     $producer->setExchangeOptions($conf['exchange_options']);
     return $producer;
 }
Exemplo n.º 2
0
 public function testParamsOnPublishMessage()
 {
     $this->exchangeMock->expects($this->once())->method('publish')->with($this->equalTo('message'), $this->equalTo('routeKey'), $this->equalTo('flag'), $this->equalTo(['param1' => 'value1']));
     $p = new Producer($this->channelMock, $this->exchangeMock);
     $p->setExchangeOptions(['name' => 'myExchange', 'type' => 'someType']);
     $p->publish('message', 'routeKey', 'flag', ['param1' => 'value1']);
 }