This is an old revision of the document!
To get RabbitMQ running as a DDEV Service:
ddev get b13/ddev-rabbitmq && ddev restart
Apply the configuration:
ddev rabbitmq apply
This will apply the configuration defined in .ddev/rabbitmq/config.yaml
Install the required package:
ddev composer req symfony/amqp-messenger
Configure the amqp
transport method:
services: Symfony\Component\Messenger\Bridge\Amqp\Transport\AmqpTransportFactory: public: true Symfony\Component\Messenger\Bridge\Amqp\Transport\AmqpTransport: factory: [ '@Symfony\Component\Messenger\Bridge\Amqp\Transport\AmqpTransportFactory', 'createTransport' ] arguments: # You may want to store this in a environment variable $dsn: 'amqp://rabbitmq:rabbitmq@rabbitmq:5672/%2f/messages' $options: { } tags: - name: 'messenger.sender' identifier: 'amqp' - name: 'messenger.receiver' identifier: 'amqp'
Use the ampq
transport:
// Unset the default, so that it no longer applies unset($GLOBALS['TYPO3_CONF_VARS']['SYS']['messenger']['routing']['*']); // Set Webhook-Messages and DynamicsMessage to asynchronous transport via doctrine foreach ([WebhookMessageInterface::class, MyCustomMessage::class] as $className) { $GLOBALS['TYPO3_CONF_VARS']['SYS']['messenger']['routing'][$className] = 'amqp'; // The tags identifier defines in Configuration/Services.yaml }