/** @var DelayStamp|null $delayStamp */
$delayStamp =
$envelope->
last(DelayStamp::
class);
$delay =
$delayStamp ?
$delayStamp->
getDelay() : 0;
/** @var AmqpStamp|null $amqpStamp */
$amqpStamp =
$envelope->
last(AmqpStamp::
class);
if (isset($encodedMessage['headers'
]['Content-Type'
])) { $contentType =
$encodedMessage['headers'
]['Content-Type'
];
unset($encodedMessage['headers'
]['Content-Type'
]);
if (!
$amqpStamp || !
isset($amqpStamp->
getAttributes()['content_type'
])) { $amqpStamp = AmqpStamp::
createWithAttributes(['content_type' =>
$contentType],
$amqpStamp);
} } $amqpReceivedStamp =
$envelope->
last(AmqpReceivedStamp::
class);
if ($amqpReceivedStamp instanceof AmqpReceivedStamp
) { $amqpStamp = AmqpStamp::
createFromAmqpEnvelope( $amqpReceivedStamp->
getAmqpEnvelope(),
$amqpStamp,
$envelope->
last(RedeliveryStamp::
class) ?
$amqpReceivedStamp->
getQueueName() : null
);
}