From 344bd46dadd149f5a4b9e1ce3cc3febaddc91730 Mon Sep 17 00:00:00 2001 From: Joe Baker Date: Thu, 17 Jan 2019 10:53:05 +0000 Subject: [PATCH 1/2] Laravel 5.7 queues compatibility --- src/Queue/KafkaQueue.php | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/Queue/KafkaQueue.php b/src/Queue/KafkaQueue.php index 7207394..565502f 100644 --- a/src/Queue/KafkaQueue.php +++ b/src/Queue/KafkaQueue.php @@ -80,7 +80,7 @@ public function size($queue = null) */ public function push($job, $data = '', $queue = null) { - return $this->pushRaw($this->createPayload($job, $data), $queue, []); + return $this->pushRaw($this->createPayload($job, $queue, $data), $queue, []); } /** @@ -98,6 +98,7 @@ public function pushRaw($payload, $queue = null, array $options = []) { try { $topic = $this->getTopic($queue); + \Illuminate\Support\Facades\Log::debug('queue: ' . $queue); $pushRawCorrelationId = $this->getCorrelationId(); @@ -222,14 +223,14 @@ public function getConfig() * Create a payload array from the given job and data. * * @param string $job - * @param mixed $data * @param string $queue + * @param mixed $data * * @return array */ - protected function createPayloadArray($job, $data = '', $queue = null) + protected function createPayloadArray($job, $queue = null, $data = '') { - return array_merge(parent::createPayloadArray($job, $data), [ + return array_merge(parent::createPayloadArray($job, $queue, $data), [ 'id' => $this->getCorrelationId(), 'attempts' => 0, ]); From 1d6c5c6c1ce5352c15a1fe735dbfe2888b2a64d8 Mon Sep 17 00:00:00 2001 From: Joe Baker Date: Thu, 17 Jan 2019 10:56:12 +0000 Subject: [PATCH 2/2] Cleanup --- src/Queue/KafkaQueue.php | 1 - 1 file changed, 1 deletion(-) diff --git a/src/Queue/KafkaQueue.php b/src/Queue/KafkaQueue.php index 565502f..2b41784 100644 --- a/src/Queue/KafkaQueue.php +++ b/src/Queue/KafkaQueue.php @@ -98,7 +98,6 @@ public function pushRaw($payload, $queue = null, array $options = []) { try { $topic = $this->getTopic($queue); - \Illuminate\Support\Facades\Log::debug('queue: ' . $queue); $pushRawCorrelationId = $this->getCorrelationId();