Issue Bug Closed

#101699Default routing for messenger transports always applies.

Daniel Goerz 08/16/23, 14:40 updated 08/11/26, 08:46

Description

When using the symfony/messenger component in TYPO3, I discovered the following limitation:

The default configuration $GLOBALS['TYPO3_CONF_VARS']['SYS']['messenger']['routing']['*'] = 'default' will apply even if a different routing target was configured for a message:

For example, if I set $GLOBALS['TYPO3_CONF_VARS']['SYS']['messenger']['routing'][OrderSavedMessage::class] = 'doctrine'; then the message will be handled twice, because the '*' => 'default' config is still a match.

I have to unset the default with unset($GLOBALS['TYPO3_CONF_VARS']['SYS']['messenger']['routing']['*']);. Unsetting the default also has no effect on the default behavior, as default …. is the default anyway.

Reviews 5

History 923

  1. Garvin Hicking commented <span data-processor="relativetime" data-value="2025-11-10T21:37:12+00:00" > 11/10/25, 21:37 </span>

    From gerrit code review a comment:

    I can think of use cases where you like to have the the “bug” as a feature. for example if you like to publish all messages additionally to one or more distributed external queues and also process messages locally.
    $GLOBALS['TYPO3_CONF_VARS']['SYS']['messenger']['routing']['*'] = ['sqs', 'kafka']
    $GLOBALS['TYPO3_CONF_VARS']['SYS']['messenger']['routing'][OrderSavedMessage::class] = 'doctrine'
  2. Stefan Bürk commented <span data-processor="relativetime" data-value="2026-07-19T14:10:45+00:00" > 07/19/26, 14:10 </span>

    Hey @ervaude ,

    I created an alternative approach tackling a little bit more,
    not changing the default directly but having a easy option to
    configure the default behaviour.

    It’s done as feature for main (v15) only, but can be easily
    used by copy implementation to a local extension until v15
    or using a composer patch.

    Maybe you can have a look on it ?

  3. Stefan Bürk commented and changed status Under Review Resolved done 0 % 100 % <span data-processor="relativetime" data-value="2026-07-30T06:30:10+00:00" > 07/30/26, 06:30 </span>

    Applied in changeset commit:b31c46eada3a093dc779508aebd177f4e9360aaf.