Download the PHP package homedoctor-es/laravel-eventbridge-sqs-consumer without Composer

On this page you can find all versions of the php package homedoctor-es/laravel-eventbridge-sqs-consumer. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package laravel-eventbridge-sqs-consumer

AWS EventBridge SQS consumer for Laravel

Latest Version on Packagist Total Downloads

We simply have to listen to these messages pushed to an SQS queue and act upon them. The only difference here is that we don't use the default Laravel SQS driver as the messages pushed are not following Laravel's classic JSON payload for queued Jobs/Events pushed from a Laravel application. The messages from EventBridge and SNS are simpler.

Prerequisites

  1. This package installed and configured
  2. At least one SQS Queue - one queue per Laravel application subscribing
  3. At least one Event Bridge Eveng Bus
  4. An SQS subscription between your EventBus and your SQS Queue.
  5. The relevant Access policies configured, especially if you want to be able to publish messages directly from the AWS Console.

Installation

You can install the package on a Laravel 8+ application via composer:

Then, add HomedoctorEs\EventBridgeSqs\EventBridgeSqsServiceProvider::class to load the driver in config/app.php file automatically.

Configuration

Make sure to define your environment variables accordingly:

Once the package is installed and similar to what you would do for a standard Laravel SQS queue, you will need to add the following connection and configure your credentials in the config/queue.php configuration file:

Once your queue is configured properly, you will need to be able to define which listeners you would like to use for which kind of incoming events. In order to do so, you'll need to create Laravel listeners and associate the events through a Service Provider the package can create for you.

Registering Events & Listeners

You'll need a Service Provider in order to define the mapping for each Subscribed event and its Listeners. You can use a separated one or you can add the $listen property in any provider you have.

The listen property contains an array of all events (keys) and their listeners (values). Unlike the standard Laravel EventServiceProvider, you can only define one Listeners per event, however you may add as many events to this array as your application requires.

Using the Broadcast Name

You can subscribe to an event by using its Broadcast name, for example, if you brroadas an event called orders.shipped:

You may do whatever you want from that generic OrdersListener, you could even dispatch more events internally within your application.

Defining Listeners

Here we are simply re-using standard Laravel event listeners. The only difference being the function definition of the main handle() method which differs slightly. Instead of expecting an instance of an Event class passed, we simply receive the payload and the subject, if it's found.

Feel free to queue these listeners, just like you would with a standard Laravel Listeners.

Note: you will still need to make sure the mapping within your desired provider is configured.

Credits

License

The MIT License (MIT). Please see License File for more information.



All versions of laravel-eventbridge-sqs-consumer with dependencies

PHP Build Version
Package Version
Requires php Version ^7.3|^8.0
ext-json Version *
aws/aws-sdk-php Version ^3.155
illuminate/support Version ^8.52|^9.0|^10.0|^11.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package homedoctor-es/laravel-eventbridge-sqs-consumer contains the following files

Loading the files please wait ....