Added PublishEvent listener connection and queue configuration feature
This commit is contained in:
@@ -5,7 +5,7 @@ declare(strict_types=1);
|
||||
namespace Diffhead\PHP\LaravelRabbitMQ\Command;
|
||||
|
||||
use Diffhead\PHP\LaravelRabbitMQ\Dto\ConsumerParameters;
|
||||
use Diffhead\PHP\LaravelRabbitMQ\Object\Connection;
|
||||
use Diffhead\PHP\LaravelRabbitMQ\Object\ConnectionWithChannel;
|
||||
use Diffhead\PHP\LaravelRabbitMQ\Object\Exchange;
|
||||
use Diffhead\PHP\LaravelRabbitMQ\Object\ExchangeDeclaration;
|
||||
use Diffhead\PHP\LaravelRabbitMQ\Object\Queue;
|
||||
@@ -31,7 +31,7 @@ class Consume extends Command
|
||||
*/
|
||||
protected $description = 'Consume messages from RabbitMQ';
|
||||
|
||||
private ?Connection $connection = null;
|
||||
private ?ConnectionWithChannel $connection = null;
|
||||
|
||||
public function handle(
|
||||
Configuration $configuration,
|
||||
@@ -40,7 +40,10 @@ class Consume extends Command
|
||||
LoggerInterface $logger
|
||||
): void {
|
||||
$params = ConsumerParameters::fromArray($this->options());
|
||||
$config = $configuration->get($params->connection->value() ?? 'default');
|
||||
|
||||
$config = $configuration->getConnection(
|
||||
$params->connection->value() ?? 'default'
|
||||
);
|
||||
|
||||
$queue = $this->getQueue($params);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user