Exemple #1
0
 /**
  * @param mixed  $message
  * @param string $routingKey
  * @param int    $flags
  * @param array  $attributes
  *
  * @return bool
  */
 public function publish($message, $routingKey = null, $flags = Client::NOPARAM, array $attributes = [])
 {
     try {
         return $this->rawExchange->publish($this->encodeStrategy->encode($message), $routingKey, $flags, $attributes);
     } catch (\Exception $e) {
         ClientHelper::throwRightException($e);
     }
 }
Exemple #2
0
 /**
  * @inheritDoc
  */
 public function init()
 {
     parent::init();
     $this->body = $this->decodeStrategy ? $this->decodeStrategy->decode($this->body) : $this->body;
 }