Skip to content

Commit

Permalink
move handler initialisation to inside the message receipt callback
Browse files Browse the repository at this point in the history
  • Loading branch information
Mulkave committed Nov 7, 2018
1 parent d148f55 commit 4599ac8
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/Consumer.php
Original file line number Diff line number Diff line change
Expand Up @@ -139,10 +139,10 @@ public function listenToQueue($handlerClass, BowlerExceptionHandler $exceptionHa
$channel->queue_bind($this->queueName, $this->exchangeName);
}

// Instantiate Handler
$queueHandler = app($handlerClass);
$callback = function ($message) use ($handlerClass, $exceptionHandler) {
// Instantiate Handler
$queueHandler = app($handlerClass);

$callback = function ($message) use ($queueHandler, $exceptionHandler) {
$broker = new MessageBroker($message);

try {
Expand Down

0 comments on commit 4599ac8

Please sign in to comment.