https://github.com/jgauthi/poc_symfony6_messenger
POC Symfony 6.4 LTS with Messenger component + Docker (LAMP with Supervisor, MailDev, RabbitMQ)
https://github.com/jgauthi/poc_symfony6_messenger
docker-compose maildev mysql8-2 rabbitmq supervisor symfony-messenger symfony-scheduler symfony6-4
Last synced: about 2 months ago
JSON representation
POC Symfony 6.4 LTS with Messenger component + Docker (LAMP with Supervisor, MailDev, RabbitMQ)
- Host: GitHub
- URL: https://github.com/jgauthi/poc_symfony6_messenger
- Owner: jgauthi
- Created: 2023-05-12T15:47:25.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2025-07-29T14:33:29.000Z (11 months ago)
- Last Synced: 2025-07-29T17:13:27.590Z (11 months ago)
- Topics: docker-compose, maildev, mysql8-2, rabbitmq, supervisor, symfony-messenger, symfony-scheduler, symfony6-4
- Language: PHP
- Homepage: http://localhost:8000
- Size: 546 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# POC Symfony 6.4 with Messenger component + Scheduler + Docker (LAMP with Supervisor, MailDev, RabbitMQ)
Messenger provides a message bus with the ability to send messages and then handle them immediately in your application or send them through transports (e.g. queues) to be handled later. To learn more deeply about it, read the [Messenger component docs](https://symfony.com/doc/6.4/messenger.htmlcomponents/messenger.html). [Scheduler](https://symfony.com/doc/6.4/messenger.htmlcomponents/scheduler.html) is a component that allows you to schedule messages to be sent at a later time, which is useful for delayed tasks or periodic jobs.
The messages are automatically consumed (send) by a worker from [supervisor](http://supervisord.org). Without it, you need to launch manually the command `make messenger` (or `php bin/console messenger:consume async scheduler_default` in local symfony server).
## Prerequisites
* Docker v24+ & Docker compose v2
* `Make` command. On linux, install with `sudo apt install build-essential`. On Windows, [see here](https://stackoverflow.com/questions/32127524/how-to-install-and-use-make-in-windows/54086635).
* These ports must be available for docker: `8000, 8080, 1025, 1080, 15672` _(you can change it on `docker-compose.override.yml` file after install)_.
More information on [symfony website](https://symfony.com/doc/6.2/reference/requirements.html).
## Installation
Command lines:
```bash
make install db-install
# (optional) Copy and edit configuration values ".env.local"
```
## Usage
Use docker for execute the built-in web server and access the application in your browser at :
```bash
make up
# Launch Messages service (optional: only needed if supervisor is not launch)
# make messenger
# For stop services
make stop
```
* For look at emails send by the smtp service, look at this url (maildev).
* For database management, you can look at phpmyadmin: .
* You can edit the var `COMPOSE_FILE` in [.env](.env) for add / remove containers from .docker/compose folder.
Debug commands:
```shell
make messenger CMD="-vv"
# Retry failed messages several times (3 attempts)
make sf-cmd CMD="messenger:failed:show"
make sf-cmd CMD="messenger:failed:retry"
# Schedule tasks list
make sf-cmd CMD="debug:scheduler"
```
Enjoy!