diff --git a/.env.dist b/.env.dist index 646ac56..a46d2ea 100644 --- a/.env.dist +++ b/.env.dist @@ -38,7 +38,7 @@ DATABASE_URL="postgresql://${POSTGRES_USER}:${POSTGRES_PASSWORD}@database:5432/$ # The URL of the Mercure hub, used by the app to publish updates (can be a local URL) MERCURE_URL=https://newsroom-php/.well-known/mercure # The public URL of the Mercure hub, used by the browser to connect -MERCURE_PUBLIC_URL=https://${SERVER_NAME}/.well-known/mercure +MERCURE_PUBLIC_URL="https://${SERVER_NAME}/.well-known/mercure" # The secret used to sign the JWTs MERCURE_JWT_SECRET="!NotSoSecretMercureHubJWTSecretKey!" ###< symfony/mercure-bundle ### @@ -57,4 +57,6 @@ REDIS_PASSWORD=r_password LNBITS_URL=https://legend.lnbits.com LNBITS_API_KEY= ###< LNBits ### - +###> symfony/messenger ### +MESSENGER_TRANSPORT_DSN="redis://:${REDIS_PASSWORD}@${REDIS_HOST}/messages" +###< symfony/messenger ### diff --git a/composer.json b/composer.json index c3b59db..72820ea 100644 --- a/composer.json +++ b/composer.json @@ -39,6 +39,7 @@ "symfony/http-foundation": "7.1.*", "symfony/intl": "7.1.*", "symfony/mercure-bundle": "^0.3.9", + "symfony/messenger": "7.1.*", "symfony/mime": "7.1.*", "symfony/property-access": "7.1.*", "symfony/property-info": "7.1.*", diff --git a/composer.lock b/composer.lock index cb797cf..95c3b95 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "97e9532b15d9f38c5d3dd1b85b747210", + "content-hash": "7d6a112c76c6a0d1cfe2b43f9408a2f8", "packages": [ { "name": "bacon/bacon-qr-code", @@ -7389,6 +7389,92 @@ ], "time": "2024-05-31T09:07:18+00:00" }, + { + "name": "symfony/messenger", + "version": "v7.1.9", + "source": { + "type": "git", + "url": "https://github.com/symfony/messenger.git", + "reference": "51e2b8b6a14b78ad7db60ef5f195ae893c16b9cc" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/messenger/zipball/51e2b8b6a14b78ad7db60ef5f195ae893c16b9cc", + "reference": "51e2b8b6a14b78ad7db60ef5f195ae893c16b9cc", + "shasum": "" + }, + "require": { + "php": ">=8.2", + "psr/log": "^1|^2|^3", + "symfony/clock": "^6.4|^7.0" + }, + "conflict": { + "symfony/console": "<6.4", + "symfony/event-dispatcher": "<6.4", + "symfony/event-dispatcher-contracts": "<2.5", + "symfony/framework-bundle": "<6.4", + "symfony/http-kernel": "<6.4", + "symfony/serializer": "<6.4" + }, + "require-dev": { + "psr/cache": "^1.0|^2.0|^3.0", + "symfony/console": "^6.4|^7.0", + "symfony/dependency-injection": "^6.4|^7.0", + "symfony/event-dispatcher": "^6.4|^7.0", + "symfony/http-kernel": "^6.4|^7.0", + "symfony/process": "^6.4|^7.0", + "symfony/property-access": "^6.4|^7.0", + "symfony/rate-limiter": "^6.4|^7.0", + "symfony/routing": "^6.4|^7.0", + "symfony/serializer": "^6.4|^7.0", + "symfony/service-contracts": "^2.5|^3", + "symfony/stopwatch": "^6.4|^7.0", + "symfony/validator": "^6.4|^7.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "Symfony\\Component\\Messenger\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Samuel Roze", + "email": "samuel.roze@gmail.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Helps applications send and receive messages to/from other applications or via message queues", + "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/messenger/tree/v7.1.9" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2024-11-26T09:50:51+00:00" + }, { "name": "symfony/mime", "version": "v7.1.11", @@ -13062,6 +13148,6 @@ "ext-openssl": "*", "ext-redis": "*" }, - "platform-dev": [], + "platform-dev": {}, "plugin-api-version": "2.6.0" } diff --git a/config/packages/messenger.yaml b/config/packages/messenger.yaml new file mode 100644 index 0000000..0cf892f --- /dev/null +++ b/config/packages/messenger.yaml @@ -0,0 +1,23 @@ +framework: + messenger: + # Uncomment this (and the failed transport below) to send failed messages to this transport for later handling. + # failure_transport: failed + + transports: + async: '%env(MESSENGER_TRANSPORT_DSN)%' + # https://symfony.com/doc/current/messenger.html#transport-configuration + # async: '%env(MESSENGER_TRANSPORT_DSN)%' + # failed: 'doctrine://default?queue_name=failed' + # sync: 'sync://' + + routing: + # Route your messages to the transports + # 'App\Message\YourMessage': async + +# 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://' diff --git a/symfony.lock b/symfony.lock index f1c808f..351cda0 100644 --- a/symfony.lock +++ b/symfony.lock @@ -141,6 +141,18 @@ "./config/packages/mercure.yaml" ] }, + "symfony/messenger": { + "version": "7.1", + "recipe": { + "repo": "github.com/symfony/recipes", + "branch": "main", + "version": "6.0", + "ref": "ba1ac4e919baba5644d31b57a3284d6ba12d52ee" + }, + "files": [ + "config/packages/messenger.yaml" + ] + }, "symfony/phpunit-bridge": { "version": "7.2", "recipe": {