Last active
February 2, 2023 20:39
-
-
Save nikophil/51d8cd43b27a9d7f8add8094b246e318 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
messenger: | |
# these 3 confs are mutually exclusive! cannot use them together | |
transports: | |
normal_transport: | |
dsn: '%env(MESSENGER_TRANSPORT_DSN)%/some_exchange_1' | |
# if not provided at all: defaults to `messenger.serializer.default_serializer` | |
# can be used with the short notation: works the same way as now | |
serializer: transport_serializer_service_id | |
# or as an array, everything is optional: if "service_id" not provided if it uses `messenger.serializer.default_serializer` | |
# context + format override `messenger.serializer.symfony_serializer` conf | |
serializer: | |
service_id: transport_serializer_service_id | |
context: {} | |
format: json | |
serializer: symfony_serializer_service_id | |
incoming_message_transport: | |
dsn: '%env(MESSENGER_TRANSPORT_DSN)%/some_exchange_2' | |
# one of "messageClass" OR "messageResolver" is required (not both) | |
serializer_incoming_message: | |
# not sure if or how we should propose to the user a "transport_serializer_id" option here | |
# IMO we should directly use a new service/class `messenger.transport.incoming_message_symfony_serializer` | |
messageClass: App\Some\Message | |
messageResolver: message_resolver_service_id # Symfony will provide a new "MessageResolverInterface", (no default implementation will be provided?) | |
context: {} | |
format: json | |
serializer: symfony_serializer_service_id | |
# proposition: could have a short notation. will use `messenger.serializer.symfony_serializer` conf | |
serializer_incoming_message: App\Some\Message # or "message_resolver_service_id" | |
outgoing_message_transport: | |
dsn: '%env(MESSENGER_TRANSPORT_DSN)%/some_exchange_2' | |
# uses a new service/class `messenger.transport.outgoing_message_symfony_serializer` | |
serializer_outgoing_message: | |
context: {} | |
format: json | |
serializer: symfony_serializer_service_id | |
# no field required, so we could use short notation: | |
serializer_outgoing_message: true |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
messenger: | |
transports: | |
normal_transport: | |
dsn: '%env(MESSENGER_TRANSPORT_DSN)%/some_exchange_1' | |
serializer: | |
# depending on the type, possible array keys are different | |
type: normal # normal|incoming|outgoing | |
# concern all types | |
context: {} | |
format: json | |
serializer: symfony_serializer_service_id | |
# only for "type: normal" | |
service_id: transport_serializer_service_id | |
# only for "type: incoming" | |
messageClass: App\Some\Message | |
messageResolver: message_resolver_service_id |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment