Skip to content

Commit aedd575

Browse files
author
palPalani
committed
Add uuid
1 parent 94861f8 commit aedd575

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

src/Sqs/Queue.php

+3-4
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
use Illuminate\Queue\SqsQueue;
77
use Illuminate\Support\Facades\Config;
88
use Illuminate\Support\Facades\Log;
9+
use Illuminate\Support\Str;
910
use palPalani\SqsQueueReader\Jobs\DispatcherJob;
1011

1112
/**
@@ -81,11 +82,8 @@ public function pop($queue = null)
8182

8283
$response = $this->modifyPayload($response['Messages'], $class);
8384
Log::debug('New $responseV2==', [$response]);
84-
if (preg_match('/(5\.[4-8]\..*)|(6\.[0-9]*\..*)|(7\.[0-9]*\..*)|(8\.[0-9]*\..*)/', $this->container->version())) {
85-
return new SqsJob($this->container, $this->sqs, $response, $this->connectionName, $queue);
86-
}
8785

88-
return new SqsJob($this->container, $this->sqs, $queue, $response);
86+
return new SqsJob($this->container, $this->sqs, $response, $this->connectionName, $queue);
8987
}
9088
}
9189

@@ -122,6 +120,7 @@ private function modifyPayload($payload, $class)
122120
}
123121

124122
$body = [
123+
'uuid' => (string) Str::uuid(),
125124
'job' => $class . '@handle',
126125
'data' => $body,
127126
];

src/SqsQueueReaderServiceProvider.php

+2
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
namespace palPalani\SqsQueueReader;
44

55
use Illuminate\Queue\Events\JobProcessed;
6+
use Illuminate\Support\Facades\Log;
67
use Illuminate\Support\Facades\Queue;
78
use Illuminate\Support\ServiceProvider;
89
use palPalani\SqsQueueReader\Sqs\Connector;
@@ -17,6 +18,7 @@ public function boot(): void
1718
], 'config');
1819

1920
Queue::after(static function (JobProcessed $event) {
21+
Log::debug('Job data==', [$event->job]);
2022
$event->job->delete();
2123
});
2224
}

0 commit comments

Comments
 (0)