A PHP Extensible Service Bus
Configure your atomic jobs in order to be played by cron, queue listener or webservice.
- PHP 8+
composer require autobus-php/autobus-bus-bundle- If you want to use Google PubSub (https://cloud.google.com/pubsub/docs/overview):
composer require enqueue/gps:0.10.*- If you want to use AWS SQS (https://aws.amazon.com/fr/sqs):
composer require enqueue/sqs:0.10.*Update your .env file to add:
# 'gps:' for Google PubSub / 'sqs:' for AWS SQS
ENQUEUE_DSN=sqs:
# Only for AWS SQS usage
AWS_REGION=
AWS_ACCESS_KEY_ID=
AWS_SECRET_ACCESS_KEY=
2 queuing systems are available:
- With Google PubSub:
Execute the following command with Supervisor tool:
php bin/console autobus:pubsub:consume
-
With AWS SQS:
Add the following line to your crontab:
*/5 * * * * php bin/console autobus:sqs:consume
Add the following line to your crontab:
* * * * * php bin/console autobus:cron:run
To create a new job:
- Create it's class, implementing
Autobus\Bundle\BusBundle\Runner\RunnerInterface; it may extendAutobus\Bundle\BusBundle\Runner\AbstractRunner - Declare it as a service in your bundle's
services.yml, with tagbus.runner - Create an instance from the web UI