ExamGecko
Question list
Search
Search

List of questions

Search

Related questions











Question 47 - AD0-E716 discussion

Report
Export

A message queue currently has queue/consumer-wait-for-messages set to true, which allows the consumer process to run until a message is inserted into the queue. A piece of functionality is driven by data stored in the model

\Magento\variable\Model\variable and this value is only loaded once during the consumer run. If the variable is updated we want the consumer to restart so that the new value is loaded into memory without having to reload the variable on each message consumed.

The Adobe Commerce developer has created an after plugin on the \Magento\Variable\Model\variable:: save() function.

How would the developer use the plugin to trigger the consumer restart?

A.
Call the function \Magento\Framework\MessageQueue\PoisonPill\Poi5onPillPutInterface::put().
Answers
A.
Call the function \Magento\Framework\MessageQueue\PoisonPill\Poi5onPillPutInterface::put().
B.
Call the function \Magento\Framework\MessageQueue\Consumers\TriggerRe5tartInterface:trigger().
Answers
B.
Call the function \Magento\Framework\MessageQueue\Consumers\TriggerRe5tartInterface:trigger().
C.
Set the global Cache key trigger_consumer_restart t0 1.
Answers
C.
Set the global Cache key trigger_consumer_restart t0 1.
Suggested answer: B

Explanation:

The developer can use the plugin to trigger the consumer restart by calling the function \Magento\Framework\MessageQueue\Consumers\TriggerRe5tartInterface:trigger(). This function will write a flag to the cache storage that will be checked by the consumer process.If the flag is set, the consumer process will terminate itself and restart with the updated configuration. Verified

Reference: [Magento 2.4 DevDocs]1

asked 02/10/2024
Chris OMalley
26 questions
User
Your answer:
0 comments
Sorted by

Leave a comment first