Skip to content

Commit f868b70

Browse files
committed
1 parent 0284d49 commit f868b70

File tree

3 files changed

+5
-3
lines changed

3 files changed

+5
-3
lines changed

src/Console/ConsumeCommand.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ class ConsumeCommand extends WorkCommand
1010
{
1111
protected $signature = 'rabbitmq:consume
1212
{connection? : The name of the queue connection to work}
13+
{--name=default : The name of the consumer}
1314
{--queue= : The names of the queues to work}
1415
{--once : Only process the next job on the queue}
1516
{--stop-when-empty : Stop when the queue is empty}
@@ -33,6 +34,7 @@ public function handle(): void
3334
$consumer = $this->worker;
3435

3536
$consumer->setContainer($this->laravel);
37+
$consumer->setName($this->option('name'));
3638
$consumer->setConsumerTag($this->consumerTag());
3739
$consumer->setPrefetchSize((int) $this->option('prefetch-size'));
3840
$consumer->setPrefetchCount((int) $this->option('prefetch-count'));

src/Horizon/RabbitMQQueue.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@
44

55
use Illuminate\Contracts\Container\BindingResolutionException;
66
use Illuminate\Contracts\Events\Dispatcher;
7+
use Illuminate\Support\Str;
78
use Laravel\Horizon\Events\JobDeleted;
89
use Laravel\Horizon\Events\JobPushed;
910
use Laravel\Horizon\Events\JobReserved;
10-
use Laravel\Horizon\JobId;
1111
use Laravel\Horizon\JobPayload;
1212
use PhpAmqpLib\Exception\AMQPProtocolChannelException;
1313
use VladimirYuldashev\LaravelQueueRabbitMQ\Queue\Jobs\RabbitMQJob;
@@ -125,6 +125,6 @@ protected function event($queue, $event): void
125125
*/
126126
protected function getRandomId(): string
127127
{
128-
return JobId::generate();
128+
return Str::uuid();
129129
}
130130
}

src/Queue/RabbitMQQueue.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -544,7 +544,7 @@ protected function createPayloadArray($job, $queue, $data = '')
544544
*/
545545
protected function getRandomId(): string
546546
{
547-
return Str::random(32);
547+
return Str::uuid();
548548
}
549549

550550
/**

0 commit comments

Comments
 (0)