Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
messages_in_progress.php
Go to the documentation of this file.
1 <?php
8 
10 $messageFactory = $objectManager->create(\Magento\MysqlMq\Model\MessageFactory::class);
12  ->load('topic_second.updated.use.just.in.tests', 'topic_name');
13 
15 
17 $queueFactory = $objectManager->create(\Magento\MysqlMq\Model\QueueFactory::class);
19  ->load('queue1', Magento\MysqlMq\Model\Queue::KEY_NAME)
20  ->getId();
22  ->load('queue2', Magento\MysqlMq\Model\Queue::KEY_NAME)
23  ->getId();
25  ->load('queue3', Magento\MysqlMq\Model\Queue::KEY_NAME)
26  ->getId();
28  ->load('queue4', Magento\MysqlMq\Model\Queue::KEY_NAME)
29  ->getId();
30 
31 $plan = [
32  [$messageId1, $queueId1, time() - 1 - 24 * 7 * 60 * 60,
35 ];
36 
38 $messageStatusFactory = $objectManager->create(\Magento\MysqlMq\Model\MessageStatusFactory::class);
39 foreach ($plan as $instruction) {
40  $messageStatus = $messageStatusFactory->create();
41 
42  $messageStatus->setQueueId($instruction[1])
43  ->setMessageId($instruction[0])
44  ->setUpdatedAt($instruction[2])
45  ->setStatus($instruction[3])
46  ->save();
47 }
$messageStatusFactory