Download the PHP package t3n/jobqueue-rabbitmq without Composer
On this page you can find all versions of the php package t3n/jobqueue-rabbitmq. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download t3n/jobqueue-rabbitmq
More information about t3n/jobqueue-rabbitmq
Files in t3n/jobqueue-rabbitmq
Package jobqueue-rabbitmq
Short Description A Flowpack.JobQueue.Common implementation to support RabbitMQ as backend
License MIT
Informations about the package jobqueue-rabbitmq
t3n.JobQueue.RabbitMQ
A job queue backend for the Flowpack.JobQueue.Common package based on RabbitMQ. If you don't know anything about RabbitMQ yet have a look at their tutorials here.
Disclaimer: This is a fork/remake of an initial version which was made by ttreeagency!
Setup
To use RabbitMQ as a backend for a JobQueue you need a running RabbitMQ Service. You can use our docker image which also includes the management console t3n/rabbitmq
Install the package using composer:
Configuration
RabbitMQ allows a wide range of configuration and setups. Have a look at Settings.yaml
for an overview with all available
configuration options.
The simplest configuration for a job queue could look like this:
A more complex configuration could also configure an exchange and some routing keys.
In this example we will configure one exchange which all producers connect to. If your
RabbitMQ server has the rabbitmq_delayed_message_exchange
plugin (our docker image
ships it by default) enabled we can also use the delay feature.
This configuration will configure several queues for one exchange. Message are routed
to the queue based on a routingKey
. We will use three parts for it: <project>.<type>.<name>
.
We will use the type job
to indicate it's a job to execute. We could also use something like
log
or whatever. The shape of the routing key is up to you!
So after all we will configure several producers/job queues.
The producer queues are meant to be used with $jobManager->queue()
.
The consumer queue will be used within the ./flow job:work
command.
In this example we will end up with two queues. One queue with all messages matching
the routing key vendor.jobs.*
, so whenever the producer-import
or producer-tags
queue is used
the message will end up in this queue. And another queue that fetches all jobs for all vendors.
To actually start a consumer run ./flow job:work --queue all-jobs
.
This pattern enables you to implement different kind of advanced pub/sup implementations.
All versions of jobqueue-rabbitmq with dependencies
php-amqplib/php-amqplib Version ^2.11
ext-json Version *