-
Notifications
You must be signed in to change notification settings - Fork 9.3k
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
Extended message queue consumer configuration with parameters "maxIdl… #27850
Extended message queue consumer configuration with parameters "maxIdl… #27850
Conversation
Hi @Neos2007. Thank you for your contribution
For more details, please, review the Magento Contributor Guide documentation. |
Hi @Neos2007, thank you for your contribution! |
@Neos2007 unfortunately, only members of the maintainers team are allowed to assign developers to the pull request |
Hi @Neos2007, thank you for your contribution! |
Hi @Neos2007, thank you for your contribution! |
@magento run all tests |
…in unit tests after merging updated 2.4-develop branch.
Hi @Neos2007! What is the status of this PR? Are you going to proceed with it? |
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.
Please, check my review comment about CallbackInvoker::invoke $sleep variable. No more review comments from my side.
I also tested your solution: maxIdleTime, sleep, onlySpawnWhenMessageAvailable
options work fine.
I ran all tests against your code and only Semantic Version Checker fails with minor changes because of new options added to xsd schema. I guess it should be approved.
Please, let me know if you need any assistance with your PR. Thanks! Good job!
lib/internal/Magento/Framework/MessageQueue/CallbackInvoker.php
Outdated
Show resolved
Hide resolved
Hi @Neos2007 |
…eep" value during executing Magento\Framework\MessageQueue\CallbackInvoker::invoke() method.
Hi @Neos2007, thank you for your contribution! |
Extended message queue consumer configuration with parameters "maxIdleTime", "sleep" and "onlySpawnWhenMessageAvailable". Created logic for checking/handling these parameters during firing/executing queue consumers. Updated unit tests.
Description (*)
Current pull request extends existed message queue consumers logic and adds support of new consumers configuration parameters: "maxIdleTime", "sleep" and "onlySpawnWhenMessageAvailable".
PR was created based on "Improvements to message queue consumer processes" (Problem 1: not enough options to keep consumers under control).
Description new consumers parameters:
"maxIdleTime" - Describes max time (in seconds) of waiting for a new message from the queue.
"sleep" - Time (in seconds) to sleep before checking if a new message is available in the queue.
"onlySpawnWhenMessageAvailable" - (boolean value) identifies that consumer should be spawned only if there are available message in the related queue.
Parameters "maxIdleTime" and "sleep" are currently used only in Magento\Framework\MessageQueue\CallbackInvoker class (so they will be handled only for Consumers which was fired with defined "maxNumberOfMessages" parameter)
Parameter "onlySpawnWhenMessageAvailable" currently checks/validates via ConsumersRunner cron (\Magento\MessageQueue\Model\Cron\ConsumersRunner).
All new parameters for consumers could be configured either via queue_consumer.xml configuration files (as attributes for the consumer node) or via env.php file:
Manual testing scenarios (*)
For testing could be extended existed consumers configuration (via queue_consumer.xml or via env.php file).
Testing 'onlySpawnWhenMessageAvailable' parameter.
You can test consumers behavior with and without 'onlySpawnWhenMessageAvailable' parameter debugging process running consumers via cron (debug \Magento\MessageQueue\Model\Cron\ConsumersRunner::run() method execution).
Testing "maxIdleTime" and "sleep" methods are could be done via the debugging processing consumer process.
Questions or comments
Contribution checklist (*)