Magento 2 Documentation
2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
|
Public Member Functions | |
__construct (\Magento\MysqlMq\Model\ResourceModel\Queue $messageResource, \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig, \Magento\MysqlMq\Model\ResourceModel\MessageStatusCollectionFactory $messageStatusCollectionFactory, \Magento\Framework\Stdlib\DateTime\DateTime $dateTime) | |
addMessageToQueues ($topic, $message, $queueNames) | |
addMessagesToQueues ($topic, $messages, $queueNames) | |
markMessagesForDelete () | |
readMessages ($queue, $maxMessagesNumber=null) | |
pushToQueueForRetry ($messageRelationId) | |
changeStatus ($messageRelationIds, $status) | |
Data Fields | |
const | MESSAGE_TOPIC = 'topic_name' |
const | MESSAGE_BODY = 'body' |
const | MESSAGE_ID = 'message_id' |
const | MESSAGE_STATUS = 'status' |
const | MESSAGE_UPDATED_AT = 'updated_at' |
const | MESSAGE_QUEUE_ID = 'queue_id' |
const | MESSAGE_QUEUE_NAME = 'queue_name' |
const | MESSAGE_QUEUE_RELATION_ID = 'relation_id' |
const | MESSAGE_NUMBER_OF_TRIALS = 'retries' |
const | MESSAGE_STATUS_NEW = 2 |
const | MESSAGE_STATUS_IN_PROGRESS = 3 |
const | MESSAGE_STATUS_COMPLETE = 4 |
const | MESSAGE_STATUS_RETRY_REQUIRED = 5 |
const | MESSAGE_STATUS_ERROR = 6 |
const | MESSAGE_STATUS_TO_BE_DELETED = 7 |
const | XML_PATH_SUCCESSFUL_MESSAGES_LIFETIME = 'system/mysqlmq/successful_messages_lifetime' |
const | XML_PATH_FAILED_MESSAGES_LIFETIME = 'system/mysqlmq/failed_messages_lifetime' |
const | XML_PATH_RETRY_IN_PROGRESS_AFTER = 'system/mysqlmq/retry_inprogress_after' |
const | XML_PATH_NEW_MESSAGES_LIFETIME = 'system/mysqlmq/new_messages_lifetime' |
Main class for managing MySQL implementation of message queue.
@api
Definition at line 14 of file QueueManagement.php.
__construct | ( | \Magento\MysqlMq\Model\ResourceModel\Queue | $messageResource, |
\Magento\Framework\App\Config\ScopeConfigInterface | $scopeConfig, | ||
\Magento\MysqlMq\Model\ResourceModel\MessageStatusCollectionFactory | $messageStatusCollectionFactory, | ||
\Magento\Framework\Stdlib\DateTime\DateTime | $dateTime | ||
) |
\Magento\MysqlMq\Model\ResourceModel\Queue | $messageResource | |
\Magento\Framework\App\Config\ScopeConfigInterface | $scopeConfig | |
\Magento\MysqlMq\Model\ResourceModel\MessageStatusCollectionFactory | $messageStatusCollectionFactory | |
\Magento\Framework\Stdlib\DateTime\DateTime | $dateTime |
Definition at line 66 of file QueueManagement.php.
addMessagesToQueues | ( | $topic, | |
$messages, | |||
$queueNames | |||
) |
Add messages to all specified queues.
string | $topic | |
array | $messages | |
string[] | $queueNames |
Definition at line 102 of file QueueManagement.php.
addMessageToQueues | ( | $topic, | |
$message, | |||
$queueNames | |||
) |
Add message to all specified queues.
string | $topic | |
string | $message | |
string[] | $queueNames |
Definition at line 86 of file QueueManagement.php.
changeStatus | ( | $messageRelationIds, | |
$status | |||
) |
Change status of messages.
int[] | $messageRelationIds | |
int | $status |
Definition at line 314 of file QueueManagement.php.
markMessagesForDelete | ( | ) |
Mark messages to be deleted if sufficient amount of time passed since last update Delete marked messages
Update messages if lifetime is expired
Delete all messages which has To BE DELETED status in all the queues
Definition at line 115 of file QueueManagement.php.
pushToQueueForRetry | ( | $messageRelationId | ) |
Push message back to queue for one more processing trial. Affects message in particular queue only.
int | $messageRelationId |
Definition at line 302 of file QueueManagement.php.
readMessages | ( | $queue, | |
$maxMessagesNumber = null |
|||
) |
Read the specified number of messages from the specified queue.
If queue does not contain enough messages, method is not waiting for more messages.
string | $queue | |
int | null | $maxMessagesNumber |
[ [ self::MESSAGE_ID => $messageId, self::MESSAGE_QUEUE_ID => $queuId, self::MESSAGE_TOPIC => $topic, self::MESSAGE_BODY => $body, self::MESSAGE_STATUS => $status, self::MESSAGE_UPDATED_AT => $updatedAt, self::MESSAGE_QUEUE_NAME => $queueName self::MESSAGE_QUEUE_RELATION_ID => $relationId ], ... ]
Definition at line 277 of file QueueManagement.php.
const MESSAGE_BODY = 'body' |
Definition at line 17 of file QueueManagement.php.
const MESSAGE_ID = 'message_id' |
Definition at line 18 of file QueueManagement.php.
const MESSAGE_NUMBER_OF_TRIALS = 'retries' |
Definition at line 24 of file QueueManagement.php.
const MESSAGE_QUEUE_ID = 'queue_id' |
Definition at line 21 of file QueueManagement.php.
const MESSAGE_QUEUE_NAME = 'queue_name' |
Definition at line 22 of file QueueManagement.php.
const MESSAGE_QUEUE_RELATION_ID = 'relation_id' |
Definition at line 23 of file QueueManagement.php.
const MESSAGE_STATUS = 'status' |
Definition at line 19 of file QueueManagement.php.
const MESSAGE_STATUS_COMPLETE = 4 |
Definition at line 28 of file QueueManagement.php.
const MESSAGE_STATUS_ERROR = 6 |
Definition at line 30 of file QueueManagement.php.
const MESSAGE_STATUS_IN_PROGRESS = 3 |
Definition at line 27 of file QueueManagement.php.
const MESSAGE_STATUS_NEW = 2 |
Definition at line 26 of file QueueManagement.php.
const MESSAGE_STATUS_RETRY_REQUIRED = 5 |
Definition at line 29 of file QueueManagement.php.
const MESSAGE_STATUS_TO_BE_DELETED = 7 |
Definition at line 31 of file QueueManagement.php.
const MESSAGE_TOPIC = 'topic_name' |
Definition at line 16 of file QueueManagement.php.
const MESSAGE_UPDATED_AT = 'updated_at' |
Definition at line 20 of file QueueManagement.php.
const XML_PATH_FAILED_MESSAGES_LIFETIME = 'system/mysqlmq/failed_messages_lifetime' |
Definition at line 37 of file QueueManagement.php.
const XML_PATH_NEW_MESSAGES_LIFETIME = 'system/mysqlmq/new_messages_lifetime' |
Definition at line 39 of file QueueManagement.php.
const XML_PATH_RETRY_IN_PROGRESS_AFTER = 'system/mysqlmq/retry_inprogress_after' |
Definition at line 38 of file QueueManagement.php.
const XML_PATH_SUCCESSFUL_MESSAGES_LIFETIME = 'system/mysqlmq/successful_messages_lifetime' |
#+ Cleanup configuration XML nodes
Definition at line 36 of file QueueManagement.php.