Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

[Messenger] Content type is not set by Symfony Serializer #31736

Copy link
Copy link
Closed
@jakzal

Description

@jakzal
Issue body actions

Symfony version(s) affected: <=4.3

Description

All messages are published to rabbitmq with content_type as plain/text, even though they're serialised as json. It makes it harder to consume messages with other technologies (like spring), which recognise the header to decide how to decode the message.

How to reproduce

Configure the messenger to use the symfony_serializer instead of the php one:

framework:
    messenger:
        transports:
             amqp:
                dsn: 'amqp://admin:admin@localhost:5672/%2f/foo'
                serializer: 'messenger.transport.symfony_serializer'
        routing:
             'App\Message\Foo': amqp

Publish a message and inspect content_type in rabbitmq.

Possible Solution

During serialisation create an AmqpStamp instance with the content_type attribute set based on the serialisation format.

The drawback would be that only the last AmqpStamp is currently read, so any AmqpAdmin stamps add by user land code would override it.

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

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.