Skip to content

[Messenger] Publishing message should not create and bind a queue #26937

Closed
@davidbarratt

Description

@davidbarratt
Q A
Bug report? yes
Feature request? no
BC Break report? no
RFC? no
Symfony version 4.1

If you are publishing messages only (and another application is receiving them), then a queue should not be declared/bound.

The queue declaration and binding found here:

$this->queue()->declareQueue();
$this->queue()->bind($this->exchange()->getName(), $this->queueConfiguration['routing_key'] ?? null);

Should not run within publish()

public function publish(string $body, array $headers = array()): void
{
if ($this->debug) {
$this->setup();
}
$this->exchange()->publish($body, null, AMQP_NOPARAM, array('headers' => $headers));
}

The work around to this issue, is to ensure that the application listening for the messages uses the same queue name.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions