File tree Expand file tree Collapse file tree 1 file changed +25
-0
lines changed Expand file tree Collapse file tree 1 file changed +25
-0
lines changed Original file line number Diff line number Diff line change @@ -262,6 +262,31 @@ class RabbitMQJob extends BaseJob
262262}
263263```
264264
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+
265290### Use your own Connection
266291
267292You can extend the built-in `PhpAmqpLib\Connection\AMQPStreamConnection::class`
You can’t perform that action at this time.
0 commit comments