Skip to content

Commit 7690c9c

Browse files
committed
Merge branch 'master' into feature/support-octane-reconnect
2 parents 8da5b9d + d174b95 commit 7690c9c

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

README.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -288,6 +288,32 @@ class RabbitMQJob extends BaseJob
288288
}
289289
```
290290

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+
291317
### Use your own Connection
292318

293319
You can extend the built-in `PhpAmqpLib\Connection\AMQPStreamConnection::class`

0 commit comments

Comments
 (0)