composer require adt/background-queue-symfony
return [
ADT\BackgroundQueueSymfony\Bundle\BackgroundQueueBundle::class => ['all' => true]
];
background_queue:
callbacks:
sendEmail: ['@App\Model\Mailer', 'sendEmail']
notifyOnNumberOfAttempts: 5
tempDir: '%tmp_dir%'
locksDir: '%kernel.project_dir%/data/locks'
connection: '%env(DATABASE_URL)%'
queue: '%env(PROJECT_NAME)%'
logger: '@logger'
onBeforeProcess: ['@App\Model\Database', 'switchDatabase']
onError: ['ADT\Utils\Guzzle', 'handleException']
onAfterProcess: ['@App\Model\Database', 'switchDatabaseBack']
How to install RabbitMQ, check https://github.com/AppsDevTeam/background-queue
background_queue:
producer: '@ADT\BackgroundQueue\Broker\AmqpLib\Producer'
waitingJobExpiration: 1000