brefphp / symfony-messenger

Bridge to use Symfony Messenger on AWS Lambda with Bref
MIT License
72 stars 22 forks source link

fix: Set messenger.transports if config has not empty transports value #90

Closed ahonymous closed 2 months ago

ahonymous commented 2 months ago

These changes fix the issue in BrefMessengerExtension::prepand() for applications with multiple configs in different environments.

In BrefMessengerExtension.php line 25:

Warning: Undefined array key "transports"

Example:

configs
|__ packages
    |__dev
    |    |__messenger.yaml
    |__prod
    |    |__messenger.yaml
    |__messenger.yaml     
# configs/messenger.yaml
...
framework:
    messenger:
        transports:
            default_bus:
                <transport-config>
        routing:
            App\Message\Message: default_bus
# configs/dev/messenger.yaml
...
framework:
    messenger:
        buses:
            <dev-buses-config>
# configs/prod/messenger.yaml
...
framework:
    messenger:
        buses:
            <prod-buses-config>
mnapoli commented 2 months ago

Beautiful work thank you!