Skip to content

Commit 8422e40

Browse files
committed
add method getJobId & update doc
1 parent b9b71ca commit 8422e40

File tree

2 files changed

+14
-4
lines changed

2 files changed

+14
-4
lines changed

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ Tencent Cloud Message Queue driver for Laravel Queue
1818

1919
## Configure
2020

21-
**Laravel 5.5 uses Package Auto-Discovery, so doesn't require you to manually add the ServiceProvider.**
21+
**Laravel 5.5+ uses Package Auto-Discovery, so doesn't require you to manually add the ServiceProvider.**
2222

2323
1. `config/app.php`:
2424

@@ -63,13 +63,13 @@ Once you completed the configuration you can use Laravel Queue API. If you used
6363

6464
```php
6565
//use queue only
66-
dispatch((new Job)->onQueue('queue-name'));
66+
Job::dispatch()->onQueue('queue-name');
6767

6868
//use topic and tag filter
69-
dispatch((new Job)->onQueue('tag1,tag2,tag3'));
69+
Job::dispatch()->onQueue('tag1,tag2,tag3');
7070

7171
//use topic and routing filter
72-
dispatch((new Job)->onQueue('routing-key'));
72+
Job::dispatch()->onQueue('routing-key');
7373
```
7474

7575
## Document

src/Queue/Jobs/CMQJob.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,16 @@ public function __construct(Container $container, CMQQueue $connection, Message
2525
$this->queue = $queue->getQueueName();
2626
}
2727

28+
/**
29+
* Get the job identifier.
30+
*
31+
* @return string
32+
*/
33+
public function getJobId()
34+
{
35+
return $this->message->msgId;
36+
}
37+
2838
/**
2939
* Get the raw body of the job.
3040
*

0 commit comments

Comments
 (0)