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 @@ -288,6 +288,32 @@ class RabbitMQJob extends BaseJob
288
288
}
289
289
```
290
290
291
+ If you want to handle raw message, not in JSON format or without 'job' key in JSON, you should add stub for ` getName ` method:
292
+ ``` php
293
+ <?php
294
+
295
+ namespace App\Queue\Jobs;
296
+
297
+ use Illuminate\Support\Facades\Log;
298
+ use VladimirYuldashev\LaravelQueueRabbitMQ\Queue\Jobs\RabbitMQJob as BaseJob;
299
+
300
+ class RabbitMQJob extends BaseJob
301
+ {
302
+ public function fire()
303
+ {
304
+ $anyMessage = $this->getRawBody();
305
+ Log::info($anyMessage);
306
+
307
+ $this->delete();
308
+ }
309
+
310
+ public function getName()
311
+ {
312
+ return '';
313
+ }
314
+ }
315
+ ```
316
+
291
317
### Use your own Connection
292
318
293
319
You can extend the built-in ` PhpAmqpLib\Connection\AMQPStreamConnection::class `
You can’t perform that action at this time.
0 commit comments