adt/background-queue-symfony

Background queue for Symfony using RabbitMQ.

v1.1.2 2023-09-25 15:19 UTC

This package is auto-updated.

Last update: 2024-10-25 18:13:42 UTC


README

1.1 Installation

composer require adt/background-queue-symfony

1.2 Configuration

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']

1.3 RabbitMQ (optional)

1.3.1 Installation

How to install RabbitMQ, check https://github.com/AppsDevTeam/background-queue

1.3.2 Configuration

background_queue:
  producer: '@ADT\BackgroundQueue\Broker\AmqpLib\Producer'
  waitingJobExpiration: 1000

1.4 Documentation

https://github.com/AppsDevTeam/background-queue