framework:
    messenger:
        # Uncomment this (and the failed transport below) to send failed messages to this transport for later handling.
        failure_transport: failed

        transports:
            # https://symfony.com/doc/current/messenger.html#transport-configuration
            async:
                dsn: '%env(MESSENGER_TRANSPORT_DSN)%'
                options:
                    use_notify: true
                    check_delayed_interval: 60000
                    queue_name: default
                retry_strategy:
                    max_retries: 1
                    multiplier: 1

            media_cache:
                dsn: '%env(MESSENGER_TRANSPORT_DSN)%'
                options:
                    use_notify: true
                    check_delayed_interval: 60000
                    queue_name: media_cache
                retry_strategy:
                    max_retries: 1
                    multiplier: 1


            failed: 'doctrine://default?queue_name=failed'

        default_bus: messenger.bus.default

        buses:
            messenger.bus.default: []

        routing:
            # Route your messages to the transports
            # 'App\Message\YourMessage': async
            'App\Download\Action\Command\DownloadMediaCommand': async
            'App\Monitor\Action\Command\MonitorTvEpisodeCommand': async
            'App\Monitor\Action\Command\MonitorTvSeasonCommand': async
            'App\Monitor\Action\Command\MonitorTvShowCommand': async
            'App\Monitor\Action\Command\MonitorMovieCommand': async
            'App\Torrentio\Action\Command\GetTvShowOptionsCommand': media_cache

# when@test:
#    framework:
#        messenger:
#            transports:
#                # replace with your transport name here (e.g., my_transport: 'in-memory://')
#                # For more Messenger testing tools, see https://github.com/zenstruck/messenger-test
#                async: 'in-memory://'
