2017 © Pedro Peláez
 

symfony-bundle autobus-bus-bundle

AutobusBusBundle

image

autobus-php/autobus-bus-bundle

AutobusBusBundle

  • Friday, December 29, 2017
  • by aloupfor
  • Repository
  • 2 Watchers
  • 1 Stars
  • 36 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 2 Forks
  • 1 Open issues
  • 1 Versions
  • 3 % Grown

The README.md

Autobus Bus Bundle - C&M

A PHP Extensible Service Bus, (*1)

Configure your atomic jobs in order to be played by cron, queue listener or webservice., (*2)

Requirements

  • PHP 8+

Installation

Download the Bundle

composer require autobus-php/autobus-bus-bundle

Download desired queuing 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.*

Environment variables

Update your .env file to add:, (*3)

# '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=

Configuration

Topic jobs

2 queuing systems are available:, (*4)

  • With Google PubSub:

Execute the following command with Supervisor tool:, (*5)

php bin/console autobus:pubsub:consume
  • With AWS SQS:, (*6)

    Add the following line to your crontab:, (*7)

*/5 * * * * php bin/console autobus:sqs:consume

Cron jobs

Add the following line to your crontab:, (*8)

* * * * * php bin/console autobus:cron:run

Usage

Create a job

To create a new job:, (*9)

  • Create it's class, implementing Autobus\Bundle\BusBundle\Runner\RunnerInterface ; it may extend Autobus\Bundle\BusBundle\Runner\AbstractRunner
  • Declare it as a service in your bundle's services.yml, with tag bus.runner
  • Create an instance from the web UI

The Versions