Skip to content

Commit 8bdad7c

Browse files
Merge branch 'master' into no-support-for-multiple-queues
2 parents 151d952 + d20f624 commit 8bdad7c

22 files changed

+255
-184
lines changed

.github/workflows/tests.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,8 @@ jobs:
4242
- name: Install dependencies
4343
run: composer update --${{ matrix.stability }} --prefer-dist --no-interaction --no-progress
4444

45-
- name: Run PHP CS Fixer
46-
if: ${{ matrix.php != 8.0 }}
47-
run: vendor/bin/php-cs-fixer fix --config=.php-cs-fixer.dist.php --allow-risky=yes --dry-run --diff --verbose
45+
- name: Run Laravel Pint
46+
run: ./vendor/bin/pint --test
4847

4948
- name: Execute tests
5049
run: sleep 10 && vendor/bin/phpunit --verbose

.php-cs-fixer.dist.php

Lines changed: 0 additions & 57 deletions
This file was deleted.

.styleci.yml

Lines changed: 0 additions & 2 deletions
This file was deleted.

CHANGELOG-12x.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,11 @@
22

33
All notable changes to this project will be documented in this file.
44

5-
## [Unreleased](https://github.com/vyuldashev/laravel-queue-rabbitmq/compare/v12.0.0...master)
5+
## [Unreleased](https://github.com/vyuldashev/laravel-queue-rabbitmq/compare/v12.0.1...master)
6+
7+
## [12.0.1 (2022-04-06)](https://github.com/vyuldashev/laravel-queue-rabbitmq/compare/v12.0.0...v12.0.1)
8+
9+
- Allow laravel to end workers with lost connection [#457](https://github.com/vyuldashev/laravel-queue-rabbitmq/pull/457)
610

711
## [12.0.0 (2022-02-23)](https://github.com/vyuldashev/laravel-queue-rabbitmq/compare/v11.4.0...v12.0.0)
812

CHANGELOG-13x.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# Changelog
2+
3+
All notable changes to this project will be documented in this file.
4+
5+
## [Unreleased](https://github.com/vyuldashev/laravel-queue-rabbitmq/compare/v13.1.0...master)
6+
7+
## [13.1.0 (2023-01-25)](https://github.com/vyuldashev/laravel-queue-rabbitmq/compare/v13.0.1...v13.1.0)
8+
9+
- Fix delay parameter not being used [#502](https://github.com/vyuldashev/laravel-queue-rabbitmq/pull/502)
10+
- Resolve Laravel 9 incompatabilities [#502](https://github.com/vyuldashev/laravel-queue-rabbitmq/pull/502)
11+
- Fix Horizon invalid delay property [#502](https://github.com/vyuldashev/laravel-queue-rabbitmq/pull/502)
12+
13+
## [13.0.1 (2022-09-16)](https://github.com/vyuldashev/laravel-queue-rabbitmq/compare/v13.0.0...v13.0.1)
14+
15+
- Add $dispatchAfterCommit when running via Horizon [#484](https://github.com/vyuldashev/laravel-queue-rabbitmq/pull/484)
16+
17+
## [13.0.0 (2022-09-15)](https://github.com/vyuldashev/laravel-queue-rabbitmq/compare/v12.0.1...v13.0.0)
18+
19+
- Dispatch a job after DB transaction commit [#468](https://github.com/vyuldashev/laravel-queue-rabbitmq/pull/468)

README.md

Lines changed: 31 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,9 @@ RabbitMQ Queue driver for Laravel
1010

1111
Only the latest version will get new features. Bug fixes will be provided using the following scheme:
1212

13-
| Package Version | Laravel Version | Bug Fixes Until | |
14-
|-----------------|-----------------|---------------------|---------------------------------------------------------------------------------------------|
15-
| 9 | 6 | October 5th, 2021 | [Documentation](https://github.com/vyuldashev/laravel-queue-rabbitmq/blob/v9.0/README.md) |
16-
| 10 | 6, 7 | October 5th, 2021 | [Documentation](https://github.com/vyuldashev/laravel-queue-rabbitmq/blob/v10.0/README.md) |
17-
| 11 | 8 | April 6th, 2021 | [Documentation](https://github.com/vyuldashev/laravel-queue-rabbitmq/blob/master/README.md) |
13+
| Package Version | Laravel Version | Bug Fixes Until | |
14+
|-----------------|-----------------|------------------|---------------------------------------------------------------------------------------------|
15+
| 13 | 9 | August 8th, 2023 | [Documentation](https://github.com/vyuldashev/laravel-queue-rabbitmq/blob/master/README.md) |
1816

1917
## Installation
2018

@@ -65,7 +63,7 @@ Add connection to `config/queue.php`:
6563
* Set to "horizon" if you wish to use Laravel Horizon.
6664
*/
6765
'worker' => env('RABBITMQ_WORKER', 'default'),
68-
66+
'after_commit' => false,
6967
],
7068

7169
// ...
@@ -74,10 +72,11 @@ Add connection to `config/queue.php`:
7472

7573
### Optional Config
7674

77-
Optionally add queue options to the config of a connection.
78-
Every queue created for this connection, get's the properties.
75+
Optionally add queue options to the config of a connection.
76+
Every queue created for this connection, gets the properties.
7977

8078
When you want to prioritize messages when they were delayed, then this is possible by adding extra options.
79+
8180
- When max-priority is omitted, the max priority is set with 2 when used.
8281

8382
```php
@@ -101,13 +100,14 @@ When you want to prioritize messages when they were delayed, then this is possib
101100
],
102101
```
103102

104-
When you want to publish messages against an exchange with routing-key's, then this is possible by adding extra options.
103+
When you want to publish messages against an exchange with routing-keys, then this is possible by adding extra options.
104+
105105
- When the exchange is omitted, RabbitMQ will use the `amq.direct` exchange for the routing-key
106106
- When routing-key is omitted the routing-key by default is the `queue` name.
107107
- When using `%s` in the routing-key the queue_name will be substituted.
108108

109-
> Note: when using exchange with routing-key, u probably create your queues with bindings yourself.
110-
109+
> Note: when using an exchange with routing-key, you probably create your queues with bindings yourself.
110+
111111
```php
112112
'connections' => [
113113
// ...
@@ -130,14 +130,18 @@ When you want to publish messages against an exchange with routing-key's, then t
130130
],
131131
```
132132

133-
In Laravel failed jobs are stored into the database. But maybe you want to instruct some other process to also do something with the message.
134-
When you want to instruct RabbitMQ to reroute failed messages to a exchange or a specific queue, then this is possible by adding extra options.
133+
In Laravel failed jobs are stored into the database. But maybe you want to instruct some other process to also do
134+
something with the message.
135+
When you want to instruct RabbitMQ to reroute failed messages to a exchange or a specific queue, then this is possible
136+
by adding extra options.
137+
135138
- When the exchange is omitted, RabbitMQ will use the `amq.direct` exchange for the routing-key
136139
- When routing-key is omitted, the routing-key by default the `queue` name is substituted with `'.failed'`.
137140
- When using `%s` in the routing-key the queue_name will be substituted.
138141

139-
> Note: When using failed_job exchange with routing-key, u probably need to create your exchange/queue with bindings yourself.
140-
142+
> Note: When using failed_job exchange with routing-key, you probably need to create your exchange/queue with bindings
143+
> yourself.
144+
141145
```php
142146
'connections' => [
143147
// ...
@@ -161,12 +165,14 @@ When you want to instruct RabbitMQ to reroute failed messages to a exchange or a
161165
```
162166

163167
### Use your own RabbitMQJob class
168+
164169
Sometimes you have to work with messages published by another application.
165170
Those messages probably won't respect Laravel's job payload schema.
166-
The problem with these messages is that, Laravel workers won't be able to determine the actual job or class to execute.
171+
The problem with these messages is that, Laravel workers won't be able to determine the actual job or class to execute.
167172

168173
You can extend the build-in `RabbitMQJob::class` and within the queue connection config, you can define your own class.
169-
When you specify an `job` key in the config, with your own class name, every message retrieved from the broker will get wrapped by your own class.
174+
When you specify a `job` key in the config, with your own class name, every message retrieved from the broker will get
175+
wrapped by your own class.
170176

171177
An example for the config:
172178

@@ -250,11 +256,14 @@ class RabbitMQJob extends BaseJob
250256

251257
## Laravel Usage
252258

253-
Once you completed the configuration you can use Laravel Queue API. If you used other queue drivers you do not need to change anything else. If you do not know how to use Queue API, please refer to the official Laravel documentation: http://laravel.com/docs/queues
259+
Once you completed the configuration you can use the Laravel Queue API. If you used other queue drivers you do not need to
260+
change anything else. If you do not know how to use the Queue API, please refer to the official Laravel
261+
documentation: http://laravel.com/docs/queues
254262

255263
## Laravel Horizon Usage
256264

257-
Starting with 8.0, this package supports [Laravel Horizon](http://horizon.laravel.com) out of the box. Firstly, install Horizon and then set `RABBITMQ_WORKER` to `horizon`.
265+
Starting with 8.0, this package supports [Laravel Horizon](http://horizon.laravel.com) out of the box. Firstly, install
266+
Horizon and then set `RABBITMQ_WORKER` to `horizon`.
258267

259268
## Lumen Usage
260269

@@ -266,7 +275,7 @@ $app->register(VladimirYuldashev\LaravelQueueRabbitMQ\LaravelQueueRabbitMQServic
266275

267276
## Consuming Messages
268277

269-
There are two ways of consuming messages.
278+
There are two ways of consuming messages.
270279

271280
1. `queue:work` command which is Laravel's built-in command. This command utilizes `basic_get`. Use this if you want to consume multiple queues.
272281

@@ -302,4 +311,5 @@ composer fix:style
302311

303312
## Contribution
304313

305-
You can contribute to this package by discovering bugs and opening issues. Please, add to which version of package you create pull request or issue. (e.g. [5.2] Fatal error on delayed job)
314+
You can contribute to this package by discovering bugs and opening issues. Please, add to which version of package you
315+
create pull request or issue. (e.g. [5.2] Fatal error on delayed job)

composer.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@
1818
"phpunit/phpunit": "^9.3",
1919
"mockery/mockery": "^1.0",
2020
"laravel/horizon": "^5.0",
21-
"friendsofphp/php-cs-fixer": "^3.6",
22-
"orchestra/testbench": "^7.0"
21+
"orchestra/testbench": "^7.0",
22+
"laravel/pint": "^1.2"
2323
},
2424
"autoload": {
2525
"psr-4": {
@@ -33,7 +33,7 @@
3333
},
3434
"extra": {
3535
"branch-alias": {
36-
"dev-master": "11.0-dev"
36+
"dev-master": "13.0-dev"
3737
},
3838
"laravel": {
3939
"providers": [

src/Console/ExchangeDeclareCommand.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@ class ExchangeDeclareCommand extends Command
1818
protected $description = 'Declare exchange';
1919

2020
/**
21-
* @param RabbitMQConnector $connector
21+
* @param RabbitMQConnector $connector
22+
*
2223
* @throws Exception
2324
*/
2425
public function handle(RabbitMQConnector $connector): void

src/Console/ExchangeDeleteCommand.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@ class ExchangeDeleteCommand extends Command
1616
protected $description = 'Delete exchange';
1717

1818
/**
19-
* @param RabbitMQConnector $connector
19+
* @param RabbitMQConnector $connector
20+
*
2021
* @throws Exception
2122
*/
2223
public function handle(RabbitMQConnector $connector): void

src/Console/QueueBindCommand.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@ class QueueBindCommand extends Command
1717
protected $description = 'Bind queue to exchange';
1818

1919
/**
20-
* @param RabbitMQConnector $connector
20+
* @param RabbitMQConnector $connector
21+
*
2122
* @throws Exception
2223
*/
2324
public function handle(RabbitMQConnector $connector): void

0 commit comments

Comments
 (0)