You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I may have missed something, but I encountered a problem when trying to call the is_mixed function from the global scope while using the symfony/doctrine-messenger package.
This error occurs when attempting to execute the following commands: messenger:consume failed messenger:failed:retry
The issue arises because the TransportMessageIdStamp object cannot be constructed from the "X-Message-Stamp-Symfony\Component\Messenger\Stamp\TransportMessageIdStamp" header during the execution of Symfony\Component\Serializer\Serializer::deserialize(...).
The root cause is the mixed type of the id in TransportMessageIdStamp.
abstract class AbstractObjectNormalizer extends AbstractNormalizer
{
...
if (('is_'.$typeIdentifier->value)($data)) {
return $data;
}
...
}
The TransportMessageIdStamp looks like this:
final class TransportMessageIdStamp implements StampInterface
{
public function __construct(
private mixed $id,
) {
}
public function getId(): mixed
{
return $this->id;
}
}
How to reproduce
To reproduce this issue, follow these steps:
Send a message to the "failure_transport" in any way while it hasn't appeared in the database via symfony/doctrine-messenger.
Run messenger:failed:retry or messenger:consume failed, preferably retry, followed by writing the message back to the database (simulating an unresolved issue in the handler).
During this process, the attempt to create TransportMessageIdStamp from X-Message-Stamp-Symfony\Component\Messenger\Stamp\TransportMessageIdStamp fails with an error.
Possible Solution
It might make sense to specify a more precise type in TransportMessageIdStamp, possibly using a union type.
For example:
final class TransportMessageIdStamp implements StampInterface
{
public function __construct(
private int|string $id,
) {
}
public function getId(): mixed
{
return $this->id;
}
}
Additional Context
No response
The text was updated successfully, but these errors were encountered:
Symfony version(s) affected
7.1.1
Description
I may have missed something, but I encountered a problem when trying to call the is_mixed function from the global scope while using the symfony/doctrine-messenger package.
This error occurs when attempting to execute the following commands:
messenger:consume failed
messenger:failed:retry
The issue arises because the TransportMessageIdStamp object cannot be constructed from the "X-Message-Stamp-Symfony\Component\Messenger\Stamp\TransportMessageIdStamp" header during the execution of Symfony\Component\Serializer\Serializer::deserialize(...).
The root cause is the mixed type of the id in TransportMessageIdStamp.
The TransportMessageIdStamp looks like this:
How to reproduce
To reproduce this issue, follow these steps:
messenger:failed:retry
ormessenger:consume failed
, preferablyretry
, followed by writing the message back to the database (simulating an unresolved issue in the handler).TransportMessageIdStamp
fromX-Message-Stamp-Symfony\Component\Messenger\Stamp\TransportMessageIdStamp
fails with an error.Possible Solution
It might make sense to specify a more precise type in TransportMessageIdStamp, possibly using a union type.
For example:
Additional Context
No response
The text was updated successfully, but these errors were encountered: