/** * @param OutgoingPhysicalMessage $message * * @return array */ public function composeRabbitMqAttributes(OutgoingPhysicalMessage $message) { $headers = $message->getHeaders(); $attributes = []; $attributes['message_id'] = $message->getMessageId(); $attributes['headers'] = $headers; if (isset($headers[HeaderTypeEnum::CORRELATION_ID])) { $attributes['correlation_id'] = $headers[HeaderTypeEnum::CORRELATION_ID]; } if (isset($headers[HeaderTypeEnum::CONTENT_TYPE])) { $attributes['content_type'] = $headers[HeaderTypeEnum::CONTENT_TYPE]; } else { $attributes['content_type'] = 'application/octet-stream'; } if (isset($headers[HeaderTypeEnum::REPLY_TO_ADDRESS])) { $attributes['reply_to'] = $headers[HeaderTypeEnum::REPLY_TO_ADDRESS]; } if (isset($headers[HeaderTypeEnum::ENCLOSED_CLASS])) { $attributes['type'] = $headers[HeaderTypeEnum::ENCLOSED_CLASS]; } return $attributes; }
/** * @param OutgoingPhysicalMessage $physicalMessage * @param array $options * * @return OutboxTransportOperation */ public function create(OutgoingPhysicalMessage $physicalMessage, array $options) { return new OutboxTransportOperation($physicalMessage->getMessageId(), $options, $physicalMessage->getBody(), $physicalMessage->getHeaders()); }
/** * @param string $name * @param string $value */ public function setHeader($name, $value) { $this->headers[$name] = $value; $this->physicalMessage->setHeader($name, $value); }