Skip to content

MultipleConsumer inconsistency #738

@tribe-tja

Description

@tribe-tja

BaseAmqp.php has a method queueDeclare that is overriden by MultipleConsumer.php, in the foreach it is iterating through queues and calls queue_declare method for each of them.

It seems like there's a check missing if we actually want to declare it or not, just as in BaseAmqp

if ($this->queueOptions['declare']) {

The fix could look like this, as we would need to cover current users without that key as well. Additionally QueuesProviderInterface example should be updated to accept such key

 foreach ($this->queues as $name => $options) {
      if (! ($options['declare'] ?? true)) {
          continue;
      }
  
      [$queueName, , ] = $this->getChannel()->queue_declare(
     ...
}

Of course auto_setup_fabric: false option can be used, but for consistency sake i would encourage the change

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions