Example #1
1
 /**
  * {@inheritDoc}
  */
 public function handleBatch(array $records)
 {
     if ($this->exchange instanceof AMQPExchange) {
         parent::handleBatch($records);
         return;
     }
     foreach ($records as $record) {
         if (!$this->isHandling($record)) {
             continue;
         }
         $record = $this->processRecord($record);
         $data = $this->getFormatter()->format($record);
         $this->exchange->batch_basic_publish($this->createAmqpMessage($data), $this->exchangeName, $this->getRoutingKey($record));
     }
     $this->exchange->publish_batch();
 }