$attr =
$previousStamp->attributes ??
[];
$attr['headers'
] ??=
$amqpEnvelope->
getHeaders();
$attr['content_type'
] ??=
$amqpEnvelope->
getContentType();
$attr['content_encoding'
] ??=
$amqpEnvelope->
getContentEncoding();
$attr['delivery_mode'
] ??=
$amqpEnvelope->
getDeliveryMode();
$attr['priority'
] ??=
$amqpEnvelope->
getPriority();
$attr['timestamp'
] ??=
$amqpEnvelope->
getTimestamp();
$attr['app_id'
] ??=
$amqpEnvelope->
getAppId();
$attr['message_id'
] ??=
$amqpEnvelope->
getMessageId();
$attr['user_id'
] ??=
$amqpEnvelope->
getUserId();
$attr['expiration'
] ??=
$amqpEnvelope->
getExpiration();
$attr['type'
] ??=
$amqpEnvelope->
getType();
$attr['reply_to'
] ??=
$amqpEnvelope->
getReplyTo();
$attr['correlation_id'
] ??=
$amqpEnvelope->
getCorrelationId();
if (null ===
$retryRoutingKey) { $stamp =
new self($previousStamp->routingKey ??
$amqpEnvelope->
getRoutingKey(),
$previousStamp->flags ?? \AMQP_NOPARAM,
$attr);
} else { $stamp =
new self($retryRoutingKey,
$previousStamp->flags ?? \AMQP_NOPARAM,
$attr);
$stamp->isRetryAttempt = true;
}