Skip to content

[MESSENGER] Worker fail in loop on handling empty message #30649

Closed
@SukachVitally

Description

@SukachVitally

Symfony version(s) affected: 4.2

Description
Messenger worker fail after handling message with empty body (or headers) and restart this process in loop. Other messages in queue become blocked.
No way to catch this exception in middleware or handler.

How to reproduce

  1. Start worker php bin/console messenger:consume-messages some_transport.
  2. Add message with empty headers to queue.
  3. Worker fail and restart handling invalid message in loop.

Possible Solution

  1. Add additional catch block for Symfony\Component\Messenger\Exception\InvalidArgumentException to reject message.
  2. Add error handler for serializer in Symfony\Component\Messenger\Transport\AmqpExt\AmqpReceiver

Additional context

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