Timeline for Does Magento 2 launch all RabbitMQ consumers only by cron?
Current License: CC BY-SA 4.0
15 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
May 14, 2023 at 21:51 | comment | added | Dmitriy Morozov | I admit that I do not understand the whole mechanism of work in detail. But at the moment, RabbitMQ queues look like an additional overhead to me. By running cron, I can perform some tasks here and now. But using RabbitMQ queues (in the case when they are run by cron) I only put tasks in RabbitMQ instead of executing them on the spot. | |
May 14, 2023 at 21:45 | comment | added | Dmitriy Morozov | I have questions about this statement of yours. ===The consumers then make API calls to Magento 2 to execute the tasks.=== As far as I understand, consumers are completely Magento code. Not only that, but the call to this code is even initiated by PHP-Magento code. To be honest, it's hard for me to understand what exactly you mean. | |
May 14, 2023 at 21:41 | comment | added | Dmitriy Morozov | This is your statement is not completely clear. ===In both cases, RabbitMQ functions as an intermediary message broker between the PHP/Magento code and the Magento API. === For some reason you separate PHP/Magento code and Magento API. I would like to know what exactly you mean. | |
May 14, 2023 at 21:39 | comment | added | Dmitriy Morozov | You said. ===Magento 2 sends tasks to RabbitMQ, which in turn manages the queue and passes the tasks to the designated consumers for processing. === This statement of yours may give the impression that consumers are not part of the Magento code, which in fact is not true, as I already know. | |
May 14, 2023 at 11:19 | comment | added | Dmitriy Morozov | you said ===In this case, the consumer runs as a separate process for a specified time, executing the queued messages and then stopping.=== 3) Does the launched consumer really work in a separate process? After all, PHP is single-threaded, with the exception of the tricks associated with the declare(ticks=1). ? | |
May 14, 2023 at 10:46 | comment | added | Dmitriy Morozov | And now, if I may, I would like to ask clarifying questions. You said: ===You can also configure the consumer to run as a daemon or within a process manager like Supervisor.=== 2) Do I understand correctly that I can use the SuperVisor to launch a conditionally infinite PHP script that will pull, let's say, a Magento CLI command (which will launch queue consumers for execution). I really want to get to the bottom of it. | |
May 14, 2023 at 10:12 | comment | added | Dmitriy Morozov | (I will try to explain what I mean. Perhaps I do not fully understand all the possibilities that the Magento-RabbitMQ bundle offers. This is not excluded. I will try to ask questions that interest me a little lower / later.) If the launch of consumers occurs by cron, then I would like to understand what is the point of redirecting the execution of tasks to RabbitMQ instead of launching them directly in place when calling cron. For me, for now, this looks like unnecessary delaying the execution of the task instead of immediately in the cron. | |
May 14, 2023 at 10:12 | comment | added | Dmitriy Morozov | I continue to work and deal with the RabbitMQ. And now I'm trying to get to the bottom of it. I want to understand whether RabbitMQ queues are really suitable for solving my problem. And in general, I want to understand the scope of tasks for which the use of queues is suitable. 1) And probably the most exciting question for me is - Look, at the moment, RabbitMK looks like an unnecessary layer to me. | |
Apr 26, 2023 at 10:53 | vote | accept | Dmitriy Morozov | ||
Apr 25, 2023 at 21:21 | comment | added | brentwpeterson | @DmitriyMorozov I added to the answer - please review | |
Apr 25, 2023 at 21:21 | history | edited | brentwpeterson | CC BY-SA 4.0 |
added 1260 characters in body
|
Apr 21, 2023 at 10:59 | comment | added | Dmitriy Morozov | Indeed, in order to process tasks using the specified PHP classes - RabbitMQ must have its own PHP interpreter - I think that this is not provided there and I hope that RabbitMQ calls the Magento API. Although everything looks as if all the initialization and the real launch of consumers occurs ONLY on the side of Magento. Could you please clarify this for me? | |
Apr 21, 2023 at 10:54 | comment | added | Dmitriy Morozov | Or is it really the Magento code (be it a CLI command called manually or a cron that triggers the CLI command) asks RabbitMQ for the tasks - having received which it executes them? | |
Apr 21, 2023 at 10:49 | comment | added | Dmitriy Morozov | I like your answer. Could you please clarify this for me. Because I can't understand. Does the consumer (process/thread initiated by RabbitMQ ) really call the Magento API? If it is so - that on what API there is a call? is knocking on /pub/index.php ? | |
Apr 19, 2023 at 20:58 | history | answered | brentwpeterson | CC BY-SA 4.0 |