Ejemplo n.º 1
0
 /**
  * Consumes a message.
  *
  * @param  string $message
  *
  * @return string|null|void
  *
  * @throws \Exception
  */
 public function consume($message)
 {
     try {
         $this->transactionManager->beginTransaction();
     } catch (BeginException $e) {
         throw new ConsumerException($e->getMessage(), $e->getCode(), $e);
     }
     try {
         $this->consumer->consume($message);
         $this->transactionManager->commit();
     } catch (\Exception $e) {
         $this->transactionManager->rollback();
         throw $e;
     }
 }