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 @@ -262,6 +262,32 @@ class RabbitMQJob extends BaseJob
262
262
}
263
263
```
264
264
265
+ If you want to handle raw message, not in JSON format or without 'job' key in JSON, you should add stub for ` getName ` method:
266
+ ``` php
267
+ <?php
268
+
269
+ namespace App\Queue\Jobs;
270
+
271
+ use Illuminate\Support\Facades\Log;
272
+ use VladimirYuldashev\LaravelQueueRabbitMQ\Queue\Jobs\RabbitMQJob as BaseJob;
273
+
274
+ class RabbitMQJob extends BaseJob
275
+ {
276
+ public function fire()
277
+ {
278
+ $anyMessage = $this->getRawBody();
279
+ Log::info($anyMessage);
280
+
281
+ $this->delete();
282
+ }
283
+
284
+ public function getName()
285
+ {
286
+ return '';
287
+ }
288
+ }
289
+ ```
290
+
265
291
### Use your own Connection
266
292
267
293
You can extend the built-in ` PhpAmqpLib\Connection\AMQPStreamConnection::class `
You can’t perform that action at this time.
0 commit comments