You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+88Lines changed: 88 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -73,6 +73,94 @@ Add connection to `config/queue.php`:
73
73
],
74
74
```
75
75
76
+
### Optional Config
77
+
78
+
Optionally add queue options to the config of a connection.
79
+
Every queue created for this connection, get's the properties.
80
+
81
+
When you want to prioritize messages when they were delayed, then this is possible by adding extra options.
82
+
- When max-priority is omitted, the max priority is set with 2 when used.
83
+
84
+
```php
85
+
'connections' => [
86
+
// ...
87
+
88
+
'rabbitmq' => [
89
+
// ...
90
+
91
+
'options' => [
92
+
'queue' => [
93
+
// ...
94
+
95
+
'prioritize_delayed_messages' => false,
96
+
'queue_max_priority' => 10,
97
+
],
98
+
],
99
+
],
100
+
101
+
// ...
102
+
],
103
+
```
104
+
105
+
When you want to publish messages against an exchange with routing-key's, then this is possible by adding extra options.
106
+
- When the exchange is omitted, RabbitMQ will use the `amq.direct` exchange for the routing-key
107
+
- When routing-key is omitted the routing-key by default is the `queue` name.
108
+
- When using `%s` in the routing-key the queue_name will be substituted.
109
+
110
+
> Note: when using exchange with routing-key, u probably create your queues with bindings yourself.
111
+
112
+
```php
113
+
'connections' => [
114
+
// ...
115
+
116
+
'rabbitmq' => [
117
+
// ...
118
+
119
+
'options' => [
120
+
'queue' => [
121
+
// ...
122
+
123
+
'exchange' => 'application-x',
124
+
'exchange_type' => 'topic',
125
+
'exchange_routing_key' => '',
126
+
],
127
+
],
128
+
],
129
+
130
+
// ...
131
+
],
132
+
```
133
+
134
+
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.
135
+
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.
136
+
- When the exchange is omitted, RabbitMQ will use the `amq.direct` exchange for the routing-key
137
+
- When routing-key is omitted, the routing-key by default the `queue` name is substituted with `'.failed'`.
138
+
- When using `%s` in the routing-key the queue_name will be substituted.
139
+
140
+
> Note: When using failed_job exchange with routing-key, u probably need to create your exchange/queue with bindings yourself.
141
+
142
+
```php
143
+
'connections' => [
144
+
// ...
145
+
146
+
'rabbitmq' => [
147
+
// ...
148
+
149
+
'options' => [
150
+
'queue' => [
151
+
// ...
152
+
153
+
'reroute_failed' => true,
154
+
'failed_exchange' => 'failed-exchange',
155
+
'failed_routing_key' => 'application-x.%s',
156
+
],
157
+
],
158
+
],
159
+
160
+
// ...
161
+
],
162
+
```
163
+
76
164
## Laravel Usage
77
165
78
166
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
0 commit comments