Skip to content

[Messenger] MessageDecodingFailedException should not delete message from queue #44117

Open
@alex-dev

Description

@alex-dev

Symfony version(s) affected

All

Description

MessageDecodingFailedException should not delete a message from the queue.

try {
    $envelope = $this->serializer->decode([
        'body' => $sqsEnvelope['body'],
        'headers' => $sqsEnvelope['headers'],
    ]);
} catch (MessageDecodingFailedException $exception) {
    $this->connection->delete($sqsEnvelope['id']);

    throw $exception;
}

Issues it causes

  • Since decoding is not exactly reverse of encoding with arrays (int vs string keys), legitimate messages end up being dropped.
  • Any other kind of dev ops error can mess up the decoding temporarily.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions