-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Dead lettering support #15
Conversation
* @param bool $passive | ||
* @param bool $durable | ||
* @param bool $autoDelete | ||
* @param int $deliveryMode | ||
*/ | ||
public function __construct(Connection $connection, $exchangeName, $exchangeType = 'fanout', $passive = false, $durable = true, $autoDelete = false, $deliveryMode = 2) | ||
public function __construct(Connection $connection, $queueName, $exchangeName, $exchangeType = 'fanout', $bindingKeys = [null], $passive = false, $durable = true, $autoDelete = false, $deliveryMode = 2) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
$bindingKeys = [null]
better be empty array, and do the check later
$deliveryMode = (int) $this->option('deliveryMode'); | ||
|
||
// Dead Lettering | ||
$deadLetterQueueName = ($qName = $this->option('deadLetterQueueName')) ? $qName : (($xName = $this->option('deadLetterExchangeName')) ? $xName : null); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
rename the var $xName
*/ | ||
private function compileArguments($deadLetterExchangeName, $deadLetterRoutingKey, $messageTtl) | ||
{ | ||
$this->arguments['x-dead-letter-exchange'] = ['S', $deadLetterExchangeName]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add comment to explain the 'S' argument
$this->Arguments['x-dead-letter-routing-key'] = ['S', $deadLetterRoutingKey]; | ||
} | ||
|
||
if($messageTtl) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
$messageTTL
As the implementation is currently, if a user intend to use dead lettering and a exception is thrown once the app exchange/queue are declared for what ever reason (e.g. config/params mismatch), the dlx queue and exchange will be created a priori. I am afraid this might lead to dangling queues and exchanges.
|
So that both the producer and consumer can take advantage of.
So we can get the producer/consumer exchange/queue declaration and other params
since these are specific to the consumer.
Figure out a way to give the producer access to these functionalities
And thus, setting up dead lettering as well
resolves #6
resolves #7
resolves #8
resolves #9
resolves #10
resolves #13
resolves #14
resolves #16
resolves #17