Download the PHP package palpalani/laravel-sqs-queue-json-reader without Composer
On this page you can find all versions of the php package palpalani/laravel-sqs-queue-json-reader. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download palpalani/laravel-sqs-queue-json-reader
More information about palpalani/laravel-sqs-queue-json-reader
Files in palpalani/laravel-sqs-queue-json-reader
Package laravel-sqs-queue-json-reader
Short Description Custom SQS queue reader for Laravel
License MIT
Homepage https://github.com/palpalani/laravel-sqs-queue-json-reader
Informations about the package laravel-sqs-queue-json-reader
Custom SQS queue reader for Laravel
The Laravel SQS Queue Reader is a powerful extension designed to seamlessly integrate external webhooks into your Laravel application. By leveraging the reliability and scalability of Amazon Simple Queue Service (SQS), this extension ensures that your application efficiently processes incoming webhooks, minimizing downtime and enhancing overall performance.
Key Features:
Effortless Webhook Integration:
Easily integrate external webhooks into your Laravel application without compromising on performance.
Queue-Based Processing:
Harness the power of Amazon SQS to queue incoming webhooks, allowing for asynchronous and parallel processing, ensuring optimal response times.
Reliability and Scalability:
SQS provides a robust and scalable infrastructure, ensuring that your application can handle varying webhook loads without compromising on stability.
Seamless Laravel Integration:
Designed as a Laravel extension, the Webhook Queue Reader seamlessly integrates into your Laravel project, following Laravel's coding standards and conventions.
Configurable Settings:
Customize the extension's settings to align with your application's requirements, including queue names, visibility timeout, and other SQS-specific configurations.
Detailed Logging:
Gain insights into the webhook processing flow with detailed logging, helping you troubleshoot and monitor the system effectively.
How It Works:
Webhook Registration:
Register external webhooks with your Laravel application by providing the webhook URL.
SQS Queue Integration:
Incoming webhooks are efficiently processed through the SQS queue, ensuring optimal handling of webhook payloads.
Asynchronous Processing:
Leverage the asynchronous processing capabilities of SQS to handle webhooks in the background, preventing any impact on your application's response times.
Automatic Retries:
Benefit from SQS's automatic retries, ensuring that failed webhook processing attempts are retried without manual intervention.
Custom SQS queue reader for Laravel projects that supports raw JSON payloads and reads multiple messages. Laravel expects SQS messages to be generated in a specific format that includes job handler class and a serialized job.
Note: Implemented to read multiple messages from queue.
This library is very useful when you want to parse messages from 3rd party applications such as stripe webhooks, shopify webhooks, mailgun web hooks, custom JSON messages and so on.
Getting Started
Install Custom SQS queue reader for Laravel via composer:
You can publish the config file and Configure your SQS settings in the Laravel configuration file.
This is the contents of the published config file:
If the queue is not found in 'handlers' array, SQS payload is passed to default handler.
Register your webhooks with your Laravel application.
Add sqs-json
connection to your config/queue.php, Example:
In your .env file, choose sqs-json as your new default queue driver:
Enjoy seamless, reliable, and scalable webhook processing!
Dispatching to SQS
If you plan to push plain messages from Laravel, you can rely on DispatcherJob:
Above code will push the following JSON object to SQS queue:
'job' field is not used, actually. It's just kept for compatibility with Laravel Framework.
Processing job
Run the following commnd for testing the dispatched job.
php artisan queue:work sqs-json
For production
, use supervisor with the following configuration.
If you are using multiple connection, then duplicate above supervisor configutation and change the connection name.
Receiving from SQS
If a 3rd-party application or API Gateway to SQS implementation is creating custom-format JSON messages, just add a handler in the config file and implement a handler class as follows:
Note:
Ensure that your Laravel application is configured with the necessary AWS credentials and permissions to interact with SQS.
Enhance your Laravel application's webhook processing capabilities with the Laravel Webhook Queue Reader. Efficient, reliable, and designed for optimal performance!
For more information about AWS SQS check offical docs.
Testing
We already configured the script, just run the command:
For test coverage format, run the command:
For code analyse, run the command:
For code format, run the command:
Changelog
Please see CHANGELOG for more information on what has changed recently.
Contributing
Please see CONTRIBUTING for details.
If you want to contribute, then you may want to test it in a real Laravel project:
- Fork this repository to your GitHub account.
- Create a Laravel app locally.
- Clone your fork in your Laravel app's root directory.
- In the
/laravel-sqs-queue-json-reader
directory, create a branch for your fix, e.g.feature/awesome-feature
.
Install the packages in your app's composer.json
:
Now, run composer update
.
Other Laravel packages
GrumPHP rector task GrumPHP with a task that runs RectorPHP for your Laravel projects.
Email Deny List (blacklist) Check - IP Deny List (blacklist) Check Deny list (blacklist) checker will test a mail server IP address against over 50 DNS based email blacklists. (Commonly called Realtime blacklist, DNSBL or RBL).
Spamassassin spam score of emails Checks the spam score of email contents using spamassassin database.
Laravel Login Notifications A login event notification for Laravel projects. By default, it will send notification only on production environment only.
Laravel Toastr Implements toastr.js for Laravel. Toastr.js is a Javascript library for non-blocking notifications.
Beast Beast is Screenshot as a Service using Nodejs, Chrome and Aws Lamda. Convert a webpage to an image using headless Chrome Takes screenshot of any given URL/Html content and returns base64 encoded buffer.
eCommerce Product Recommendations Analyse order history of customers and recommend products for new customers which enables higher sales volume.
Security Vulnerabilities
Please review our security policy on how to report security vulnerabilities.
Credits
- palPalani
- All Contributors
Need Help?
If you spot a bug or have a question or feature request, please submit a detailed issue, and wait for assistance.
License
The MIT License (MIT). Please see License File for more information.
All versions of laravel-sqs-queue-json-reader with dependencies
illuminate/contracts Version ^8.0|^9.0|^10.0|^11.0
illuminate/support Version ^9.0|^10.0|^11.0
illuminate/queue Version ^8.0|^9.0|^10.0|^11.0
illuminate/bus Version ^8.0|^9.0|^10.0|^11.0
aws/aws-sdk-php Version ^3.250