File tree Expand file tree Collapse file tree 1 file changed +26
-0
lines changed Expand file tree Collapse file tree 1 file changed +26
-0
lines changed Original file line number Diff line number Diff line change @@ -254,6 +254,32 @@ class RabbitMQJob extends BaseJob
254
254
}
255
255
```
256
256
257
+ If you want to handle raw message, not in JSON format or without 'job' key in JSON, you should add stub for ` getName ` method:
258
+ ``` php
259
+ <?php
260
+
261
+ namespace App\Queue\Jobs;
262
+
263
+ use Illuminate\Support\Facades\Log;
264
+ use VladimirYuldashev\LaravelQueueRabbitMQ\Queue\Jobs\RabbitMQJob as BaseJob;
265
+
266
+ class RabbitMQJob extends BaseJob
267
+ {
268
+ public function fire()
269
+ {
270
+ $anyMessage = $this->getRawBody();
271
+ Log::info($anyMessage);
272
+
273
+ $this->delete();
274
+ }
275
+
276
+ public function getName()
277
+ {
278
+ return '';
279
+ }
280
+ }
281
+ ```
282
+
257
283
## Laravel Usage
258
284
259
285
Once you completed the configuration you can use the Laravel Queue API. If you used other queue drivers you do not need to
You can’t perform that action at this time.
0 commit comments