PHPackages                             mmucklo/queue-bundle - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Database &amp; ORM](/categories/database)
4. /
5. mmucklo/queue-bundle

ActiveSymfony-bundle[Database &amp; ORM](/categories/database)

mmucklo/queue-bundle
====================

Symfony2/3/4/5 Queue Bundle (for background jobs) supporting Mongo (Doctrine ODM), Mysql (and any Doctrine ORM), RabbitMQ, Beanstalkd, Redis, and ... {write your own}

7.0.1(11mo ago)120839.8k↓22.1%38[22 issues](https://github.com/mmucklo/DtcQueueBundle/issues)[3 PRs](https://github.com/mmucklo/DtcQueueBundle/pulls)MITPHPPHP &gt;=8.1CI failing

Since Jan 27Pushed 11mo ago9 watchersCompare

[ Source](https://github.com/mmucklo/DtcQueueBundle)[ Packagist](https://packagist.org/packages/mmucklo/queue-bundle)[ RSS](/packages/mmucklo-queue-bundle/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (25)Versions (112)Used By (0)

DtcQueueBundle
==============

[](#dtcqueuebundle)

[![Build Status](https://camo.githubusercontent.com/de67f5f66620a0bff892e37f722f5720bd039a1714c16967e92ffb3a466af2bd/68747470733a2f2f7365637572652e7472617669732d63692e6f72672f6d6d75636b6c6f2f447463517565756542756e646c652e706e673f6272616e63683d6d6173746572)](http://travis-ci.org/mmucklo/DtcQueueBundle)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/356be512e349ee0cd97af9f1b379aae4ff0ed3ce338c1f82de33ddbfea92c5a1/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f6d6d75636b6c6f2f447463517565756542756e646c652f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/mmucklo/DtcQueueBundle/?branch=master)[![Code Coverage](https://camo.githubusercontent.com/5de50fceb0a9b503c89fff69e30fbd78f1b86293d95b4f35172e9efb006fb747/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f6d6d75636b6c6f2f447463517565756542756e646c652f6261646765732f636f7665726167652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/mmucklo/DtcQueueBundle/?branch=master)[![SymfonyInsight](https://camo.githubusercontent.com/6362508908770b0ac7ef2b28a6f4db40b4fdac8929be9a311d30803aaeab3759/68747470733a2f2f696e73696768742e73796d666f6e792e636f6d2f70726f6a656374732f61343137343139612d326430342d343365622d623761322d3161303461346466636338652f6d696e692e737667)](https://insight.symfony.com/projects/a417419a-2d04-43eb-b7a2-1a04a4dfcc8e)

> Allow symfony developers to create background job as easily as: `$worker->later()->process(1,2,3)`

### 6.0 Release

[](#60-release)

See [changes](CHANGELOG.md)

Upgrading from 5.0: [see UPGRADING-6.0.md](UPGRADING-6.0.md)

Supported Queues
----------------

[](#supported-queues)

- MongoDB via Doctrine-ODM
- Mysql / Doctrine 2 supported databases via Doctrine-ORM
- Beanstalkd via pheanstalk
- RabbitMQ via php-amqplib
- Redis support via Predis or PhpRedis, or through SncRedisBundle

[![Trends](/Resources/doc/images/trends-example.png?raw=true "DtcQueue Trends")](/Resources/doc/images/trends-example.png?raw=true)

Introduction
------------

[](#introduction)

This bundle provides a way to easily create and manage queued background jobs

**Basic Features:**

- Ease of Use
    - Kickoff background tasks with a line of code or two
    - Easily add background worker services
        - Turn any code into background task with a few lines
- Atomic operation for jobs
    - For ORM-based queues this is done *without* relying on transactions.
- Admin interface
    - Web-based Admin interface with an optional performance graph
- Command Line Interface
    - Commands to run, manage and debug jobs from console
- Job Archival
    - ORM and ODM managers have built-in job-archival for finished jobs
- Logs errors from worker
- Various safety checks for things such as stalled jobs, exception jobs
    - Allows for reseting stalled and exception jobs via console commands
- Built in Event Dispatcher

**Job-specific Features:**

- Auto-retry on failure, exception
    - If a job exits with a failure code, it can auto-retry
    - Same for Exception if desired
- Priority
    - Jobs can have levels of priority so that higher priority jobs can get processed first even if they were added
    - to the queue later.
- Future Jobs (ODM / ORM / Redis)
    - Jobs can be scheduled to run at some time in the future
- Batch
    - Jobs can be "batched" so that only one job runs, even if multiple are queued of the same type
- Expires
    - Jobs can have an "expires" time so that they wont run after a certain point
        - (useful if the queue gets backed up and a job is worthless after a certain time)
- Stalls (ODM / ORM)
    - Jobs that crash the interpreter, or get terminated for some other reason can be detected
        - These can be re-queued to run in the future.

Installation
------------

[](#installation)

### Symfony 2/3

[](#symfony-23)

[see /Resources/doc/symfony2-3.md](/Resources/doc/symfony2-3.md)

### Symfony 4/5

[](#symfony-45)

[see /Resources/doc/symfony4-5.md](/Resources/doc/symfony4-5.md)

Troubleshooting
---------------

[](#troubleshooting)

[see /Resources/doc/troubleshooting.md](/Resources/doc/troubleshooting.md)

Usage
-----

[](#usage)

Create a worker class that will work on the background job.

Example:

- **src/Worker/Fibonacci.php:** (symfony 4/5)
- **src/AppBundle/Worker/Fibonacci.php:** (symfony 2/3)

```
