Skip to content

Commit d0d9a3a

Browse files
committed
Improved readme
1 parent 57bce0e commit d0d9a3a

File tree

1 file changed

+59
-64
lines changed

1 file changed

+59
-64
lines changed

README.md

Lines changed: 59 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -1,54 +1,54 @@
1-
# Custom SQS queue reader for Laravel
1+
# Custom SQS Queue Reader for Laravel
22

33
<p align="center">
44
<img src="https://repository-images.githubusercontent.com/329289269/bf372113-a004-40f2-815b-300155f7a220" alt="Custom SQS queue reader for Laravel" style="width: 100%; max-width: 800px;" />
55
</p>
66

7-
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.
7+
The Laravel SQS Queue Reader is an extension designed to seamlessly integrate external webhooks into your Laravel application. By leveraging the reliability and scalability of Amazon Simple Queue Service (SQS), this package ensures your application efficiently processes incoming webhooks, minimizing downtime and enhancing overall performance.
88

9-
### Key Features:
9+
### Key Features
1010

11-
#### Effortless Webhook Integration:
11+
#### Effortless Webhook Integration
1212

13-
Easily integrate external webhooks into your Laravel application without compromising on performance.
13+
Easily integrate external webhooks into your Laravel application without compromising performance.
1414

15-
#### Queue-Based Processing:
15+
#### Queue-Based Processing
1616

17-
Harness the power of Amazon SQS to queue incoming webhooks, allowing for asynchronous and parallel processing, ensuring optimal response times.
17+
Harness Amazon SQS to queue incoming webhooks for asynchronous and parallel processing, ensuring optimal response times.
1818

19-
#### Reliability and Scalability:
19+
#### Reliability and Scalability
2020

21-
SQS provides a robust and scalable infrastructure, ensuring that your application can handle varying webhook loads without compromising on stability.
21+
SQS provides a robust and scalable infrastructure so your application can handle varying webhook loads without compromising stability.
2222

23-
#### Seamless Laravel Integration:
23+
#### Seamless Laravel Integration
2424

25-
Designed as a Laravel extension, the Webhook Queue Reader seamlessly integrates into your Laravel project, following Laravel's coding standards and conventions.
25+
Designed as a Laravel extension, the Queue Reader integrates cleanly into your project, following Laravel's coding standards and conventions.
2626

27-
#### Configurable Settings:
27+
#### Configurable Settings
2828

29-
Customize the extension's settings to align with your application's requirements, including queue names, visibility timeout, and other SQS-specific configurations.
29+
Customize settings to align with your application's requirements, including queue names, visibility timeout, and other SQS-specific configurations.
3030

31-
#### Detailed Logging:
31+
#### Detailed Logging
3232

33-
Gain insights into the webhook processing flow with detailed logging, helping you troubleshoot and monitor the system effectively.
33+
Gain insights into the webhook processing flow with detailed logging to help troubleshoot and monitor effectively.
3434

35-
### How It Works:
35+
### How It Works
3636

37-
#### Webhook Registration:
37+
#### Webhook Registration
3838

3939
Register external webhooks with your Laravel application by providing the webhook URL.
4040

41-
#### SQS Queue Integration:
41+
#### SQS Queue Integration
4242

43-
Incoming webhooks are efficiently processed through the SQS queue, ensuring optimal handling of webhook payloads.
43+
Incoming webhooks are processed through the SQS queue, ensuring optimal handling of webhook payloads.
4444

45-
#### Asynchronous Processing:
45+
#### Asynchronous Processing
4646

47-
Leverage the asynchronous processing capabilities of SQS to handle webhooks in the background, preventing any impact on your application's response times.
47+
Leverage asynchronous processing to handle webhooks in the background, preventing impact on your application's response times.
4848

49-
#### Automatic Retries:
49+
#### Automatic Retries
5050

51-
Benefit from SQS's automatic retries, ensuring that failed webhook processing attempts are retried without manual intervention.
51+
Benefit from SQS automatic retries, ensuring failed webhook processing attempts are retried without manual intervention.
5252

5353
[![Latest Version on Packagist](https://img.shields.io/packagist/v/palpalani/laravel-sqs-queue-json-reader.svg?style=for-the-badge)](https://packagist.org/packages/palpalani/laravel-sqs-queue-json-reader)
5454
[![GitHub Tests Action Status](https://img.shields.io/github/actions/workflow/status/palpalani/laravel-sqs-queue-json-reader/run-tests.yml?branch=main&label=tests&style=for-the-badge)](https://github.com/palpalani/laravel-sqs-queue-json-reader/actions?query=workflow%3Arun-tests+branch%3Amain)
@@ -60,28 +60,27 @@ Benefit from SQS's automatic retries, ensuring that failed webhook processing at
6060
-->
6161
<a href="https://php.net"><img alt="PHP 8.1" src="https://img.shields.io/badge/PHP-8.1-777BB4?style=for-the-badge&logo=php"></a>
6262

63-
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.
63+
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 a job handler class and a serialized job.
6464

65-
Note: Implemented to read multiple messages from queue.
65+
Note: Implemented to read multiple messages from the queue.
6666

67-
This library is very useful when you want to parse messages from 3rd party
68-
applications such as stripe webhooks, shopify webhooks, mailgun web hooks, custom JSON messages and so on.
67+
This library is useful when you want to parse messages from 3rd-party applications such as Stripe webhooks, Shopify webhooks, Mailgun webhooks, custom JSON messages, and more.
6968

7069
## Getting Started
7170

72-
Install Custom SQS queue reader for Laravel via composer:
71+
Install via Composer:
7372

7473
```bash
7574
composer require palpalani/laravel-sqs-queue-json-reader
7675
```
7776

78-
You can publish the config file and Configure your SQS settings in the Laravel configuration file.
77+
Publish the config file and configure your SQS settings in the Laravel configuration file:
7978

8079
```bash
8180
php artisan vendor:publish --provider="palPalani\SqsQueueReader\SqsQueueReaderServiceProvider" --tag="config"
8281
```
8382

84-
This is the contents of the published config file:
83+
This is the content of the published config file:
8584

8685
```php
8786
/**
@@ -113,11 +112,11 @@ return [
113112
];
114113
```
115114

116-
If the queue is not found in 'handlers' array, SQS payload is passed to default handler.
115+
If the queue is not found in the `handlers` array, the SQS payload is passed to the default handler.
117116

118117
Register your webhooks with your Laravel application.
119118

120-
Add `sqs-json` connection to your config/queue.php, Example:
119+
Add an `sqs-json` connection to your `config/queue.php`. Example:
121120

122121
```php
123122
[
@@ -133,17 +132,17 @@ Add `sqs-json` connection to your config/queue.php, Example:
133132
]
134133
```
135134

136-
In your .env file, choose sqs-json as your new default queue driver:
135+
In your `.env` file, choose `sqs-json` as your default queue connection:
137136

138137
```
139-
QUEUE_DRIVER=sqs-json
138+
QUEUE_CONNECTION=sqs-json
140139
```
141140

142141
Enjoy seamless, reliable, and scalable webhook processing!
143142

144143
## Dispatching to SQS
145144

146-
If you plan to push plain messages from Laravel, you can rely on DispatcherJob:
145+
If you plan to push plain messages from Laravel, you can rely on `DispatcherJob`:
147146

148147
```php
149148
use palPalani\SqsQueueReader\Jobs\DispatcherJob;
@@ -168,22 +167,21 @@ class ExampleController extends Controller
168167
}
169168
}
170169
```
171-
Above code will push the following JSON object to SQS queue:
170+
The above code will push the following JSON object to the SQS queue:
172171

173172
```json
174-
{"job":"App\\Jobs\\SqsHandler@handle","data":{"music":"Sample SQS message","singer":"AR. Rahman","time":1464511672}}
173+
{"job":"App\\Jobs\\SqsHandler@handle","data":{"music":"Ponni nathi from PS-1","singer":"AR. Rahman","time":1464511672}}
175174
```
176175

177-
'job' field is not used, actually. It's just kept for compatibility with Laravel
178-
Framework.
176+
The `job` field is not used; it is kept for compatibility with the Laravel framework.
179177

180-
### Processing job
178+
### Processing Job
181179

182-
Run the following commnd for testing the dispatched job.
180+
Run the following command to test the dispatched job.
183181

184182
`php artisan queue:work sqs-json`
185183

186-
For `production`, use supervisor with the following configuration.
184+
For production, use Supervisor with the following configuration.
187185

188186
```
189187
[program:sqs-json-reader]
@@ -202,14 +200,11 @@ stopwaitsecs=3600
202200
priority=1000
203201
```
204202

205-
If you are using multiple connection, then duplicate above supervisor
206-
configutation and change the connection name.
203+
If you are using multiple connections, duplicate the above Supervisor configuration and change the connection name.
207204

208205
### Receiving from SQS
209206

210-
If a 3rd-party application or API Gateway to SQS implementation is creating
211-
custom-format JSON messages, just add a
212-
handler in the config file and implement a handler class as follows:
207+
If a 3rd-party application or an API Gateway-to-SQS implementation is creating custom-format JSON messages, add a handler in the config file and implement a handler class as follows:
213208

214209
```php
215210
use Illuminate\Contracts\Queue\Job as LaravelJob;
@@ -240,28 +235,28 @@ Note:
240235

241236
Ensure that your Laravel application is configured with the necessary AWS credentials and permissions to interact with SQS.
242237

243-
Enhance your Laravel application's webhook processing capabilities with the Laravel Webhook Queue Reader. Efficient, reliable, and designed for optimal performance!
238+
Enhance your Laravel application's webhook processing capabilities with the Laravel SQS Queue Reader. Efficient, reliable, and designed for optimal performance!
244239

245-
For more information about AWS SQS check [offical docs](https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-configure-queue-parameters.html).
240+
For more information about AWS SQS, check the [official docs](https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-configure-queue-parameters.html).
246241

247242
## Testing
248243

249-
We already configured the script, just run the command:
244+
We already configured the scripts; just run the command:
250245

251246
```bash
252247
composer test
253248
```
254249

255-
For test coverage format, run the command:
250+
For test coverage, run the command:
256251
```bash
257252
composer test-coverage
258253
```
259-
For code analyse, run the command:
254+
For code analysis, run the command:
260255

261256
```bash
262257
composer analyse
263258
```
264-
For code format, run the command:
259+
For code formatting, run the command:
265260

266261
```bash
267262
composer format
@@ -275,14 +270,14 @@ Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed re
275270

276271
Please see [CONTRIBUTING](.github/CONTRIBUTING.md) for details.
277272

278-
If you want to contribute, then you may want to test it in a real Laravel project:
273+
If you want to contribute, you may want to test it in a real Laravel project:
279274

280275
- Fork this repository to your GitHub account.
281276
- Create a Laravel app locally.
282277
- Clone your fork in your Laravel app's root directory.
283278
- In the `/laravel-sqs-queue-json-reader` directory, create a branch for your fix, e.g. `feature/awesome-feature`.
284279

285-
Install the packages in your app's `composer.json`:
280+
Install the package in your app's `composer.json`:
286281

287282
```jsonc
288283
{
@@ -303,21 +298,21 @@ Install the packages in your app's `composer.json`:
303298

304299
Now, run `composer update`.
305300

306-
## Other Laravel packages
301+
## Other Laravel Packages
307302

308-
[GrumPHP rector task](https://github.com/palpalani/grumphp-rector-task) GrumPHP with a task that runs [RectorPHP](https://github.com/rectorphp/rector-src) for your Laravel projects.
303+
[GrumPHP Rector task](https://github.com/palpalani/grumphp-rector-task) GrumPHP with a task that runs [RectorPHP](https://github.com/rectorphp/rector-src) for your Laravel projects.
309304

310-
[Email Deny List (blacklist) Check - IP Deny List (blacklist) Check](https://github.com/palpalani/laravel-dns-deny-list-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).
305+
[Email Deny List (blacklist) Check - IP Deny List (blacklist) Check](https://github.com/palpalani/laravel-dns-deny-list-check) Deny list (blacklist) checker that tests a mail server IP address against 50+ DNS-based email blacklists (commonly called Realtime blacklist, DNSBL, or RBL).
311306

312-
[Spamassassin spam score of emails](https://github.com/palpalani/laravel-spamassassin-score) Checks the spam score of email contents using spamassassin database.
307+
[SpamAssassin spam score of emails](https://github.com/palpalani/laravel-spamassassin-score) Checks the spam score of email contents using the SpamAssassin database.
313308

314-
[Laravel Login Notifications](https://github.com/palpalani/laravel-login-notifications) A login event notification for Laravel projects. By default, it will send notification only on production environment only.
309+
[Laravel Login Notifications](https://github.com/palpalani/laravel-login-notifications) A login event notification for Laravel projects. By default, it sends notifications only in the production environment.
315310

316-
[Laravel Toastr](https://github.com/palpalani/laravel-toastr) Implements toastr.js for Laravel. Toastr.js is a Javascript library for non-blocking notifications.
311+
[Laravel Toastr](https://github.com/palpalani/laravel-toastr) Implements toastr.js for Laravel. Toastr.js is a JavaScript library for non-blocking notifications.
317312

318-
[Beast](https://github.com/palpalani/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.
313+
[Beast](https://github.com/palpalani/beast) Beast is Screenshot as a Service using Node.js, Chrome, and AWS Lambda. Convert a webpage to an image using headless Chrome; takes a screenshot of any given URL/HTML content and returns a base64-encoded buffer.
319314

320-
[eCommerce Product Recommendations](https://github.com/palpalani/eCommerce-Product-Recommendations) Analyse order history of customers and recommend products for new customers which enables higher sales volume.
315+
[eCommerce Product Recommendations](https://github.com/palpalani/eCommerce-Product-Recommendations) Analyze order history of customers and recommend products for new customers to enable higher sales volume.
321316

322317
## Security Vulnerabilities
323318

@@ -330,7 +325,7 @@ Please review [our security policy](../../security/policy) on how to report secu
330325

331326
## Need Help?
332327

333-
If you spot a bug or have a question or feature request, please [submit a detailed issue](https://github.com/palpalani/laravel-sqs-queue-json-reader/issues), and wait for assistance.
328+
If you spot a bug or have a question or feature request, please [submit a detailed issue](https://github.com/palpalani/laravel-sqs-queue-json-reader/issues) and wait for assistance.
334329

335330
## License
336331

0 commit comments

Comments
 (0)