Skip to content

Commit 5c4e288

Browse files
committed
Merge branch 'master' into changelog-13x-release-13_3_0
2 parents 46f4780 + d174b95 commit 5c4e288

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
@@ -262,6 +262,32 @@ 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+
```
290+
265291
### Use your own Connection
266292

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

0 commit comments

Comments
 (0)