SlideShare a Scribd company logo
© 2019 Magento, Inc. Page | 1
Magento 2.3
Using MySQL For Queues
© 2019 Magento, Inc.
.
Page | 2
Senior Software Developer at BORN Group
Renu Mishra
© 2019 Magento, Inc. Page | 3
Agenda
© 2019 Magento, Inc. Page | 4
Agenda
 Need Of Queue
 Introduction to Queues
 Creating Queues with MySQL
 Publishing messages to Queue
 Consuming the published message
© 2019 Magento, Inc. Page | 5
Not In Scope
© 2019 Magento, Inc. Page | 6
Not In Scope
 Parallel Consumer processing.
 Batch Processing.
 AMQP Implementation (RabbitMQ).
 Advanced Error handling (Rejecting and Re-queuing).
 Supervisiord for consumer monitoring.
© 2019 Magento, Inc. Page | 7
What is Queue and it’s
uses ?
© 2019 Magento, Inc. Page | 8
What is Queue and it’s uses ?
 It distribute load across the application allowing work to placed in a
queue and process independently.
 Received and processes the message asynchronously.
 It also includes a mechanism for storing undelivered messages.
 Queue works in background. It has no frontend user interaction.
© 2019 Magento, Inc. Page | 9
Introduction Of Queue
© 2019 Magento, Inc. Page | 10
Queue Processing Diagram
Routes
© 2019 Magento, Inc. Page | 11
Queue Processing Description
 A publisher is configured to send messages to a topic.
• A topic is a way to categorize messages to consumers.
• A consumer is configured to listen for messages with specific topics.
• Queues route topics to consumers.
• Consumers accept messages and perform actions on them.
© 2019 Magento, Inc. Page | 12
Enough Talk Let’s Get
Started!
© 2019 Magento, Inc. Page | 13
Registering The Module
© 2019 Magento, Inc. Page | 14
<module_root>/registration.php
© 2019 Magento, Inc. Page | 15
<module_root>/etc/module.xml
© 2019 Magento, Inc. Page | 16
Let’s Creates the Queue Files
Now
© 2019 Magento, Inc. Page | 17
Declaring The Publisher
© 2019 Magento, Inc. Page | 18
Send the message to broker
© 2019 Magento, Inc. Page | 19
<module_root>/etc/publisher.xml
© 2019 Magento, Inc. Page | 20
<module_root>/etc/publisher.xml
- publisher element
- topic : The name of the topic.Wildcards character are not supported.
- connection element
- name : For AMQP connections, the connection name must match the
connection attribute in the queue_topology.xml file. Otherwise,
the connection name must be db.
- exchange : The name of the exchange to publish to. The default
system exchange name is magento.
© 2019 Magento, Inc. Page | 21
<module_root>/etc/communication.xml
© 2019 Magento, Inc. Page | 22
<module_root>/etc/communication.xml
- topic element
- name : A string that uniquely identifies the topic.Wildcards character
are not supported in the communication.xml file(*,%,[] and so on).
- request : Specifies the data type of the topic.
- handler element
- name : A string that uniquely defines the handler.
- type : The class that defines the handler.
- method : The method this handler executes.
© 2019 Magento, Inc. Page | 23
Declare The Broker
© 2019 Magento, Inc. Page | 24
Receive the Data From
Producer/Publisher
© 2019 Magento, Inc. Page | 25
<module_root>/etc/queue.xml
© 2019 Magento, Inc. Page | 26
<module_root>/etc/queue.xml
- broker element
- topic : A topic defined in the communication.xml file.
- exchange : The name of the exchange to publish to. The default
system exchange name is magento
- type : The type of message broker. For this release, the value
must be amqp or db.
© 2019 Magento, Inc. Page | 27
<module_root>/etc/queue.xml
- queue element
- name : Defines the queue name to send the message to.
- consumer : The name of the consumer.
- consumerInstance : The path to a Magento class that consumes the
message.
- handler : Specifies the class and method that processes the
message. The value must be specified in the format
<Vendor>Module<ServiceName>::<methodName>.
© 2019 Magento, Inc. Page | 28
Declaring The Topology
© 2019 Magento, Inc. Page | 29
Queue route topics to consumers
© 2019 Magento, Inc. Page | 30
<module_root>/etc/queue_topology.xml
© 2019 Magento, Inc. Page | 31
<module_root>/etc/queue_topology.xml
- exchange element
- name : A unique ID for the exchange.
- type : Specifies the type of exchange. Must be topic.
- connection : For AMQP connections, a string that identifies the
connection. For MySQL connections, the connection
name must be db.
© 2019 Magento, Inc. Page | 32
<module_root>/etc/queue_topology.xml
- binding element
- id : A unique ID for this binding.
- topic : The name of a topic.
- destinationType : Must be queue.
- destination : Identifies the name of a queue.
© 2019 Magento, Inc. Page | 33
Declaring The Consumer
© 2019 Magento, Inc. Page | 34
Consume the publish message
Routes
© 2019 Magento, Inc. Page | 35
<module_root>/etc/queue_consumer.xml
© 2019 Magento, Inc. Page | 36
<module_root>/etc/queue_consumer.xml
- consumer element
- name : The name of the consumer.
- queue : Defines the queue name to send the message to.
- handler : Specifies the class and method that processes the message.
The value must be specified in the format
<Vendor>Module<ServiceName>::<methodName>.
- consumerInstance : The Magento class name that consumes the
message
- connection : For AMQP connections, the connection name must match
the connection attribute in the queue_topology.xml file.
Otherwise, the connection name must be db.
© 2019 Magento, Inc. Page | 37
So many files right ?
© 2019 Magento, Inc. Page | 38
Enough XMLs now its PHP
time !!
© 2019 Magento, Inc. Page | 39
Request Class Declaration
© 2019 Magento, Inc. Page | 40
Requested Class in Communication.xml
© 2019 Magento, Inc. Page | 41
Requested Class Interface
© 2019 Magento, Inc. Page | 42
Concrete Class
Declaration
© 2019 Magento, Inc. Page | 43
Concrete Class declare in etc/di.xml
© 2019 Magento, Inc. Page | 44
Concrete Class Implementation
© 2019 Magento, Inc. Page | 45
Publishing The Message
© 2019 Magento, Inc. Page | 46
Publish The Message in Controller
© 2019 Magento, Inc. Page | 47
MagentoFrameworkMessageQueuePu
blisherInterface
© 2019 Magento, Inc. Page | 48
Publish The Message in Controller
© 2019 Magento, Inc. Page | 49
Consume The Message
© 2019 Magento, Inc. Page | 50
Consume The Message
© 2019 Magento, Inc. Page | 51
Finally Code
Implementation Done !!!
© 2019 Magento, Inc. Page | 52
Execute The Queue
© 2019 Magento, Inc. Page | 53
Wait we need to run the
command before
executing the Queue
© 2019 Magento, Inc. Page | 54
Upgrade Command
Install the Queue Module
© 2019 Magento, Inc. Page | 55
What is happening in
background when
command executed ?
© 2019 Magento, Inc. Page | 56
Queue Table
© 2019 Magento, Inc. Page | 57
Now Let’s Publish the
Queue using Controller
© 2019 Magento, Inc. Page | 58
[base_url]/queue1/index/index
© 2019 Magento, Inc. Page | 59
What happen in
background when queue
published?
© 2019 Magento, Inc. Page | 60
queue_message Table
© 2019 Magento, Inc. Page | 61
It’s time to consume the
published message
© 2019 Magento, Inc. Page | 62
View a list of available
message queue
consumers
© 2019 Magento, Inc. Page | 63
View a list of available message queue
consumers
© 2019 Magento, Inc. Page | 64
Command that consume
the message
© 2019 Magento, Inc. Page | 65
Consume the message
© 2019 Magento, Inc. Page | 66
What happen when
consumer start processing
?
© 2019 Magento, Inc. Page | 67
queue_message_status table
© 2019 Magento, Inc. Page | 68
queue_message_status table
© 2019 Magento, Inc. Page | 69
status column in queue_message_status
table
© 2019 Magento, Inc. Page | 70
Queue Execution On
Production
© 2019 Magento, Inc. Page | 71
MySQL Message Queue Setting
Stores > Settings > Configuration > Advanced > System > Cron
© 2019 Magento, Inc. Page | 72
Configure cron job consumer_runner in
app/etc/env.php
© 2019 Magento, Inc. Page | 73
 cron_run - the option for enabling/disabling cron job consumers_runner, by
default is true.
 max_messages - the maximum number of messages for each consumer
that must be processed before consumer terminate, by default is 1000. If it
is 0, then the consumer never stops working.
 consumers - the list of consumers which will be run, by default is empty
array (all consumers are allowed to be run).
consumer_runner parameter Details
© 2019 Magento, Inc. Page | 74
Start message queue consumers
© 2019 Magento, Inc. Page | 75
Start message queue consumers
© 2019 Magento, Inc. Page | 76
Now you know pretty
well about Queue
© 2019 Magento, Inc. Page | 77
Questions ?
© 2019 Magento, Inc. Page | 78
Thank You

More Related Content

What's hot

Modeling Big Data with the ArchiMate 3.0 Language
Modeling Big Data with the ArchiMate 3.0 LanguageModeling Big Data with the ArchiMate 3.0 Language
Modeling Big Data with the ArchiMate 3.0 Language
Iver Band
 
Azure Migrate
Azure MigrateAzure Migrate
Azure Migrate
Mustafa
 
Managed Services - Functional & Customization Support Help Desk
Managed Services - Functional & Customization Support Help DeskManaged Services - Functional & Customization Support Help Desk
Managed Services - Functional & Customization Support Help Desk
Amit Panchal
 
Working with MS Endpoint Manager
Working with MS Endpoint ManagerWorking with MS Endpoint Manager
Working with MS Endpoint Manager
George Grammatikos
 
Oracle Enterprise Manager
Oracle Enterprise ManagerOracle Enterprise Manager
Oracle Enterprise Manager
Bob Rhubart
 
ITIL ServiceNow offerings
ITIL ServiceNow offeringsITIL ServiceNow offerings
ITIL ServiceNow offerings
Vijayananda Mohire
 
Introduction to Azure IaaS
Introduction to Azure IaaSIntroduction to Azure IaaS
Introduction to Azure IaaS
Robert Crane
 
Ingesting and Processing IoT Data - using MQTT, Kafka Connect and KSQL
Ingesting and Processing IoT Data - using MQTT, Kafka Connect and KSQLIngesting and Processing IoT Data - using MQTT, Kafka Connect and KSQL
Ingesting and Processing IoT Data - using MQTT, Kafka Connect and KSQL
Guido Schmutz
 
Axis2 client memory leak
Axis2 client memory leakAxis2 client memory leak
Axis2 client memory leak
feng lee
 
AWS Amazon Quantum Ledger Database (QLDB)
AWS Amazon Quantum Ledger Database (QLDB)AWS Amazon Quantum Ledger Database (QLDB)
AWS Amazon Quantum Ledger Database (QLDB)
Subramanyam Vemala
 
Scaling Up to Your First 10 Million Users (ARC205-R1) - AWS re:Invent 2018
Scaling Up to Your First 10 Million Users (ARC205-R1) - AWS re:Invent 2018Scaling Up to Your First 10 Million Users (ARC205-R1) - AWS re:Invent 2018
Scaling Up to Your First 10 Million Users (ARC205-R1) - AWS re:Invent 2018
Amazon Web Services
 
Office 365 Mail migration strategies
Office 365 Mail migration strategiesOffice 365 Mail migration strategies
Office 365 Mail migration strategies
Fulvio Salanitro
 
Application support requirements & processes
Application support requirements & processesApplication support requirements & processes
Application support requirements & processes
Nandeep Nagarkar
 
Microsoft 365 eEnterprise E5 Overview
Microsoft 365 eEnterprise E5 OverviewMicrosoft 365 eEnterprise E5 Overview
Microsoft 365 eEnterprise E5 Overview
David J Rosenthal
 
SharePoint goes Microsoft Graph
SharePoint goes Microsoft GraphSharePoint goes Microsoft Graph
SharePoint goes Microsoft Graph
Markus Moeller
 
Cloud architecture with the ArchiMate Language
Cloud architecture with the ArchiMate LanguageCloud architecture with the ArchiMate Language
Cloud architecture with the ArchiMate Language
Iver Band
 
Azure Monitoring Overview
Azure Monitoring OverviewAzure Monitoring Overview
Azure Monitoring Overview
gjuljo
 
Cloud Migration Workshop
Cloud Migration WorkshopCloud Migration Workshop
Cloud Migration Workshop
Amazon Web Services
 
ITSM Presentation
ITSM PresentationITSM Presentation
ITSM Presentation
itsm_at_hanover
 
Whole-of-enterprise architecture
Whole-of-enterprise architectureWhole-of-enterprise architecture
Whole-of-enterprise architecture
Tetradian Consulting
 

What's hot (20)

Modeling Big Data with the ArchiMate 3.0 Language
Modeling Big Data with the ArchiMate 3.0 LanguageModeling Big Data with the ArchiMate 3.0 Language
Modeling Big Data with the ArchiMate 3.0 Language
 
Azure Migrate
Azure MigrateAzure Migrate
Azure Migrate
 
Managed Services - Functional & Customization Support Help Desk
Managed Services - Functional & Customization Support Help DeskManaged Services - Functional & Customization Support Help Desk
Managed Services - Functional & Customization Support Help Desk
 
Working with MS Endpoint Manager
Working with MS Endpoint ManagerWorking with MS Endpoint Manager
Working with MS Endpoint Manager
 
Oracle Enterprise Manager
Oracle Enterprise ManagerOracle Enterprise Manager
Oracle Enterprise Manager
 
ITIL ServiceNow offerings
ITIL ServiceNow offeringsITIL ServiceNow offerings
ITIL ServiceNow offerings
 
Introduction to Azure IaaS
Introduction to Azure IaaSIntroduction to Azure IaaS
Introduction to Azure IaaS
 
Ingesting and Processing IoT Data - using MQTT, Kafka Connect and KSQL
Ingesting and Processing IoT Data - using MQTT, Kafka Connect and KSQLIngesting and Processing IoT Data - using MQTT, Kafka Connect and KSQL
Ingesting and Processing IoT Data - using MQTT, Kafka Connect and KSQL
 
Axis2 client memory leak
Axis2 client memory leakAxis2 client memory leak
Axis2 client memory leak
 
AWS Amazon Quantum Ledger Database (QLDB)
AWS Amazon Quantum Ledger Database (QLDB)AWS Amazon Quantum Ledger Database (QLDB)
AWS Amazon Quantum Ledger Database (QLDB)
 
Scaling Up to Your First 10 Million Users (ARC205-R1) - AWS re:Invent 2018
Scaling Up to Your First 10 Million Users (ARC205-R1) - AWS re:Invent 2018Scaling Up to Your First 10 Million Users (ARC205-R1) - AWS re:Invent 2018
Scaling Up to Your First 10 Million Users (ARC205-R1) - AWS re:Invent 2018
 
Office 365 Mail migration strategies
Office 365 Mail migration strategiesOffice 365 Mail migration strategies
Office 365 Mail migration strategies
 
Application support requirements & processes
Application support requirements & processesApplication support requirements & processes
Application support requirements & processes
 
Microsoft 365 eEnterprise E5 Overview
Microsoft 365 eEnterprise E5 OverviewMicrosoft 365 eEnterprise E5 Overview
Microsoft 365 eEnterprise E5 Overview
 
SharePoint goes Microsoft Graph
SharePoint goes Microsoft GraphSharePoint goes Microsoft Graph
SharePoint goes Microsoft Graph
 
Cloud architecture with the ArchiMate Language
Cloud architecture with the ArchiMate LanguageCloud architecture with the ArchiMate Language
Cloud architecture with the ArchiMate Language
 
Azure Monitoring Overview
Azure Monitoring OverviewAzure Monitoring Overview
Azure Monitoring Overview
 
Cloud Migration Workshop
Cloud Migration WorkshopCloud Migration Workshop
Cloud Migration Workshop
 
ITSM Presentation
ITSM PresentationITSM Presentation
ITSM Presentation
 
Whole-of-enterprise architecture
Whole-of-enterprise architectureWhole-of-enterprise architecture
Whole-of-enterprise architecture
 

Similar to Using Magento 2.3 MySQL Queues

The long way from Monolith to Microservices
The long way from Monolith to MicroservicesThe long way from Monolith to Microservices
The long way from Monolith to Microservices
Igor Miniailo
 
A long way from Monolith to Service Isolated Architecture #MM19NL
A long way from Monolith to Service Isolated Architecture #MM19NLA long way from Monolith to Service Isolated Architecture #MM19NL
A long way from Monolith to Service Isolated Architecture #MM19NL
Igor Miniailo
 
Backward Compatibility Developer's Guide in Magento 2
Backward Compatibility Developer's Guide in Magento 2Backward Compatibility Developer's Guide in Magento 2
Backward Compatibility Developer's Guide in Magento 2
Igor Miniailo
 
Magento 2.3 Schema and Data Patches
Magento 2.3 Schema and Data PatchesMagento 2.3 Schema and Data Patches
Magento 2.3 Schema and Data Patches
atishgoswami
 
Backwards Compatibility Developers Guide. #MM17NL
Backwards Compatibility Developers Guide. #MM17NLBackwards Compatibility Developers Guide. #MM17NL
Backwards Compatibility Developers Guide. #MM17NL
Igor Miniailo
 
Backward Compatibility Developer's Guide Webinar
Backward Compatibility Developer's Guide WebinarBackward Compatibility Developer's Guide Webinar
Backward Compatibility Developer's Guide Webinar
Igor Miniailo
 
Eugene Shakhsuvarov - Improving enterprise store scalability using AMQP and A...
Eugene Shakhsuvarov - Improving enterprise store scalability using AMQP and A...Eugene Shakhsuvarov - Improving enterprise store scalability using AMQP and A...
Eugene Shakhsuvarov - Improving enterprise store scalability using AMQP and A...
Meet Magento Italy
 
IRJET- Development of Android Application for Device to Device Communication ...
IRJET- Development of Android Application for Device to Device Communication ...IRJET- Development of Android Application for Device to Device Communication ...
IRJET- Development of Android Application for Device to Device Communication ...
IRJET Journal
 
API design best practices
API design best practicesAPI design best practices
API design best practices
Igor Miniailo
 
Eugene Shaksuvarov - Tuning Magento 2 for Maximum Performance
Eugene Shaksuvarov - Tuning Magento 2 for Maximum PerformanceEugene Shaksuvarov - Tuning Magento 2 for Maximum Performance
Eugene Shaksuvarov - Tuning Magento 2 for Maximum Performance
Meet Magento Italy
 
Magento2.3 - GraphQL introduction
Magento2.3  - GraphQL introductionMagento2.3  - GraphQL introduction
Magento2.3 - GraphQL introduction
Vishakha Borkar
 
01. lab instructions starting project
01. lab instructions   starting project01. lab instructions   starting project
01. lab instructions starting project
rajul14
 
Igor Miniailo - Magento 2 API Design Best Practices
Igor Miniailo - Magento 2 API Design Best PracticesIgor Miniailo - Magento 2 API Design Best Practices
Igor Miniailo - Magento 2 API Design Best Practices
Atwix
 
Backward Compatibility Developer's Guide in Magento 2. #MM17CZ
Backward Compatibility Developer's Guide in Magento 2. #MM17CZBackward Compatibility Developer's Guide in Magento 2. #MM17CZ
Backward Compatibility Developer's Guide in Magento 2. #MM17CZ
Igor Miniailo
 
API Design Best Practices by Igor Miniailo
API Design Best Practices by Igor MiniailoAPI Design Best Practices by Igor Miniailo
API Design Best Practices by Igor Miniailo
Magecom UK Limited
 
2019 03-13-implementing microservices by ddd
2019 03-13-implementing microservices by ddd2019 03-13-implementing microservices by ddd
2019 03-13-implementing microservices by ddd
Kim Kao
 
Implementing Microservices by DDD
Implementing Microservices by DDDImplementing Microservices by DDD
Implementing Microservices by DDD
Amazon Web Services
 
Magento Function Testing Framework - Intro and Overview
Magento Function Testing Framework - Intro and OverviewMagento Function Testing Framework - Intro and Overview
Magento Function Testing Framework - Intro and Overview
Tom Erskine
 
IRJET- Custom CMS using Smarty Template Engine for Mobile Portal
IRJET- Custom CMS using Smarty Template Engine for Mobile PortalIRJET- Custom CMS using Smarty Template Engine for Mobile Portal
IRJET- Custom CMS using Smarty Template Engine for Mobile Portal
IRJET Journal
 
IBM Think 2018: IBM MQ High Availability
IBM Think 2018: IBM MQ High AvailabilityIBM Think 2018: IBM MQ High Availability
IBM Think 2018: IBM MQ High Availability
Jamie Squibb
 

Similar to Using Magento 2.3 MySQL Queues (20)

The long way from Monolith to Microservices
The long way from Monolith to MicroservicesThe long way from Monolith to Microservices
The long way from Monolith to Microservices
 
A long way from Monolith to Service Isolated Architecture #MM19NL
A long way from Monolith to Service Isolated Architecture #MM19NLA long way from Monolith to Service Isolated Architecture #MM19NL
A long way from Monolith to Service Isolated Architecture #MM19NL
 
Backward Compatibility Developer's Guide in Magento 2
Backward Compatibility Developer's Guide in Magento 2Backward Compatibility Developer's Guide in Magento 2
Backward Compatibility Developer's Guide in Magento 2
 
Magento 2.3 Schema and Data Patches
Magento 2.3 Schema and Data PatchesMagento 2.3 Schema and Data Patches
Magento 2.3 Schema and Data Patches
 
Backwards Compatibility Developers Guide. #MM17NL
Backwards Compatibility Developers Guide. #MM17NLBackwards Compatibility Developers Guide. #MM17NL
Backwards Compatibility Developers Guide. #MM17NL
 
Backward Compatibility Developer's Guide Webinar
Backward Compatibility Developer's Guide WebinarBackward Compatibility Developer's Guide Webinar
Backward Compatibility Developer's Guide Webinar
 
Eugene Shakhsuvarov - Improving enterprise store scalability using AMQP and A...
Eugene Shakhsuvarov - Improving enterprise store scalability using AMQP and A...Eugene Shakhsuvarov - Improving enterprise store scalability using AMQP and A...
Eugene Shakhsuvarov - Improving enterprise store scalability using AMQP and A...
 
IRJET- Development of Android Application for Device to Device Communication ...
IRJET- Development of Android Application for Device to Device Communication ...IRJET- Development of Android Application for Device to Device Communication ...
IRJET- Development of Android Application for Device to Device Communication ...
 
API design best practices
API design best practicesAPI design best practices
API design best practices
 
Eugene Shaksuvarov - Tuning Magento 2 for Maximum Performance
Eugene Shaksuvarov - Tuning Magento 2 for Maximum PerformanceEugene Shaksuvarov - Tuning Magento 2 for Maximum Performance
Eugene Shaksuvarov - Tuning Magento 2 for Maximum Performance
 
Magento2.3 - GraphQL introduction
Magento2.3  - GraphQL introductionMagento2.3  - GraphQL introduction
Magento2.3 - GraphQL introduction
 
01. lab instructions starting project
01. lab instructions   starting project01. lab instructions   starting project
01. lab instructions starting project
 
Igor Miniailo - Magento 2 API Design Best Practices
Igor Miniailo - Magento 2 API Design Best PracticesIgor Miniailo - Magento 2 API Design Best Practices
Igor Miniailo - Magento 2 API Design Best Practices
 
Backward Compatibility Developer's Guide in Magento 2. #MM17CZ
Backward Compatibility Developer's Guide in Magento 2. #MM17CZBackward Compatibility Developer's Guide in Magento 2. #MM17CZ
Backward Compatibility Developer's Guide in Magento 2. #MM17CZ
 
API Design Best Practices by Igor Miniailo
API Design Best Practices by Igor MiniailoAPI Design Best Practices by Igor Miniailo
API Design Best Practices by Igor Miniailo
 
2019 03-13-implementing microservices by ddd
2019 03-13-implementing microservices by ddd2019 03-13-implementing microservices by ddd
2019 03-13-implementing microservices by ddd
 
Implementing Microservices by DDD
Implementing Microservices by DDDImplementing Microservices by DDD
Implementing Microservices by DDD
 
Magento Function Testing Framework - Intro and Overview
Magento Function Testing Framework - Intro and OverviewMagento Function Testing Framework - Intro and Overview
Magento Function Testing Framework - Intro and Overview
 
IRJET- Custom CMS using Smarty Template Engine for Mobile Portal
IRJET- Custom CMS using Smarty Template Engine for Mobile PortalIRJET- Custom CMS using Smarty Template Engine for Mobile Portal
IRJET- Custom CMS using Smarty Template Engine for Mobile Portal
 
IBM Think 2018: IBM MQ High Availability
IBM Think 2018: IBM MQ High AvailabilityIBM Think 2018: IBM MQ High Availability
IBM Think 2018: IBM MQ High Availability
 

Recently uploaded

zkStudyClub - LatticeFold: A Lattice-based Folding Scheme and its Application...
zkStudyClub - LatticeFold: A Lattice-based Folding Scheme and its Application...zkStudyClub - LatticeFold: A Lattice-based Folding Scheme and its Application...
zkStudyClub - LatticeFold: A Lattice-based Folding Scheme and its Application...
Alex Pruden
 
Your One-Stop Shop for Python Success: Top 10 US Python Development Providers
Your One-Stop Shop for Python Success: Top 10 US Python Development ProvidersYour One-Stop Shop for Python Success: Top 10 US Python Development Providers
Your One-Stop Shop for Python Success: Top 10 US Python Development Providers
akankshawande
 
GNSS spoofing via SDR (Criptored Talks 2024)
GNSS spoofing via SDR (Criptored Talks 2024)GNSS spoofing via SDR (Criptored Talks 2024)
GNSS spoofing via SDR (Criptored Talks 2024)
Javier Junquera
 
AppSec PNW: Android and iOS Application Security with MobSF
AppSec PNW: Android and iOS Application Security with MobSFAppSec PNW: Android and iOS Application Security with MobSF
AppSec PNW: Android and iOS Application Security with MobSF
Ajin Abraham
 
“Temporal Event Neural Networks: A More Efficient Alternative to the Transfor...
“Temporal Event Neural Networks: A More Efficient Alternative to the Transfor...“Temporal Event Neural Networks: A More Efficient Alternative to the Transfor...
“Temporal Event Neural Networks: A More Efficient Alternative to the Transfor...
Edge AI and Vision Alliance
 
Freshworks Rethinks NoSQL for Rapid Scaling & Cost-Efficiency
Freshworks Rethinks NoSQL for Rapid Scaling & Cost-EfficiencyFreshworks Rethinks NoSQL for Rapid Scaling & Cost-Efficiency
Freshworks Rethinks NoSQL for Rapid Scaling & Cost-Efficiency
ScyllaDB
 
Choosing The Best AWS Service For Your Website + API.pptx
Choosing The Best AWS Service For Your Website + API.pptxChoosing The Best AWS Service For Your Website + API.pptx
Choosing The Best AWS Service For Your Website + API.pptx
Brandon Minnick, MBA
 
"Choosing proper type of scaling", Olena Syrota
"Choosing proper type of scaling", Olena Syrota"Choosing proper type of scaling", Olena Syrota
"Choosing proper type of scaling", Olena Syrota
Fwdays
 
Digital Banking in the Cloud: How Citizens Bank Unlocked Their Mainframe
Digital Banking in the Cloud: How Citizens Bank Unlocked Their MainframeDigital Banking in the Cloud: How Citizens Bank Unlocked Their Mainframe
Digital Banking in the Cloud: How Citizens Bank Unlocked Their Mainframe
Precisely
 
Connector Corner: Seamlessly power UiPath Apps, GenAI with prebuilt connectors
Connector Corner: Seamlessly power UiPath Apps, GenAI with prebuilt connectorsConnector Corner: Seamlessly power UiPath Apps, GenAI with prebuilt connectors
Connector Corner: Seamlessly power UiPath Apps, GenAI with prebuilt connectors
DianaGray10
 
Columbus Data & Analytics Wednesdays - June 2024
Columbus Data & Analytics Wednesdays - June 2024Columbus Data & Analytics Wednesdays - June 2024
Columbus Data & Analytics Wednesdays - June 2024
Jason Packer
 
Mutation Testing for Task-Oriented Chatbots
Mutation Testing for Task-Oriented ChatbotsMutation Testing for Task-Oriented Chatbots
Mutation Testing for Task-Oriented Chatbots
Pablo Gómez Abajo
 
Principle of conventional tomography-Bibash Shahi ppt..pptx
Principle of conventional tomography-Bibash Shahi ppt..pptxPrinciple of conventional tomography-Bibash Shahi ppt..pptx
Principle of conventional tomography-Bibash Shahi ppt..pptx
BibashShahi
 
Energy Efficient Video Encoding for Cloud and Edge Computing Instances
Energy Efficient Video Encoding for Cloud and Edge Computing InstancesEnergy Efficient Video Encoding for Cloud and Edge Computing Instances
Energy Efficient Video Encoding for Cloud and Edge Computing Instances
Alpen-Adria-Universität
 
JavaLand 2024: Application Development Green Masterplan
JavaLand 2024: Application Development Green MasterplanJavaLand 2024: Application Development Green Masterplan
JavaLand 2024: Application Development Green Masterplan
Miro Wengner
 
Astute Business Solutions | Oracle Cloud Partner |
Astute Business Solutions | Oracle Cloud Partner |Astute Business Solutions | Oracle Cloud Partner |
Astute Business Solutions | Oracle Cloud Partner |
AstuteBusiness
 
Taking AI to the Next Level in Manufacturing.pdf
Taking AI to the Next Level in Manufacturing.pdfTaking AI to the Next Level in Manufacturing.pdf
Taking AI to the Next Level in Manufacturing.pdf
ssuserfac0301
 
9 CEO's who hit $100m ARR Share Their Top Growth Tactics Nathan Latka, Founde...
9 CEO's who hit $100m ARR Share Their Top Growth Tactics Nathan Latka, Founde...9 CEO's who hit $100m ARR Share Their Top Growth Tactics Nathan Latka, Founde...
9 CEO's who hit $100m ARR Share Their Top Growth Tactics Nathan Latka, Founde...
saastr
 
Overcoming the PLG Trap: Lessons from Canva's Head of Sales & Head of EMEA Da...
Overcoming the PLG Trap: Lessons from Canva's Head of Sales & Head of EMEA Da...Overcoming the PLG Trap: Lessons from Canva's Head of Sales & Head of EMEA Da...
Overcoming the PLG Trap: Lessons from Canva's Head of Sales & Head of EMEA Da...
saastr
 
What is an RPA CoE? Session 1 – CoE Vision
What is an RPA CoE?  Session 1 – CoE VisionWhat is an RPA CoE?  Session 1 – CoE Vision
What is an RPA CoE? Session 1 – CoE Vision
DianaGray10
 

Recently uploaded (20)

zkStudyClub - LatticeFold: A Lattice-based Folding Scheme and its Application...
zkStudyClub - LatticeFold: A Lattice-based Folding Scheme and its Application...zkStudyClub - LatticeFold: A Lattice-based Folding Scheme and its Application...
zkStudyClub - LatticeFold: A Lattice-based Folding Scheme and its Application...
 
Your One-Stop Shop for Python Success: Top 10 US Python Development Providers
Your One-Stop Shop for Python Success: Top 10 US Python Development ProvidersYour One-Stop Shop for Python Success: Top 10 US Python Development Providers
Your One-Stop Shop for Python Success: Top 10 US Python Development Providers
 
GNSS spoofing via SDR (Criptored Talks 2024)
GNSS spoofing via SDR (Criptored Talks 2024)GNSS spoofing via SDR (Criptored Talks 2024)
GNSS spoofing via SDR (Criptored Talks 2024)
 
AppSec PNW: Android and iOS Application Security with MobSF
AppSec PNW: Android and iOS Application Security with MobSFAppSec PNW: Android and iOS Application Security with MobSF
AppSec PNW: Android and iOS Application Security with MobSF
 
“Temporal Event Neural Networks: A More Efficient Alternative to the Transfor...
“Temporal Event Neural Networks: A More Efficient Alternative to the Transfor...“Temporal Event Neural Networks: A More Efficient Alternative to the Transfor...
“Temporal Event Neural Networks: A More Efficient Alternative to the Transfor...
 
Freshworks Rethinks NoSQL for Rapid Scaling & Cost-Efficiency
Freshworks Rethinks NoSQL for Rapid Scaling & Cost-EfficiencyFreshworks Rethinks NoSQL for Rapid Scaling & Cost-Efficiency
Freshworks Rethinks NoSQL for Rapid Scaling & Cost-Efficiency
 
Choosing The Best AWS Service For Your Website + API.pptx
Choosing The Best AWS Service For Your Website + API.pptxChoosing The Best AWS Service For Your Website + API.pptx
Choosing The Best AWS Service For Your Website + API.pptx
 
"Choosing proper type of scaling", Olena Syrota
"Choosing proper type of scaling", Olena Syrota"Choosing proper type of scaling", Olena Syrota
"Choosing proper type of scaling", Olena Syrota
 
Digital Banking in the Cloud: How Citizens Bank Unlocked Their Mainframe
Digital Banking in the Cloud: How Citizens Bank Unlocked Their MainframeDigital Banking in the Cloud: How Citizens Bank Unlocked Their Mainframe
Digital Banking in the Cloud: How Citizens Bank Unlocked Their Mainframe
 
Connector Corner: Seamlessly power UiPath Apps, GenAI with prebuilt connectors
Connector Corner: Seamlessly power UiPath Apps, GenAI with prebuilt connectorsConnector Corner: Seamlessly power UiPath Apps, GenAI with prebuilt connectors
Connector Corner: Seamlessly power UiPath Apps, GenAI with prebuilt connectors
 
Columbus Data & Analytics Wednesdays - June 2024
Columbus Data & Analytics Wednesdays - June 2024Columbus Data & Analytics Wednesdays - June 2024
Columbus Data & Analytics Wednesdays - June 2024
 
Mutation Testing for Task-Oriented Chatbots
Mutation Testing for Task-Oriented ChatbotsMutation Testing for Task-Oriented Chatbots
Mutation Testing for Task-Oriented Chatbots
 
Principle of conventional tomography-Bibash Shahi ppt..pptx
Principle of conventional tomography-Bibash Shahi ppt..pptxPrinciple of conventional tomography-Bibash Shahi ppt..pptx
Principle of conventional tomography-Bibash Shahi ppt..pptx
 
Energy Efficient Video Encoding for Cloud and Edge Computing Instances
Energy Efficient Video Encoding for Cloud and Edge Computing InstancesEnergy Efficient Video Encoding for Cloud and Edge Computing Instances
Energy Efficient Video Encoding for Cloud and Edge Computing Instances
 
JavaLand 2024: Application Development Green Masterplan
JavaLand 2024: Application Development Green MasterplanJavaLand 2024: Application Development Green Masterplan
JavaLand 2024: Application Development Green Masterplan
 
Astute Business Solutions | Oracle Cloud Partner |
Astute Business Solutions | Oracle Cloud Partner |Astute Business Solutions | Oracle Cloud Partner |
Astute Business Solutions | Oracle Cloud Partner |
 
Taking AI to the Next Level in Manufacturing.pdf
Taking AI to the Next Level in Manufacturing.pdfTaking AI to the Next Level in Manufacturing.pdf
Taking AI to the Next Level in Manufacturing.pdf
 
9 CEO's who hit $100m ARR Share Their Top Growth Tactics Nathan Latka, Founde...
9 CEO's who hit $100m ARR Share Their Top Growth Tactics Nathan Latka, Founde...9 CEO's who hit $100m ARR Share Their Top Growth Tactics Nathan Latka, Founde...
9 CEO's who hit $100m ARR Share Their Top Growth Tactics Nathan Latka, Founde...
 
Overcoming the PLG Trap: Lessons from Canva's Head of Sales & Head of EMEA Da...
Overcoming the PLG Trap: Lessons from Canva's Head of Sales & Head of EMEA Da...Overcoming the PLG Trap: Lessons from Canva's Head of Sales & Head of EMEA Da...
Overcoming the PLG Trap: Lessons from Canva's Head of Sales & Head of EMEA Da...
 
What is an RPA CoE? Session 1 – CoE Vision
What is an RPA CoE?  Session 1 – CoE VisionWhat is an RPA CoE?  Session 1 – CoE Vision
What is an RPA CoE? Session 1 – CoE Vision
 

Using Magento 2.3 MySQL Queues

  • 1. © 2019 Magento, Inc. Page | 1 Magento 2.3 Using MySQL For Queues
  • 2. © 2019 Magento, Inc. . Page | 2 Senior Software Developer at BORN Group Renu Mishra
  • 3. © 2019 Magento, Inc. Page | 3 Agenda
  • 4. © 2019 Magento, Inc. Page | 4 Agenda  Need Of Queue  Introduction to Queues  Creating Queues with MySQL  Publishing messages to Queue  Consuming the published message
  • 5. © 2019 Magento, Inc. Page | 5 Not In Scope
  • 6. © 2019 Magento, Inc. Page | 6 Not In Scope  Parallel Consumer processing.  Batch Processing.  AMQP Implementation (RabbitMQ).  Advanced Error handling (Rejecting and Re-queuing).  Supervisiord for consumer monitoring.
  • 7. © 2019 Magento, Inc. Page | 7 What is Queue and it’s uses ?
  • 8. © 2019 Magento, Inc. Page | 8 What is Queue and it’s uses ?  It distribute load across the application allowing work to placed in a queue and process independently.  Received and processes the message asynchronously.  It also includes a mechanism for storing undelivered messages.  Queue works in background. It has no frontend user interaction.
  • 9. © 2019 Magento, Inc. Page | 9 Introduction Of Queue
  • 10. © 2019 Magento, Inc. Page | 10 Queue Processing Diagram Routes
  • 11. © 2019 Magento, Inc. Page | 11 Queue Processing Description  A publisher is configured to send messages to a topic. • A topic is a way to categorize messages to consumers. • A consumer is configured to listen for messages with specific topics. • Queues route topics to consumers. • Consumers accept messages and perform actions on them.
  • 12. © 2019 Magento, Inc. Page | 12 Enough Talk Let’s Get Started!
  • 13. © 2019 Magento, Inc. Page | 13 Registering The Module
  • 14. © 2019 Magento, Inc. Page | 14 <module_root>/registration.php
  • 15. © 2019 Magento, Inc. Page | 15 <module_root>/etc/module.xml
  • 16. © 2019 Magento, Inc. Page | 16 Let’s Creates the Queue Files Now
  • 17. © 2019 Magento, Inc. Page | 17 Declaring The Publisher
  • 18. © 2019 Magento, Inc. Page | 18 Send the message to broker
  • 19. © 2019 Magento, Inc. Page | 19 <module_root>/etc/publisher.xml
  • 20. © 2019 Magento, Inc. Page | 20 <module_root>/etc/publisher.xml - publisher element - topic : The name of the topic.Wildcards character are not supported. - connection element - name : For AMQP connections, the connection name must match the connection attribute in the queue_topology.xml file. Otherwise, the connection name must be db. - exchange : The name of the exchange to publish to. The default system exchange name is magento.
  • 21. © 2019 Magento, Inc. Page | 21 <module_root>/etc/communication.xml
  • 22. © 2019 Magento, Inc. Page | 22 <module_root>/etc/communication.xml - topic element - name : A string that uniquely identifies the topic.Wildcards character are not supported in the communication.xml file(*,%,[] and so on). - request : Specifies the data type of the topic. - handler element - name : A string that uniquely defines the handler. - type : The class that defines the handler. - method : The method this handler executes.
  • 23. © 2019 Magento, Inc. Page | 23 Declare The Broker
  • 24. © 2019 Magento, Inc. Page | 24 Receive the Data From Producer/Publisher
  • 25. © 2019 Magento, Inc. Page | 25 <module_root>/etc/queue.xml
  • 26. © 2019 Magento, Inc. Page | 26 <module_root>/etc/queue.xml - broker element - topic : A topic defined in the communication.xml file. - exchange : The name of the exchange to publish to. The default system exchange name is magento - type : The type of message broker. For this release, the value must be amqp or db.
  • 27. © 2019 Magento, Inc. Page | 27 <module_root>/etc/queue.xml - queue element - name : Defines the queue name to send the message to. - consumer : The name of the consumer. - consumerInstance : The path to a Magento class that consumes the message. - handler : Specifies the class and method that processes the message. The value must be specified in the format <Vendor>Module<ServiceName>::<methodName>.
  • 28. © 2019 Magento, Inc. Page | 28 Declaring The Topology
  • 29. © 2019 Magento, Inc. Page | 29 Queue route topics to consumers
  • 30. © 2019 Magento, Inc. Page | 30 <module_root>/etc/queue_topology.xml
  • 31. © 2019 Magento, Inc. Page | 31 <module_root>/etc/queue_topology.xml - exchange element - name : A unique ID for the exchange. - type : Specifies the type of exchange. Must be topic. - connection : For AMQP connections, a string that identifies the connection. For MySQL connections, the connection name must be db.
  • 32. © 2019 Magento, Inc. Page | 32 <module_root>/etc/queue_topology.xml - binding element - id : A unique ID for this binding. - topic : The name of a topic. - destinationType : Must be queue. - destination : Identifies the name of a queue.
  • 33. © 2019 Magento, Inc. Page | 33 Declaring The Consumer
  • 34. © 2019 Magento, Inc. Page | 34 Consume the publish message Routes
  • 35. © 2019 Magento, Inc. Page | 35 <module_root>/etc/queue_consumer.xml
  • 36. © 2019 Magento, Inc. Page | 36 <module_root>/etc/queue_consumer.xml - consumer element - name : The name of the consumer. - queue : Defines the queue name to send the message to. - handler : Specifies the class and method that processes the message. The value must be specified in the format <Vendor>Module<ServiceName>::<methodName>. - consumerInstance : The Magento class name that consumes the message - connection : For AMQP connections, the connection name must match the connection attribute in the queue_topology.xml file. Otherwise, the connection name must be db.
  • 37. © 2019 Magento, Inc. Page | 37 So many files right ?
  • 38. © 2019 Magento, Inc. Page | 38 Enough XMLs now its PHP time !!
  • 39. © 2019 Magento, Inc. Page | 39 Request Class Declaration
  • 40. © 2019 Magento, Inc. Page | 40 Requested Class in Communication.xml
  • 41. © 2019 Magento, Inc. Page | 41 Requested Class Interface
  • 42. © 2019 Magento, Inc. Page | 42 Concrete Class Declaration
  • 43. © 2019 Magento, Inc. Page | 43 Concrete Class declare in etc/di.xml
  • 44. © 2019 Magento, Inc. Page | 44 Concrete Class Implementation
  • 45. © 2019 Magento, Inc. Page | 45 Publishing The Message
  • 46. © 2019 Magento, Inc. Page | 46 Publish The Message in Controller
  • 47. © 2019 Magento, Inc. Page | 47 MagentoFrameworkMessageQueuePu blisherInterface
  • 48. © 2019 Magento, Inc. Page | 48 Publish The Message in Controller
  • 49. © 2019 Magento, Inc. Page | 49 Consume The Message
  • 50. © 2019 Magento, Inc. Page | 50 Consume The Message
  • 51. © 2019 Magento, Inc. Page | 51 Finally Code Implementation Done !!!
  • 52. © 2019 Magento, Inc. Page | 52 Execute The Queue
  • 53. © 2019 Magento, Inc. Page | 53 Wait we need to run the command before executing the Queue
  • 54. © 2019 Magento, Inc. Page | 54 Upgrade Command Install the Queue Module
  • 55. © 2019 Magento, Inc. Page | 55 What is happening in background when command executed ?
  • 56. © 2019 Magento, Inc. Page | 56 Queue Table
  • 57. © 2019 Magento, Inc. Page | 57 Now Let’s Publish the Queue using Controller
  • 58. © 2019 Magento, Inc. Page | 58 [base_url]/queue1/index/index
  • 59. © 2019 Magento, Inc. Page | 59 What happen in background when queue published?
  • 60. © 2019 Magento, Inc. Page | 60 queue_message Table
  • 61. © 2019 Magento, Inc. Page | 61 It’s time to consume the published message
  • 62. © 2019 Magento, Inc. Page | 62 View a list of available message queue consumers
  • 63. © 2019 Magento, Inc. Page | 63 View a list of available message queue consumers
  • 64. © 2019 Magento, Inc. Page | 64 Command that consume the message
  • 65. © 2019 Magento, Inc. Page | 65 Consume the message
  • 66. © 2019 Magento, Inc. Page | 66 What happen when consumer start processing ?
  • 67. © 2019 Magento, Inc. Page | 67 queue_message_status table
  • 68. © 2019 Magento, Inc. Page | 68 queue_message_status table
  • 69. © 2019 Magento, Inc. Page | 69 status column in queue_message_status table
  • 70. © 2019 Magento, Inc. Page | 70 Queue Execution On Production
  • 71. © 2019 Magento, Inc. Page | 71 MySQL Message Queue Setting Stores > Settings > Configuration > Advanced > System > Cron
  • 72. © 2019 Magento, Inc. Page | 72 Configure cron job consumer_runner in app/etc/env.php
  • 73. © 2019 Magento, Inc. Page | 73  cron_run - the option for enabling/disabling cron job consumers_runner, by default is true.  max_messages - the maximum number of messages for each consumer that must be processed before consumer terminate, by default is 1000. If it is 0, then the consumer never stops working.  consumers - the list of consumers which will be run, by default is empty array (all consumers are allowed to be run). consumer_runner parameter Details
  • 74. © 2019 Magento, Inc. Page | 74 Start message queue consumers
  • 75. © 2019 Magento, Inc. Page | 75 Start message queue consumers
  • 76. © 2019 Magento, Inc. Page | 76 Now you know pretty well about Queue
  • 77. © 2019 Magento, Inc. Page | 77 Questions ?
  • 78. © 2019 Magento, Inc. Page | 78 Thank You