Message bus in TYPO3 with the Doctrine DBAL messenger transport

19. Mai 2025TYPO3

The documentation for the message bus can be found on the website https://docs.typo3.org/m/typo3/reference-coreapi/main/en-us/ApiOverview/MessageBus/Index.html, but there are a few additions that I want to make:

Additions to the configuration of the systemd service

[Unit]
Description=Run the TYPO3 message consumer
Requires=mariadb.service
After=mariadb.service

[Service]
Environment="TYPO3_CONTEXT=Development/dsimon"
Type=simple
User=www-data
Group=www-data
ExecStart=/usr/bin/php8.3 /var/www/projectname/vendor/bin/typo3 messenger:consume doctrine --exit-code-on-limit 133
# Generally restart on error
Restart=on-failure
# Restart on exit code 133 (which is returned by the command when limits are reached)
RestartForceExitStatus=133
# ..but do not interpret exit code 133 as an error (as it's just a restart request)
SuccessExitStatus=133

[Install]
WantedBy=multi-user.target
systemctl start typo3-message-consumer-projectname.service
systemctl stop typo3-message-consumer-projectname.service
systemctl restart typo3-message-consumer-projectname.service