getHeader() public method

Get a specific message header.
public getHeader ( string $header_key ) : string | boolean
$header_key string Name of the header to get the value from.
return string | boolean The contents of the specified header or FALSE if not set.
 protected function processFailedSubscription(\AMQPEnvelope $message)
 {
     $attempt = $message->getHeader('redelivery_counter') ? $message->getHeader('redelivery_counter') : 1;
     if ($attempt < 3) {
         $headers = $message->getHeaders();
         $headers['redelivery_counter'] = ++$attempt;
         $attributes = array_merge($this->messageAttributes, ['content_type' => $message->getContentType(), 'headers' => $headers]);
         $this->getExchange()->publish($message->getBody(), $message->getRoutingKey(), AMQP_NOPARAM, $attributes);
     }
     $this->getQueue()->ack($message->getDeliveryTag());
 }
Ejemplo n.º 2
0
 /**
  * @inheritdoc
  */
 public function getHeader($headerKey)
 {
     return $this->delegate->getHeader($headerKey);
 }