-
Notifications
You must be signed in to change notification settings - Fork 9.4k
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
[MessageQueue]: add support for first class queue configuration. #30111
base: 2.4-develop
Are you sure you want to change the base?
Conversation
Hi @Nolan-Arnold. Thank you for your contribution
❗ Automated tests can be triggered manually with an appropriate comment:
You can find more information about the builds here ℹ️ Please run only needed test builds instead of all when developing. Please run all test builds before sending your PR for review. For more details, please, review the Magento Contributor Guide documentation. 🕙 You can find the schedule on the Magento Community Calendar page. 📞 The triage of Pull Requests happens in the queue order. If you want to speed up the delivery of your contribution, please join the Community Contributions Triage session to discuss the appropriate ticket. 🎥 You can find the recording of the previous Community Contributions Triage on the Magento Youtube Channel ✏️ Feel free to post questions/proposals/feedback related to the Community Contributions Triage process to the corresponding Slack Channel |
Hi @Nolan-Arnold, thank you for your contribution! |
Hi @Nolan-Arnold. Thank you for your contribution
❗ Automated tests can be triggered manually with an appropriate comment:
You can find more information about the builds here ℹ️ Please run only needed test builds instead of all when developing. Please run all test builds before sending your PR for review. For more details, please, review the Magento Contributor Guide documentation. |
$autoDelete = $this->getAttributeValue($exchange, 'autoDelete', false); | ||
$result[$name . '--' . $connection] = [ | ||
'name' => $name, | ||
'type' => $this->getAttributeValue($exchange, 'type'), |
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.
Given that we're inside a loop over the queues, this property can be inferred without the extra attribute on the config node, correct?
@@ -256,6 +256,7 @@ | |||
<item name="array" xsi:type="object">arrayArgumentInterpreterProxy</item> | |||
<item name="boolean" xsi:type="object">Magento\Framework\Data\Argument\Interpreter\Boolean</item> | |||
<item name="number" xsi:type="object">Magento\Framework\Data\Argument\Interpreter\Number</item> | |||
<item name="int" xsi:type="object">Magento\Framework\Data\Argument\Interpreter\Integer</item> |
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.
I don't precisely know the full scope of how why this interpreter injection seems to occur in various hierarchies, but potentially this isn't in the scope of this PR?
cc: @paliarush
@@ -479,6 +479,7 @@ | |||
<item name="array" xsi:type="object">layoutArrayArgumentReaderInterpreterProxy</item> | |||
<item name="boolean" xsi:type="object">Magento\Framework\Data\Argument\Interpreter\Boolean</item> | |||
<item name="number" xsi:type="object">Magento\Framework\Data\Argument\Interpreter\Number</item> | |||
<item name="int" xsi:type="object">Magento\Framework\Data\Argument\Interpreter\Integer</item> |
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.
I don't precisely know the full scope of how why this interpreter injection seems to occur in various hierarchies, but potentially this isn't in the scope of this PR?
cc: @paliarush
@@ -23,4 +23,20 @@ public function __construct( | |||
) { | |||
parent::__construct($reader, $cache, $cacheId, $serializer); | |||
} | |||
|
|||
public function getQueues(): array { |
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.
Since ->get()
loses backward compatibility (it returns both exchanges
and queues
when it used to only return exchanges
), how should we consider the compatibility of this API?
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.
cc: @paliarush
* @throws \LogicException | ||
*/ | ||
private function validateQueueTypes($queueName, $queueConfig) | ||
{ |
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.
What validation should be provided here?
foreach ($diff as $field) { | ||
$errors[] = sprintf('Missing [%s] field for binding %s in exchange config.', $field, $name); | ||
$errors[] = sprintf('Really Missing [%s] field for queue %s.', $field, $name); |
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.
@Nolan-Arnold is the emphatic Really
necessary?
@@ -99,6 +99,41 @@ public function convert($source) | |||
'arguments' => $exchangeArguments, | |||
]; | |||
} | |||
|
|||
foreach ($source->getElementsByTagName('queue') as $exchange) { |
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.
$exchange
should be $queue
7b096aa
to
7762e5a
Compare
Hey @Nolan-Arnold are you still working on this? Can you check comments and also backmerge 2.4 into your branch? |
{ | ||
/** | ||
* {@inheritdoc} | ||
* @return int|float |
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.
Since you're returning an int
, the return value should just be int
right?
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.
Oh I thought this was new stuff, but clearly confused 😄
Co-authored-by: Damien Retzinger [email protected]
Description (*)
The Message Broker, RabbitMQ, supports
arguments
that are defined at queue creation time that dictate certain behaviors of the resulting queue. Currently (as of v2.4.0), Magento infers what queues will be created from properties of theexchange.binding
defined in any given module'squeue_topology.xml
.Unfortunately, the current implementation of
queue_topology.xml
does not expose a queue object to specify arguments at queue creation time, preventing utilization of the configurable behavior of RabbitMQ queues.Related Pull Requests
https://github.com/magento/architecture/pull/432/files
Manual testing scenarios (*)
https://github.com/magento/architecture/blob/master/design-documents/message-queue/first-class-queue-configuration.md#sample-configurations
Contribution checklist (*)
CC: @damienwebdev @nrkapoor @paliarush @nuzil @maghamed