Browse Source

Configure Messages and Mercure

imwald
Nuša Pukšič 3 months ago
parent
commit
51335df80a
  1. 6
      .env.dist
  2. 1
      composer.json
  3. 90
      composer.lock
  4. 23
      config/packages/messenger.yaml
  5. 12
      symfony.lock

6
.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) # 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 MERCURE_URL=https://newsroom-php/.well-known/mercure
# The public URL of the Mercure hub, used by the browser to connect # 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 # The secret used to sign the JWTs
MERCURE_JWT_SECRET="!NotSoSecretMercureHubJWTSecretKey!" MERCURE_JWT_SECRET="!NotSoSecretMercureHubJWTSecretKey!"
###< symfony/mercure-bundle ### ###< symfony/mercure-bundle ###
@ -57,4 +57,6 @@ REDIS_PASSWORD=r_password
LNBITS_URL=https://legend.lnbits.com LNBITS_URL=https://legend.lnbits.com
LNBITS_API_KEY=<your-lnbits-admin-key> LNBITS_API_KEY=<your-lnbits-admin-key>
###< LNBits ### ###< LNBits ###
###> symfony/messenger ###
MESSENGER_TRANSPORT_DSN="redis://:${REDIS_PASSWORD}@${REDIS_HOST}/messages"
###< symfony/messenger ###

1
composer.json

@ -39,6 +39,7 @@
"symfony/http-foundation": "7.1.*", "symfony/http-foundation": "7.1.*",
"symfony/intl": "7.1.*", "symfony/intl": "7.1.*",
"symfony/mercure-bundle": "^0.3.9", "symfony/mercure-bundle": "^0.3.9",
"symfony/messenger": "7.1.*",
"symfony/mime": "7.1.*", "symfony/mime": "7.1.*",
"symfony/property-access": "7.1.*", "symfony/property-access": "7.1.*",
"symfony/property-info": "7.1.*", "symfony/property-info": "7.1.*",

90
composer.lock generated

@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically" "This file is @generated automatically"
], ],
"content-hash": "97e9532b15d9f38c5d3dd1b85b747210", "content-hash": "7d6a112c76c6a0d1cfe2b43f9408a2f8",
"packages": [ "packages": [
{ {
"name": "bacon/bacon-qr-code", "name": "bacon/bacon-qr-code",
@ -7389,6 +7389,92 @@
], ],
"time": "2024-05-31T09:07:18+00:00" "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", "name": "symfony/mime",
"version": "v7.1.11", "version": "v7.1.11",
@ -13062,6 +13148,6 @@
"ext-openssl": "*", "ext-openssl": "*",
"ext-redis": "*" "ext-redis": "*"
}, },
"platform-dev": [], "platform-dev": {},
"plugin-api-version": "2.6.0" "plugin-api-version": "2.6.0"
} }

23
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://'

12
symfony.lock

@ -141,6 +141,18 @@
"./config/packages/mercure.yaml" "./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": { "symfony/phpunit-bridge": {
"version": "7.2", "version": "7.2",
"recipe": { "recipe": {

Loading…
Cancel
Save