Skip to content

Commit 9308d90

Browse files
committed
Add missing container instance and connectionName to RabbitMQJob
1 parent 3169ae1 commit 9308d90

File tree

3 files changed

+17
-2
lines changed

3 files changed

+17
-2
lines changed

CHANGELOG.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,11 @@
22

33
All notable changes to this project will be documented in this file.
44

5-
## [10.0.0 (2019-12-12)](https://github.com/vyuldashev/laravel-queue-rabbitmq/compare/v9.0...master)
5+
## [10.0.1 (2019-12-13)](https://github.com/vyuldashev/laravel-queue-rabbitmq/compare/v10.0.0...v10.0.1)
6+
7+
- Add missing container instance and connectionName to RabbitMQJob
8+
9+
## [10.0.0 (2019-12-12)](https://github.com/vyuldashev/laravel-queue-rabbitmq/compare/v9.0...v10.0.0)
610

711
- Switch from enqueue to [php-amqplib](https://github.com/php-amqplib/php-amqplib)
812
- Fix [#235](https://github.com/vyuldashev/laravel-queue-rabbitmq/issues/235)

src/Queue/Jobs/RabbitMQJob.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
namespace VladimirYuldashev\LaravelQueueRabbitMQ\Queue\Jobs;
44

5+
use Illuminate\Container\Container;
56
use Illuminate\Contracts\Container\BindingResolutionException;
67
use Illuminate\Contracts\Queue\Job as JobContract;
78
use Illuminate\Queue\Jobs\Job;
@@ -35,12 +36,16 @@ class RabbitMQJob extends Job implements JobContract
3536
protected $decoded;
3637

3738
public function __construct(
39+
Container $container,
3840
RabbitMQQueue $rabbitmq,
3941
AMQPMessage $message,
42+
string $connectionName,
4043
string $queue
4144
) {
45+
$this->container = $container;
4246
$this->rabbitmq = $rabbitmq;
4347
$this->message = $message;
48+
$this->connectionName = $connectionName;
4449
$this->queue = $queue;
4550
$this->decoded = $this->payload();
4651
}

src/Queue/RabbitMQQueue.php

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,13 @@ public function pop($queue = null)
198198

199199
/** @var AMQPMessage|null $message */
200200
if ($message = $this->channel->basic_get($queue)) {
201-
return new RabbitMQJob($this, $message, $queue);
201+
return new RabbitMQJob(
202+
$this->container,
203+
$this,
204+
$message,
205+
$this->connectionName,
206+
$queue
207+
);
202208
}
203209
} catch (AMQPProtocolChannelException $exception) {
204210
// if there is not exchange or queue AMQP will throw exception with code 404

0 commit comments

Comments
 (0)