You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Symfony version(s) affected: 5.* Description
The transport configuration - auto_setup: true (that is the default) will try to create the exchange, the queue(s) and try to bind them, for every message retrieved from the queue, leading to low get/acknowledge rate.
AmqpExt\Connection.php
/**
* Gets a message from the specified queue.
*
* @throws \AMQPException
*/
public function get(string $queueName): ?\AMQPEnvelope
{
$this->clearWhenDisconnected();
**if ($this->shouldSetup()) {
$this->setupExchangeAndQueues();
}**
Possible Solution
if ($this->shouldSetup() && !in_array($queueName, $this->setupQueues)) {
$this->setupExchangeAndQueues();
array_push($this->setupQueues, $queueName);
}
This means $this->setupExchangeAndQueues() will be called only once when starting the consumer instance.
If queue / exchange are deleted while consumer is running
/**
* Gets a message from the specified queue.
*
* @throws \AMQPException
*/
public function get(string $queueName): ?\AMQPEnvelope
{
..........
} catch (\AMQPQueueException $e) {
if (404 === $e->getCode() && $this->shouldSetup()) {
$this->clearWhenDisconnected();
// If we get a 404 for the queue, it means we need to set up the exchange & queue.
$this->setupExchangeAndQueues();
return $this->get($queueName);
}
throw $e;
}
........
Additional context
Not sure if there are any cases when this issue can occur.
This issue is very possible to occur when sending messages also.
The text was updated successfully, but these errors were encountered:
This PR was merged into the 5.3-dev branch.
Discussion
----------
[Messenger] Setup queues once in AMQP
| Q | A
| ------------- | ---
| Branch? | 5.x
| Bug fix? | no
| New feature? | yes
| Deprecations? | no
| Tickets | Fix#39605, Fix#38092, Fix#32172
| License | MIT
| Doc PR | -
To ease the setup, this PR also merge setup of exchange AND delayExchange.
/cc @Nyholm
Commits
-------
c2e84c6 Setup queues once in AMQP
Uh oh!
There was an error while loading. Please reload this page.
Symfony version(s) affected: 5.*
Description
The transport configuration - auto_setup: true (that is the default) will try to create the exchange, the queue(s) and try to bind them, for every message retrieved from the queue, leading to low get/acknowledge rate.
AmqpExt\Connection.php
Possible Solution
This means $this->setupExchangeAndQueues() will be called only once when starting the consumer instance.
If queue / exchange are deleted while consumer is running
Additional context
Not sure if there are any cases when this issue can occur.
This issue is very possible to occur when sending messages also.
The text was updated successfully, but these errors were encountered: