SlideShare uma empresa Scribd logo
1 de 32
A Facebook Chat Bot
Using Magento 2 Async
Processing
Magento 2 Architect
Eugene Tulika @vrann
Use-Case: Store With
Hand-Picked Books
Niche Customers With Unusual Requests
Facebook Page
• Facebook is the best way to reach larger and targeted audience
• Facebook Page representing the store
• Customers don’t want to leave Facebook to shop in store
• Customers ask questions in Messenger
Facebook Chat Bots
• When store Manager cannot handle all communications manually
• Facebook webhooks for messages received in the chat
• Facebook API for responses
Facebook POSTs Messages to the Callback
Callback.php
200 OK
Callback POSTs Response to Facebook API
Understanding the
Conversation
How to Convert Messages to Magento API Requests
Input
Classifier
Search catalog by author
Title, image url, description
Quadrant of Conversation Parsers
Image from https://www.quora.com/What-is-the-best-way-to-learn-and-write-a-AI-Chat-bot
Wit.AI Retrieval Conversation Setup
Conversation Parsing
• https://github.com/vrann/phpwit
Do you have a book by Proust?
Intent: catalog_search
Parameters:
 Author: Proust
Invoke: catalogSearch(context)
Integration With
Magento
IN/OUT integration Using Web API
On average, Magento store has integrations
with 15 different external systems
Integrations Framework:
• API In supported by Web API (CE) and RabbitMQ (EE)
• API Out supported by RabbitMQ (EE)
Callback Makes API Request to Magento
Messenger Callback.php
API
Web API Request
Magento POSTs response to Facebook
Web API Service Interface
Magento API Interfaces
• https://github.com/vrann/magebot
Map Service to the Web API Endpoint
What Can Go Wrong?
When customer writes in Messenger:
• Blocking request from callback to Magento
• Scalability: Magento can be overloaded processing other requests
• Availability: Magento API is unreachable at that moment
Messages from customer can be lost!
API IN Using RabbitMQ
Callback Puts Messages to the Queue
• Scripts: https://github.com/vrann/http-rabbitmq-writer
Messenger
API
Callback.php
Magento POSTs response to Facebook
Rabbit MQ
Transformation of Web API to Inbound Calls via RabbitMQ
Map message handler to topic in communication.xml
Map consumer to queue in queue_consumer.xml
Run consumer(s):
Communication & Queue Configurations
We achieved:
 Non-Blocking request, response to Facebook sent immediately
 Scalability handled by Queue
 Availability handled by Queue
Communication vs Queue:
• Communication Framework is an abstraction around
publisher/subscriber. It can be implemented:
– with database and HTTP requests instead (webhooks)
– in-memory (observers)
• Queue is a Transport layer for Communication
– configuration of RabbitMQ adapter and topology
API OUT Using
RabbitMQ
Goal: Magento Sends Messages to RabbitMQ
• Scripts: https://github.com/vrann/http-rabbitmq-writer
Messenger
API
callback.php
response.php
Before: Sender Interface Using HTTP Request
Now: Sender Interface Using RabbitMQ
Replace preference for MessageSenderInterface in di.xml,
Add “Remote” suffix
Interface implementation will be auto-generated:
Publisher & Topology
queue_publisher.xml maps generated topic to the exchange
queue_topology.xml configures exchange to queue bindings
• Prior to Magento EE 2.2 these config are in queue.xml
Wrap Up
• We covered:
– Reasons behind Magento Web API data structures
– Reasons to use queues
– Switch from Web API to the RabbitMQ
– Code generation of API OUT for RabbitMQ
– Communication framework vs Queue framework
– Separation of publishers, consumers, topology in 2.2
– Input Message Handling
– Facebook bots!
• https://github.com/vrann/facebook-chatbot
• https://github.com/vrann/http-rabbitmq-writer
• https://github.com/vrann/magebot
Q&A
Write me @vrann (twitter, github)
etulika@magento.com

Mais conteúdo relacionado

Mais procurados

Picking the Right CMS - WordCamp Toronto 2014
Picking the Right CMS - WordCamp Toronto 2014Picking the Right CMS - WordCamp Toronto 2014
Picking the Right CMS - WordCamp Toronto 2014Alan Lok
 
Fundamentals of Extending Magento 2 - php[world] 2015
Fundamentals of Extending Magento 2 - php[world] 2015Fundamentals of Extending Magento 2 - php[world] 2015
Fundamentals of Extending Magento 2 - php[world] 2015David Alger
 
How to create theme in Magento 2 - Part 2
How to create theme in Magento 2 - Part 2How to create theme in Magento 2 - Part 2
How to create theme in Magento 2 - Part 2Magestore
 
Rest API Best Practices
Rest API Best PracticesRest API Best Practices
Rest API Best PracticesMemi Lavi
 
Integrating Accelerated Mobile Pages (AMP) In Drupal Websites
Integrating Accelerated Mobile Pages (AMP) In Drupal WebsitesIntegrating Accelerated Mobile Pages (AMP) In Drupal Websites
Integrating Accelerated Mobile Pages (AMP) In Drupal WebsitesExcellent Webworld
 
Joomlatools Platform v2.0
Joomlatools Platform v2.0Joomlatools Platform v2.0
Joomlatools Platform v2.0Joomlatools
 
Federico Soich - Upgrading Magento Version
Federico Soich - Upgrading Magento VersionFederico Soich - Upgrading Magento Version
Federico Soich - Upgrading Magento VersionMeet Magento Italy
 
How to Install Magento on WAMP Server
How to Install Magento on WAMP ServerHow to Install Magento on WAMP Server
How to Install Magento on WAMP ServerAPPSeCONNECT
 
Integrate any Angular Project into WebSphere Portal
Integrate any Angular Project into WebSphere PortalIntegrate any Angular Project into WebSphere Portal
Integrate any Angular Project into WebSphere PortalHimanshu Mendiratta
 
Introducing eZ Publish Platform 5.1 - webinar
Introducing eZ Publish Platform 5.1 - webinarIntroducing eZ Publish Platform 5.1 - webinar
Introducing eZ Publish Platform 5.1 - webinarRoland Benedetti
 
Magento 2 Design Patterns
Magento 2 Design PatternsMagento 2 Design Patterns
Magento 2 Design PatternsMax Pronko
 
Customizing nopCommerce with Plugins and Themes
Customizing nopCommerce with Plugins and ThemesCustomizing nopCommerce with Plugins and Themes
Customizing nopCommerce with Plugins and ThemesGaines Kergosien
 

Mais procurados (17)

Picking the Right CMS - WordCamp Toronto 2014
Picking the Right CMS - WordCamp Toronto 2014Picking the Right CMS - WordCamp Toronto 2014
Picking the Right CMS - WordCamp Toronto 2014
 
Rajesh CV
Rajesh CVRajesh CV
Rajesh CV
 
Fundamentals of Extending Magento 2 - php[world] 2015
Fundamentals of Extending Magento 2 - php[world] 2015Fundamentals of Extending Magento 2 - php[world] 2015
Fundamentals of Extending Magento 2 - php[world] 2015
 
How to create theme in Magento 2 - Part 2
How to create theme in Magento 2 - Part 2How to create theme in Magento 2 - Part 2
How to create theme in Magento 2 - Part 2
 
Progressive Web App
Progressive Web AppProgressive Web App
Progressive Web App
 
Lms
LmsLms
Lms
 
Rest API Best Practices
Rest API Best PracticesRest API Best Practices
Rest API Best Practices
 
Admin Panel
Admin Panel Admin Panel
Admin Panel
 
Living lab Actioncable
Living lab ActioncableLiving lab Actioncable
Living lab Actioncable
 
Integrating Accelerated Mobile Pages (AMP) In Drupal Websites
Integrating Accelerated Mobile Pages (AMP) In Drupal WebsitesIntegrating Accelerated Mobile Pages (AMP) In Drupal Websites
Integrating Accelerated Mobile Pages (AMP) In Drupal Websites
 
Joomlatools Platform v2.0
Joomlatools Platform v2.0Joomlatools Platform v2.0
Joomlatools Platform v2.0
 
Federico Soich - Upgrading Magento Version
Federico Soich - Upgrading Magento VersionFederico Soich - Upgrading Magento Version
Federico Soich - Upgrading Magento Version
 
How to Install Magento on WAMP Server
How to Install Magento on WAMP ServerHow to Install Magento on WAMP Server
How to Install Magento on WAMP Server
 
Integrate any Angular Project into WebSphere Portal
Integrate any Angular Project into WebSphere PortalIntegrate any Angular Project into WebSphere Portal
Integrate any Angular Project into WebSphere Portal
 
Introducing eZ Publish Platform 5.1 - webinar
Introducing eZ Publish Platform 5.1 - webinarIntroducing eZ Publish Platform 5.1 - webinar
Introducing eZ Publish Platform 5.1 - webinar
 
Magento 2 Design Patterns
Magento 2 Design PatternsMagento 2 Design Patterns
Magento 2 Design Patterns
 
Customizing nopCommerce with Plugins and Themes
Customizing nopCommerce with Plugins and ThemesCustomizing nopCommerce with Plugins and Themes
Customizing nopCommerce with Plugins and Themes
 

Destaque

3 Storytelling Tips - From Acclaimed Writer Burt Helm
3 Storytelling Tips - From Acclaimed Writer Burt Helm3 Storytelling Tips - From Acclaimed Writer Burt Helm
3 Storytelling Tips - From Acclaimed Writer Burt HelmEthos3
 
12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at WorkGetSmarter
 
10 Things To Be Thankful For by: @empoweredpres
10 Things To Be Thankful For by: @empoweredpres10 Things To Be Thankful For by: @empoweredpres
10 Things To Be Thankful For by: @empoweredpresEmpowered Presentations
 
15 Quotes To Nurture Your Creative Soul!
15 Quotes To Nurture Your Creative Soul!15 Quotes To Nurture Your Creative Soul!
15 Quotes To Nurture Your Creative Soul!DesignMantic
 
The X factor: The Secret to Better Content Marketing
The X factor: The Secret to Better Content Marketing The X factor: The Secret to Better Content Marketing
The X factor: The Secret to Better Content Marketing Mathew Sweezey
 
10 Better Ways to Add Text to #Images
10 Better Ways to Add Text to #Images 10 Better Ways to Add Text to #Images
10 Better Ways to Add Text to #Images Presentation Panda
 
20 Inspirational Leadership Quotes
20 Inspirational Leadership Quotes20 Inspirational Leadership Quotes
20 Inspirational Leadership QuotesOfficevibe
 
The ABC’s of Living a Healthy Life
The ABC’s of Living a Healthy LifeThe ABC’s of Living a Healthy Life
The ABC’s of Living a Healthy LifeDr. Omer Hameed
 

Destaque (10)

3 Storytelling Tips - From Acclaimed Writer Burt Helm
3 Storytelling Tips - From Acclaimed Writer Burt Helm3 Storytelling Tips - From Acclaimed Writer Burt Helm
3 Storytelling Tips - From Acclaimed Writer Burt Helm
 
12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work
 
10 Things To Be Thankful For by: @empoweredpres
10 Things To Be Thankful For by: @empoweredpres10 Things To Be Thankful For by: @empoweredpres
10 Things To Be Thankful For by: @empoweredpres
 
15 Quotes To Nurture Your Creative Soul!
15 Quotes To Nurture Your Creative Soul!15 Quotes To Nurture Your Creative Soul!
15 Quotes To Nurture Your Creative Soul!
 
How To Win That Next Sales Presentation - @High_Spark @cliffatkinson
How To Win That Next Sales Presentation - @High_Spark @cliffatkinsonHow To Win That Next Sales Presentation - @High_Spark @cliffatkinson
How To Win That Next Sales Presentation - @High_Spark @cliffatkinson
 
The X factor: The Secret to Better Content Marketing
The X factor: The Secret to Better Content Marketing The X factor: The Secret to Better Content Marketing
The X factor: The Secret to Better Content Marketing
 
10 Better Ways to Add Text to #Images
10 Better Ways to Add Text to #Images 10 Better Ways to Add Text to #Images
10 Better Ways to Add Text to #Images
 
Our World is Hungry
Our World is HungryOur World is Hungry
Our World is Hungry
 
20 Inspirational Leadership Quotes
20 Inspirational Leadership Quotes20 Inspirational Leadership Quotes
20 Inspirational Leadership Quotes
 
The ABC’s of Living a Healthy Life
The ABC’s of Living a Healthy LifeThe ABC’s of Living a Healthy Life
The ABC’s of Living a Healthy Life
 

Semelhante a Magento Live Australia 2016 Facebook Chatbot for Magento

Mage Titans USA 2016 - Eugene Tulika - Integrations with Magento, end to end...
Mage Titans USA 2016 - Eugene Tulika -  Integrations with Magento, end to end...Mage Titans USA 2016 - Eugene Tulika -  Integrations with Magento, end to end...
Mage Titans USA 2016 - Eugene Tulika - Integrations with Magento, end to end...Stacey Whitney
 
txtWeb : Imagine the Internet and more on SMS
txtWeb : Imagine the Internet and more on SMStxtWeb : Imagine the Internet and more on SMS
txtWeb : Imagine the Internet and more on SMSAryashree Pritikrishna
 
Serverless chatbot: from idea to production at blazing speed
Serverless chatbot: from idea to production at blazing speedServerless chatbot: from idea to production at blazing speed
Serverless chatbot: from idea to production at blazing speedLuca Bianchi
 
What IT professionals need to know about SharePoint 2013 Apps
What IT professionals need to know about SharePoint 2013 AppsWhat IT professionals need to know about SharePoint 2013 Apps
What IT professionals need to know about SharePoint 2013 AppsMike Henthorn
 
Facebook Messenger Platform Framework
Facebook Messenger Platform FrameworkFacebook Messenger Platform Framework
Facebook Messenger Platform FrameworkRam Murat Sharma
 
Serverless chatbot: from idea to production at blazing speed
Serverless chatbot: from idea to production at blazing speedServerless chatbot: from idea to production at blazing speed
Serverless chatbot: from idea to production at blazing speedPaolo Montrasio
 
From ZERO to REST in an hour
From ZERO to REST in an hour From ZERO to REST in an hour
From ZERO to REST in an hour Cisco DevNet
 
Come riprogettare le attuali farm solution di share point con il nuovo modell...
Come riprogettare le attuali farm solution di share point con il nuovo modell...Come riprogettare le attuali farm solution di share point con il nuovo modell...
Come riprogettare le attuali farm solution di share point con il nuovo modell...Fabio Franzini
 
Story of a Cerberus Bot
Story of a Cerberus BotStory of a Cerberus Bot
Story of a Cerberus Botdega1999
 
Build your first messenger bot
Build your first messenger botBuild your first messenger bot
Build your first messenger botNowa Labs Pte Ltd
 
Identifying and solving enterprise problems
Identifying and solving enterprise problems  Identifying and solving enterprise problems
Identifying and solving enterprise problems Vasu Jain
 
Enjoying the Move from WCF to the Web API
Enjoying the Move from WCF to the Web APIEnjoying the Move from WCF to the Web API
Enjoying the Move from WCF to the Web APIKevin Hazzard
 
weechat : web-based chatting with twitter friends
weechat : web-based chatting with twitter friendsweechat : web-based chatting with twitter friends
weechat : web-based chatting with twitter friendsDaehee Han
 
Building a Great Web API - Evan Cooke - QCON 2011
Building a Great Web API - Evan Cooke - QCON 2011Building a Great Web API - Evan Cooke - QCON 2011
Building a Great Web API - Evan Cooke - QCON 2011Twilio Inc
 
ClojuTRE2015: Kekkonen - making your Clojure web APIs more awesome
ClojuTRE2015: Kekkonen - making your Clojure web APIs more awesomeClojuTRE2015: Kekkonen - making your Clojure web APIs more awesome
ClojuTRE2015: Kekkonen - making your Clojure web APIs more awesomeMetosin Oy
 
JavaScript Service Worker Design Patterns for Better User Experience
JavaScript Service Worker Design Patterns for Better User ExperienceJavaScript Service Worker Design Patterns for Better User Experience
JavaScript Service Worker Design Patterns for Better User Experiencereeder29
 
SharePoint as Development Platform for the Modern Intranet
SharePoint as Development Platform for the Modern IntranetSharePoint as Development Platform for the Modern Intranet
SharePoint as Development Platform for the Modern IntranetHaaron Gonzalez
 
Web Clients for Ruby and What they should be in the future
Web Clients for Ruby and What they should be in the futureWeb Clients for Ruby and What they should be in the future
Web Clients for Ruby and What they should be in the futureToru Kawamura
 
Integrations with the Force.com Platform Using Custom Apex REST Services
Integrations with the Force.com Platform Using Custom Apex REST ServicesIntegrations with the Force.com Platform Using Custom Apex REST Services
Integrations with the Force.com Platform Using Custom Apex REST ServicesSalesforce Developers
 

Semelhante a Magento Live Australia 2016 Facebook Chatbot for Magento (20)

Mage Titans USA 2016 - Eugene Tulika - Integrations with Magento, end to end...
Mage Titans USA 2016 - Eugene Tulika -  Integrations with Magento, end to end...Mage Titans USA 2016 - Eugene Tulika -  Integrations with Magento, end to end...
Mage Titans USA 2016 - Eugene Tulika - Integrations with Magento, end to end...
 
txtWeb : Imagine the Internet and more on SMS
txtWeb : Imagine the Internet and more on SMStxtWeb : Imagine the Internet and more on SMS
txtWeb : Imagine the Internet and more on SMS
 
Chatbot Meetup
Chatbot MeetupChatbot Meetup
Chatbot Meetup
 
Serverless chatbot: from idea to production at blazing speed
Serverless chatbot: from idea to production at blazing speedServerless chatbot: from idea to production at blazing speed
Serverless chatbot: from idea to production at blazing speed
 
What IT professionals need to know about SharePoint 2013 Apps
What IT professionals need to know about SharePoint 2013 AppsWhat IT professionals need to know about SharePoint 2013 Apps
What IT professionals need to know about SharePoint 2013 Apps
 
Facebook Messenger Platform Framework
Facebook Messenger Platform FrameworkFacebook Messenger Platform Framework
Facebook Messenger Platform Framework
 
Serverless chatbot: from idea to production at blazing speed
Serverless chatbot: from idea to production at blazing speedServerless chatbot: from idea to production at blazing speed
Serverless chatbot: from idea to production at blazing speed
 
From ZERO to REST in an hour
From ZERO to REST in an hour From ZERO to REST in an hour
From ZERO to REST in an hour
 
Come riprogettare le attuali farm solution di share point con il nuovo modell...
Come riprogettare le attuali farm solution di share point con il nuovo modell...Come riprogettare le attuali farm solution di share point con il nuovo modell...
Come riprogettare le attuali farm solution di share point con il nuovo modell...
 
Story of a Cerberus Bot
Story of a Cerberus BotStory of a Cerberus Bot
Story of a Cerberus Bot
 
Build your first messenger bot
Build your first messenger botBuild your first messenger bot
Build your first messenger bot
 
Identifying and solving enterprise problems
Identifying and solving enterprise problems  Identifying and solving enterprise problems
Identifying and solving enterprise problems
 
Enjoying the Move from WCF to the Web API
Enjoying the Move from WCF to the Web APIEnjoying the Move from WCF to the Web API
Enjoying the Move from WCF to the Web API
 
weechat : web-based chatting with twitter friends
weechat : web-based chatting with twitter friendsweechat : web-based chatting with twitter friends
weechat : web-based chatting with twitter friends
 
Building a Great Web API - Evan Cooke - QCON 2011
Building a Great Web API - Evan Cooke - QCON 2011Building a Great Web API - Evan Cooke - QCON 2011
Building a Great Web API - Evan Cooke - QCON 2011
 
ClojuTRE2015: Kekkonen - making your Clojure web APIs more awesome
ClojuTRE2015: Kekkonen - making your Clojure web APIs more awesomeClojuTRE2015: Kekkonen - making your Clojure web APIs more awesome
ClojuTRE2015: Kekkonen - making your Clojure web APIs more awesome
 
JavaScript Service Worker Design Patterns for Better User Experience
JavaScript Service Worker Design Patterns for Better User ExperienceJavaScript Service Worker Design Patterns for Better User Experience
JavaScript Service Worker Design Patterns for Better User Experience
 
SharePoint as Development Platform for the Modern Intranet
SharePoint as Development Platform for the Modern IntranetSharePoint as Development Platform for the Modern Intranet
SharePoint as Development Platform for the Modern Intranet
 
Web Clients for Ruby and What they should be in the future
Web Clients for Ruby and What they should be in the futureWeb Clients for Ruby and What they should be in the future
Web Clients for Ruby and What they should be in the future
 
Integrations with the Force.com Platform Using Custom Apex REST Services
Integrations with the Force.com Platform Using Custom Apex REST ServicesIntegrations with the Force.com Platform Using Custom Apex REST Services
Integrations with the Force.com Platform Using Custom Apex REST Services
 

Mais de Vrann Tulika

Magento Web API Ecosystem. Imagine 2018
Magento Web API Ecosystem. Imagine 2018Magento Web API Ecosystem. Imagine 2018
Magento Web API Ecosystem. Imagine 2018Vrann Tulika
 
Career of the Software Engineer in Modern Open-Source e-Commerce Company
Career of the Software Engineer in Modern Open-Source e-Commerce CompanyCareer of the Software Engineer in Modern Open-Source e-Commerce Company
Career of the Software Engineer in Modern Open-Source e-Commerce CompanyVrann Tulika
 
Magento Live Australia 2016: Request Flow
Magento Live Australia 2016: Request FlowMagento Live Australia 2016: Request Flow
Magento Live Australia 2016: Request FlowVrann Tulika
 
Enterprise Patterns in Magento
Enterprise Patterns in MagentoEnterprise Patterns in Magento
Enterprise Patterns in MagentoVrann Tulika
 
Розпаралелювання Програм на Фортрані з Використанням Техніки Переписувальних ...
Розпаралелювання Програм на Фортрані з Використанням Техніки Переписувальних ...Розпаралелювання Програм на Фортрані з Використанням Техніки Переписувальних ...
Розпаралелювання Програм на Фортрані з Використанням Техніки Переписувальних ...Vrann Tulika
 
PHP and Asynchronous Systems
PHP and Asynchronous SystemsPHP and Asynchronous Systems
PHP and Asynchronous SystemsVrann Tulika
 

Mais de Vrann Tulika (6)

Magento Web API Ecosystem. Imagine 2018
Magento Web API Ecosystem. Imagine 2018Magento Web API Ecosystem. Imagine 2018
Magento Web API Ecosystem. Imagine 2018
 
Career of the Software Engineer in Modern Open-Source e-Commerce Company
Career of the Software Engineer in Modern Open-Source e-Commerce CompanyCareer of the Software Engineer in Modern Open-Source e-Commerce Company
Career of the Software Engineer in Modern Open-Source e-Commerce Company
 
Magento Live Australia 2016: Request Flow
Magento Live Australia 2016: Request FlowMagento Live Australia 2016: Request Flow
Magento Live Australia 2016: Request Flow
 
Enterprise Patterns in Magento
Enterprise Patterns in MagentoEnterprise Patterns in Magento
Enterprise Patterns in Magento
 
Розпаралелювання Програм на Фортрані з Використанням Техніки Переписувальних ...
Розпаралелювання Програм на Фортрані з Використанням Техніки Переписувальних ...Розпаралелювання Програм на Фортрані з Використанням Техніки Переписувальних ...
Розпаралелювання Програм на Фортрані з Використанням Техніки Переписувальних ...
 
PHP and Asynchronous Systems
PHP and Asynchronous SystemsPHP and Asynchronous Systems
PHP and Asynchronous Systems
 

Último

How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.Curtis Poe
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii SoldatenkoFwdays
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxLoriGlavin3
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteDianaGray10
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024Stephanie Beckett
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsPixlogix Infotech
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxhariprasad279825
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clashcharlottematthew16
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...Fwdays
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLScyllaDB
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Enterprise Knowledge
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenHervé Boutemy
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 

Último (20)

How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test Suite
 
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and Cons
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptx
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clash
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQL
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache Maven
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 

Magento Live Australia 2016 Facebook Chatbot for Magento

  • 1.
  • 2. A Facebook Chat Bot Using Magento 2 Async Processing
  • 5. Niche Customers With Unusual Requests
  • 6. Facebook Page • Facebook is the best way to reach larger and targeted audience • Facebook Page representing the store • Customers don’t want to leave Facebook to shop in store • Customers ask questions in Messenger
  • 7. Facebook Chat Bots • When store Manager cannot handle all communications manually • Facebook webhooks for messages received in the chat • Facebook API for responses
  • 8. Facebook POSTs Messages to the Callback Callback.php 200 OK
  • 9. Callback POSTs Response to Facebook API
  • 11. How to Convert Messages to Magento API Requests Input Classifier Search catalog by author Title, image url, description
  • 12. Quadrant of Conversation Parsers Image from https://www.quora.com/What-is-the-best-way-to-learn-and-write-a-AI-Chat-bot
  • 14. Conversation Parsing • https://github.com/vrann/phpwit Do you have a book by Proust? Intent: catalog_search Parameters:  Author: Proust Invoke: catalogSearch(context)
  • 16. On average, Magento store has integrations with 15 different external systems Integrations Framework: • API In supported by Web API (CE) and RabbitMQ (EE) • API Out supported by RabbitMQ (EE)
  • 17. Callback Makes API Request to Magento Messenger Callback.php API Web API Request Magento POSTs response to Facebook
  • 18. Web API Service Interface
  • 19. Magento API Interfaces • https://github.com/vrann/magebot
  • 20. Map Service to the Web API Endpoint
  • 21. What Can Go Wrong? When customer writes in Messenger: • Blocking request from callback to Magento • Scalability: Magento can be overloaded processing other requests • Availability: Magento API is unreachable at that moment Messages from customer can be lost!
  • 22. API IN Using RabbitMQ
  • 23. Callback Puts Messages to the Queue • Scripts: https://github.com/vrann/http-rabbitmq-writer Messenger API Callback.php Magento POSTs response to Facebook Rabbit MQ
  • 24. Transformation of Web API to Inbound Calls via RabbitMQ Map message handler to topic in communication.xml Map consumer to queue in queue_consumer.xml Run consumer(s):
  • 25. Communication & Queue Configurations We achieved:  Non-Blocking request, response to Facebook sent immediately  Scalability handled by Queue  Availability handled by Queue Communication vs Queue: • Communication Framework is an abstraction around publisher/subscriber. It can be implemented: – with database and HTTP requests instead (webhooks) – in-memory (observers) • Queue is a Transport layer for Communication – configuration of RabbitMQ adapter and topology
  • 27. Goal: Magento Sends Messages to RabbitMQ • Scripts: https://github.com/vrann/http-rabbitmq-writer Messenger API callback.php response.php
  • 28. Before: Sender Interface Using HTTP Request
  • 29. Now: Sender Interface Using RabbitMQ Replace preference for MessageSenderInterface in di.xml, Add “Remote” suffix Interface implementation will be auto-generated:
  • 30. Publisher & Topology queue_publisher.xml maps generated topic to the exchange queue_topology.xml configures exchange to queue bindings • Prior to Magento EE 2.2 these config are in queue.xml
  • 31. Wrap Up • We covered: – Reasons behind Magento Web API data structures – Reasons to use queues – Switch from Web API to the RabbitMQ – Code generation of API OUT for RabbitMQ – Communication framework vs Queue framework – Separation of publishers, consumers, topology in 2.2 – Input Message Handling – Facebook bots! • https://github.com/vrann/facebook-chatbot • https://github.com/vrann/http-rabbitmq-writer • https://github.com/vrann/magebot
  • 32. Q&A Write me @vrann (twitter, github) etulika@magento.com