{"id":23152985,"url":"https://github.com/t3n/jobqueue.rabbitmq","last_synced_at":"2025-08-17T20:33:24.433Z","repository":{"id":34049897,"uuid":"166466000","full_name":"t3n/JobQueue.RabbitMQ","owner":"t3n","description":"RabbitMQ backend implementation for Flowpack.JobQueue.Common","archived":false,"fork":false,"pushed_at":"2022-07-05T07:54:20.000Z","size":39,"stargazers_count":2,"open_issues_count":3,"forks_count":2,"subscribers_count":9,"default_branch":"master","last_synced_at":"2024-04-25T04:21:45.005Z","etag":null,"topics":["flowframework","flowpack","jobqueue","rabbitmq"],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/t3n.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-01-18T20:04:20.000Z","updated_at":"2023-06-05T13:26:25.000Z","dependencies_parsed_at":"2022-08-18T01:55:35.379Z","dependency_job_id":null,"html_url":"https://github.com/t3n/JobQueue.RabbitMQ","commit_stats":null,"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/t3n%2FJobQueue.RabbitMQ","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/t3n%2FJobQueue.RabbitMQ/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/t3n%2FJobQueue.RabbitMQ/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/t3n%2FJobQueue.RabbitMQ/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/t3n","download_url":"https://codeload.github.com/t3n/JobQueue.RabbitMQ/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":230168481,"owners_count":18183936,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["flowframework","flowpack","jobqueue","rabbitmq"],"created_at":"2024-12-17T19:20:06.455Z","updated_at":"2024-12-17T19:20:07.313Z","avatar_url":"https://github.com/t3n.png","language":"PHP","readme":"[![CircleCI](https://circleci.com/gh/t3n/JobQueue.RabbitMQ.svg?style=svg)](https://circleci.com/gh/t3n/JobQueue.RabbitMQ) [![Latest Stable Version](https://poser.pugx.org/t3n/jobqueue-rabbitmq/v/stable)](https://packagist.org/packages/t3n/jobqueue-rabbitmq) [![Total Downloads](https://poser.pugx.org/t3n/jobqueue-rabbitmq/downloads)](https://packagist.org/packages/t3n/jobqueue-rabbitmq)\n\n# t3n.JobQueue.RabbitMQ\n\nA job queue backend for the [Flowpack.JobQueue.Common](https://github.com/Flowpack/jobqueue-common) package based on [RabbitMQ](https://www.rabbitmq.com).\nIf you don't know anything about RabbitMQ yet have a look at their tutorials [here](https://www.rabbitmq.com/getstarted.html).\n\nDisclaimer: This is a fork/remake of an initial version which was made by [ttreeagency](https://github.com/ttreeagency/)!\n\n## Setup\n\nTo use RabbitMQ as a backend for a JobQueue you need a running RabbitMQ Service. You can use our docker image which also\nincludes the management console [t3n/rabbitmq](https://quay.io/repository/t3n/rabbitmq)\n\nInstall the package using composer:\n\n```\ncomposer require t3n/jobqueue-rabbitmq\n```\n\n## Configuration\n\nRabbitMQ allows a wide range of configuration and setups. Have a look at `Settings.yaml` for an overview with all available\nconfiguration options.\n\nThe simplest configuration for a job queue could look like this:\n\n```yaml\nFlowpack:\n  JobQueue:\n    Common:\n      queues:\n        simple-queue:\n          className: 't3n\\JobQueue\\RabbitMQ\\Queue\\RabbitQueue'\n          executeIsolated: true\n\n          options:\n            queueOptions:\n              # we want the queue to persist messages so they are stored even if no consumer (aka worker) is connected\n              durable: true\n              # multiple worker should be able to consume a queue at the same time\n              exclusive: false\n              autoDelete: false\n\n            client:\n              host: localhost\n              port: 5672\n              username: guest\n              password: guest\n```\n\nA more complex configuration could also configure an exchange and some routing keys.\nIn this example we will configure one exchange which all producers connect to. If your\nRabbitMQ server has the `rabbitmq_delayed_message_exchange` plugin ([our docker image](https://www.rabbitmq.com)\nships it by default) enabled we can also use the delay feature.\n\nThis configuration will configure several queues for one exchange. Message are routed\nto the queue based on a `routingKey`. We will use three parts for it: `\u003cproject\u003e.\u003ctype\u003e.\u003cname\u003e`.\nWe will use the type `job` to indicate it's a job to execute. We could also use something like\n`log` or whatever. The shape of the routing key is up to you!\n\nSo after all we will configure several producers/job queues.\nThe producer queues are meant to be used with `$jobManager-\u003equeue()`.\nThe consumer queue will be used within the `./flow job:work` command.\n\nIn this example we will end up with two queues. One queue with all messages matching\nthe routing key `vendor.jobs.*`, so whenever the `producer-import` or `producer-tags` queue is used\nthe message will end up in this queue. And another queue that fetches all jobs for all vendors.\n\nTo actually start a consumer run `./flow job:work --queue all-jobs`.\n\nThis pattern enables you to implement different kind of advanced pub/sup implementations.\n\n```yaml\nFlowpack:\n  JobQueue:\n    Common:\n      presets:\n        rabbit:\n          className: 't3n\\JobQueue\\RabbitMQ\\Queue\\RabbitQueue'\n          executeIsolated: true\n          maximumNumberOfReleases: 3\n\n          releaseOptions:\n            delay: 5\n\n          options:\n            routingKey: ''\n            useDLX: true # enable support for dead letter exchange, requires configuration in RabbitMQ\n\n            queueOptions:\n              # don't declare a queue by default\n              # all messages are forwarded to the exchange \"t3n\"\n              declare: false\n              exchangeName: 't3n'\n              # the queue should be durable and don't delete itself\n              durable: true\n              autoDelete: false\n              # several worker are allowed per queue\n              exclusive: false\n\n            exchange:\n              name: 't3n'\n              # this exchange should support delayed messages\n              type: 'x-delayed-message'\n              passive: false\n              durable: true\n              autoDelete: false\n              arguments:\n                # the origin type is topic so we can use routingkeys including `*` or `#`\n                x-delayed-type: 'topic'\n\n            client:\n              host: localhost\n              port: 5672\n              username: guest\n              password: guest\n              heartbeat: 60 # Sets RabbitMQ connection heartbeat to 60 seconds\n\n      queues:\n        producer-import:\n          preset: rabbit\n          options:\n            routingKey: 'vendor.jobs.import'\n\n        producer-tags:\n          preset: rabbit\n          options:\n            routingKey: 'vendor.jobs.tags'\n\n        vendor-jobs:\n          preset: rabbit\n          options:\n            routingKey: 'vendor.jobs.*'\n            queueOptions:\n              # this queue should actually be declared\n              declare: true\n\n        all-jobs:\n          preset: rabbit\n          options:\n            routingKey: '*.jobs.*'\n            queueOptions:\n              # this queue should actually be declared\n              declare: true\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ft3n%2Fjobqueue.rabbitmq","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ft3n%2Fjobqueue.rabbitmq","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ft3n%2Fjobqueue.rabbitmq/lists"}