Skip to content

Commit c999376

Browse files
committed
fix delete() and add getQueue() methods
delete() must call parent delete() in order to properly mark the job deleted. getQueue() must be implemented since the inherited $queue which should be a string is being replaced by the AMQPQueue object. this should actually be changed to its own $amqp variable and $queue should always be a string
1 parent 205b6ac commit c999376

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

src/FintechFab/LaravelQueueRabbitMQ/Queue/Jobs/RabbitMQJob.php

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,20 @@ public function getRawBody()
4545
*/
4646
public function delete()
4747
{
48+
parent::delete();
4849
$this->queue->ack($this->envelope->getDeliveryTag());
4950
}
5051

52+
/**
53+
* Get queue name
54+
*
55+
* @return string
56+
*/
57+
public function getQueue()
58+
{
59+
return $this->queue->getName();
60+
}
61+
5162
/**
5263
* Release the job back into the queue.
5364
*
@@ -100,4 +111,4 @@ public function getJobId()
100111
return $this->envelope->getMessageId();
101112
}
102113

103-
}
114+
}

0 commit comments

Comments
 (0)