See https://docs.aws.amazon.com/AWSSimpleQueueService/latest/APIReference/API_Message.html
in code:
public function getTimestamp(): ?int
{
$value = $this->getHeader('timestamp');
return null === $value ? null : (int) $value;
}
But in the SQS message, it should be the SentTimestamp property. As it is atm, this will allways lead to null as value for getTimestamp().
Proposed fix for SQSMessage.php:
public function getTimestamp(): ?int
{
$attributes = $message->getAttributes();
if (isset($attributes['SentTimestamp'])) {
$sentTimestamp = (int) $attributes['SentTimestamp'];
if ($sentTimestamp > 0) {
// SQS SentTimestamp is milliseconds since epoch.
return intdiv($sentTimestamp, 1000);
}
}
return null;
}
EDIT: PR slightly different to use available methods instead
See https://docs.aws.amazon.com/AWSSimpleQueueService/latest/APIReference/API_Message.html
in code:
But in the SQS message, it should be the
SentTimestampproperty. As it is atm, this will allways lead tonullas value forgetTimestamp().Proposed fix for SQSMessage.php:
EDIT: PR slightly different to use available methods instead