SlideShare a Scribd company logo
Tho Luong 
SILILAB Vietnam 
Hanoi, March 1, 2014 
Rubichat
Introduction 
2 
 Rubichat: 
 A Realtime Communication Service 
 Allow website owner to communicate with customer 
more easily
Rubichat: customer & operator 
3
Introduction 
4 
 Rubichat: 
 A Realtime Communication Service 
 Allow website owner to communicate with customer 
more easily 
 Easy to setup:
Architecture 
X user Facebook user Customer and operator 
X1 X2 crane crane 
RabbitMQ 
tractor tractor 
Java, php, spring, hibernate, amqp, 
nodejs, zend framework, netty 
sensor Apache 
? 
MySQL, Redis and MongoDB
Issue 
6 
 Develop rubiweb project in PHP using Zend 
Framework 
 Some services were implemented in Java (30%) 
 Should we implement other services in Java or PHP 
or both of them? 
 3 solutions
Solution #1 
7 
 Reimplement all services in PHP 
 Some services will be implemented in both Java 
and PHP  not a big problem 
 PHP and Zend work well with MySQL, do they 
still work well with MongoDB and Redis? 
 Just some services use MongoDB and Redis 
 not a big problem
Solution #1 
8 
 When Java wants to use a service that is 
implemented in PHP  port this implementation to 
Java? 
 Some services are hard to implement, ex: access 
control service 
Solution #1: complicated and not easy for 
maintainance.
Solution #2 
9 
 Beauty and maintainability are #1 priority 
 All services will be implemented in Java 
 PHP calls Java service implementations remotely 
via RabbitMQ 
e2 
PHP Java 
e1 
req 
resp 
OK
Solution #2 
10 
 Problem: how to receive response properly? 
PHP -01 
PHP-02 
Resp-01 
Resp-02 
 Mission impossible
Solution #2 
11 
 How about using one queue for each PHP request? 
PHP-01 
PHP-02 
….. ….. e 
PHP-n 
 At least, one “dirty” queue is produced after each 
PHP request lifecycle 
No, RabbitMQ must manage a lot of queues.
Solution #3 
12 
 RPC: PHP invokes Java API remotely 
PHP 
Java 
Server 
X protocol 
 Issues: 
1. System architecture 
2. Protocol selection 
Flappy 
3. Technology selections for Java Server
System architecture 
13 
 Option 1: flappy accesses database directly 
PHP 
Java 
Server 
X protocol 
Flappy 
MySQ 
L 
Mong 
oDB 
Redis 
 Option 2: flappy serves PHP connections, access 
service implentations via RabbitMQ 
PHP 
Java 
Server 
Flappy 
RabbitMQ 
MySQ 
L 
Mong 
oDB 
Redis 
Tractor 
Tractor 
….. 
…..
Protocol selection 
14 
 Common RPC protocols 
 XML RPC 
 JSON RPC 
 Protobuf (google) 
 Thrift (facebook) 
 SOAP 
 Flappy uses XMPP (RFC 3920,RFC 3921) message 
format 
 Easy to control 
 Familiar to Rubichat developers
XMPP in JSON format 
15 
 Stanza: IQ 
 Stanza: M
Binary data format 
16 
 Data type: 1 byte 
 RABBIT_TRACTOR_IN, 
RABBIT_TRACTOR_OUT, FLAPPY_IN, 
FLAPPY_OUT, NA 
 Length: int: 4 byte 
 Body 
type length body 
1 4 length
Technologies selection 
17 
 Socket library: Netty, a great library for network 
application 
 Twitter uses Netty to improve search engine 
performance. (3x faster) 
 Interceptor design in Tractor server is influenced by 
Netty
Netty advantages 
18 
 Asynchronous I/O: decouple threads from Client 
Socket Connections 
 Rich Buffer data structure 
 Advanced Components for More Rapid 
Development 
 Event Model based on the Interceptor Chain 
Pattern
Test result 
19 
 Create 100 users, find them and measure time: 
Service Query Tractor(ms) Client (ms) Δ (ms) 
Create 100 5196 5665 469 
Find 1 187 203 16 
Service Query Tractor(ms) Client (ms) Δ (ms) 
Create 100 4414 
Find 1 34 
(New FlappyClient implementation: use single connection(March 26, 2014))
20 
Demo: 
1. Flappy Server 
2. Tractor
Solution disadvantages 
21 
response 
PHP 
Java Server 
Flappy 
.phpModel 
ToJSON() 
request 
.jsonTo 
PhpModel() 
.jsonTo 
JavaModel() 
.javaModel 
ToJSON() 
 Write data-mappers 
manually
Future work 
22 
 Tool for generating data mappers 
 Optimize PHP FlappyClient and develop clients for 
other languages
Thank you! 
23
Ad

More Related Content

What's hot (20)

Scaling application with RabbitMQ
Scaling application with RabbitMQScaling application with RabbitMQ
Scaling application with RabbitMQ
Nahidul Kibria
 
Netty Notes Part 3 - Channel Pipeline and EventLoops
Netty Notes Part 3 - Channel Pipeline and EventLoopsNetty Notes Part 3 - Channel Pipeline and EventLoops
Netty Notes Part 3 - Channel Pipeline and EventLoops
Rick Hightower
 
Ad Server Optimization
Ad Server OptimizationAd Server Optimization
Ad Server Optimization
Abhishek Parwal
 
Message Broker System and RabbitMQ
Message Broker System and RabbitMQMessage Broker System and RabbitMQ
Message Broker System and RabbitMQ
University of Alabama at Birmingham
 
AMQP with RabbitMQ
AMQP with RabbitMQAMQP with RabbitMQ
AMQP with RabbitMQ
Spyros Papageorgiou
 
Amqp Basic
Amqp BasicAmqp Basic
Amqp Basic
Rahul Agrawal
 
Reaching 5 Million Messaging Connections: Our Journey with Kubernetes
Reaching 5 Million Messaging Connections:  Our Journey with KubernetesReaching 5 Million Messaging Connections:  Our Journey with Kubernetes
Reaching 5 Million Messaging Connections: Our Journey with Kubernetes
Connected
 
Messaging Standards and Systems - AMQP & RabbitMQ
Messaging Standards and Systems - AMQP & RabbitMQMessaging Standards and Systems - AMQP & RabbitMQ
Messaging Standards and Systems - AMQP & RabbitMQ
All Things Open
 
Introduction To RabbitMQ
Introduction To RabbitMQIntroduction To RabbitMQ
Introduction To RabbitMQ
Knoldus Inc.
 
VerneMQ - Distributed MQTT Broker
VerneMQ - Distributed MQTT BrokerVerneMQ - Distributed MQTT Broker
VerneMQ - Distributed MQTT Broker
Adriano Pimpini
 
RabbitMQ Model and Some Example Applications
RabbitMQ Model and Some Example ApplicationsRabbitMQ Model and Some Example Applications
RabbitMQ Model and Some Example Applications
Houcheng Lin
 
RabbitMQ fairly-indepth
RabbitMQ fairly-indepthRabbitMQ fairly-indepth
RabbitMQ fairly-indepth
Wee Keat Chin
 
An update from the RabbitMQ team - Michael Klishin
An update from the RabbitMQ team - Michael KlishinAn update from the RabbitMQ team - Michael Klishin
An update from the RabbitMQ team - Michael Klishin
RabbitMQ Summit
 
Introduction to AMQP Messaging with RabbitMQ
Introduction to AMQP Messaging with RabbitMQIntroduction to AMQP Messaging with RabbitMQ
Introduction to AMQP Messaging with RabbitMQ
Dmitriy Samovskiy
 
Commication Framework in OpenStack
Commication Framework in OpenStackCommication Framework in OpenStack
Commication Framework in OpenStack
Sean Chang
 
Modern Distributed Messaging and RPC
Modern Distributed Messaging and RPCModern Distributed Messaging and RPC
Modern Distributed Messaging and RPC
Max Alexejev
 
HTTP/2 Server Push
HTTP/2 Server PushHTTP/2 Server Push
HTTP/2 Server Push
Apache Traffic Server
 
HTTP2 and gRPC
HTTP2 and gRPCHTTP2 and gRPC
HTTP2 and gRPC
Guo Jing
 
Snabb Switch: Riding the HPC wave to simpler, better network appliances (FOSD...
Snabb Switch: Riding the HPC wave to simpler, better network appliances (FOSD...Snabb Switch: Riding the HPC wave to simpler, better network appliances (FOSD...
Snabb Switch: Riding the HPC wave to simpler, better network appliances (FOSD...
Igalia
 
RabbitMQ with python and ruby RuPy 2009
RabbitMQ with python and ruby RuPy 2009RabbitMQ with python and ruby RuPy 2009
RabbitMQ with python and ruby RuPy 2009
Paolo Negri
 
Scaling application with RabbitMQ
Scaling application with RabbitMQScaling application with RabbitMQ
Scaling application with RabbitMQ
Nahidul Kibria
 
Netty Notes Part 3 - Channel Pipeline and EventLoops
Netty Notes Part 3 - Channel Pipeline and EventLoopsNetty Notes Part 3 - Channel Pipeline and EventLoops
Netty Notes Part 3 - Channel Pipeline and EventLoops
Rick Hightower
 
Reaching 5 Million Messaging Connections: Our Journey with Kubernetes
Reaching 5 Million Messaging Connections:  Our Journey with KubernetesReaching 5 Million Messaging Connections:  Our Journey with Kubernetes
Reaching 5 Million Messaging Connections: Our Journey with Kubernetes
Connected
 
Messaging Standards and Systems - AMQP & RabbitMQ
Messaging Standards and Systems - AMQP & RabbitMQMessaging Standards and Systems - AMQP & RabbitMQ
Messaging Standards and Systems - AMQP & RabbitMQ
All Things Open
 
Introduction To RabbitMQ
Introduction To RabbitMQIntroduction To RabbitMQ
Introduction To RabbitMQ
Knoldus Inc.
 
VerneMQ - Distributed MQTT Broker
VerneMQ - Distributed MQTT BrokerVerneMQ - Distributed MQTT Broker
VerneMQ - Distributed MQTT Broker
Adriano Pimpini
 
RabbitMQ Model and Some Example Applications
RabbitMQ Model and Some Example ApplicationsRabbitMQ Model and Some Example Applications
RabbitMQ Model and Some Example Applications
Houcheng Lin
 
RabbitMQ fairly-indepth
RabbitMQ fairly-indepthRabbitMQ fairly-indepth
RabbitMQ fairly-indepth
Wee Keat Chin
 
An update from the RabbitMQ team - Michael Klishin
An update from the RabbitMQ team - Michael KlishinAn update from the RabbitMQ team - Michael Klishin
An update from the RabbitMQ team - Michael Klishin
RabbitMQ Summit
 
Introduction to AMQP Messaging with RabbitMQ
Introduction to AMQP Messaging with RabbitMQIntroduction to AMQP Messaging with RabbitMQ
Introduction to AMQP Messaging with RabbitMQ
Dmitriy Samovskiy
 
Commication Framework in OpenStack
Commication Framework in OpenStackCommication Framework in OpenStack
Commication Framework in OpenStack
Sean Chang
 
Modern Distributed Messaging and RPC
Modern Distributed Messaging and RPCModern Distributed Messaging and RPC
Modern Distributed Messaging and RPC
Max Alexejev
 
HTTP2 and gRPC
HTTP2 and gRPCHTTP2 and gRPC
HTTP2 and gRPC
Guo Jing
 
Snabb Switch: Riding the HPC wave to simpler, better network appliances (FOSD...
Snabb Switch: Riding the HPC wave to simpler, better network appliances (FOSD...Snabb Switch: Riding the HPC wave to simpler, better network appliances (FOSD...
Snabb Switch: Riding the HPC wave to simpler, better network appliances (FOSD...
Igalia
 
RabbitMQ with python and ruby RuPy 2009
RabbitMQ with python and ruby RuPy 2009RabbitMQ with python and ruby RuPy 2009
RabbitMQ with python and ruby RuPy 2009
Paolo Negri
 

Viewers also liked (8)

Netflix at-disney-09-26-2014
Netflix at-disney-09-26-2014Netflix at-disney-09-26-2014
Netflix at-disney-09-26-2014
Monal Daxini
 
HTML5 Real Time and WebSocket Code Lab (SFHTML5, GTUGSF)
HTML5 Real Time and WebSocket Code Lab (SFHTML5, GTUGSF)HTML5 Real Time and WebSocket Code Lab (SFHTML5, GTUGSF)
HTML5 Real Time and WebSocket Code Lab (SFHTML5, GTUGSF)
Peter Lubbers
 
JSON-RPC - JSON Remote Procedure Call
JSON-RPC - JSON Remote Procedure CallJSON-RPC - JSON Remote Procedure Call
JSON-RPC - JSON Remote Procedure Call
Peter R. Egli
 
Massively Scalable Applications - TechFerry
Massively Scalable Applications - TechFerryMassively Scalable Applications - TechFerry
Massively Scalable Applications - TechFerry
TechFerry
 
Measuring CDN performance and why you're doing it wrong
Measuring CDN performance and why you're doing it wrongMeasuring CDN performance and why you're doing it wrong
Measuring CDN performance and why you're doing it wrong
Fastly
 
Non blocking io with netty
Non blocking io with nettyNon blocking io with netty
Non blocking io with netty
Zauber
 
Trends in Sensors, Wearable Devices and IoT
Trends in Sensors, Wearable Devices and IoTTrends in Sensors, Wearable Devices and IoT
Trends in Sensors, Wearable Devices and IoT
Walt Maclay
 
REST vs. Messaging For Microservices
REST vs. Messaging For MicroservicesREST vs. Messaging For Microservices
REST vs. Messaging For Microservices
Eberhard Wolff
 
Netflix at-disney-09-26-2014
Netflix at-disney-09-26-2014Netflix at-disney-09-26-2014
Netflix at-disney-09-26-2014
Monal Daxini
 
HTML5 Real Time and WebSocket Code Lab (SFHTML5, GTUGSF)
HTML5 Real Time and WebSocket Code Lab (SFHTML5, GTUGSF)HTML5 Real Time and WebSocket Code Lab (SFHTML5, GTUGSF)
HTML5 Real Time and WebSocket Code Lab (SFHTML5, GTUGSF)
Peter Lubbers
 
JSON-RPC - JSON Remote Procedure Call
JSON-RPC - JSON Remote Procedure CallJSON-RPC - JSON Remote Procedure Call
JSON-RPC - JSON Remote Procedure Call
Peter R. Egli
 
Massively Scalable Applications - TechFerry
Massively Scalable Applications - TechFerryMassively Scalable Applications - TechFerry
Massively Scalable Applications - TechFerry
TechFerry
 
Measuring CDN performance and why you're doing it wrong
Measuring CDN performance and why you're doing it wrongMeasuring CDN performance and why you're doing it wrong
Measuring CDN performance and why you're doing it wrong
Fastly
 
Non blocking io with netty
Non blocking io with nettyNon blocking io with netty
Non blocking io with netty
Zauber
 
Trends in Sensors, Wearable Devices and IoT
Trends in Sensors, Wearable Devices and IoTTrends in Sensors, Wearable Devices and IoT
Trends in Sensors, Wearable Devices and IoT
Walt Maclay
 
REST vs. Messaging For Microservices
REST vs. Messaging For MicroservicesREST vs. Messaging For Microservices
REST vs. Messaging For Microservices
Eberhard Wolff
 
Ad

Similar to Using RabbitMQ and Netty library to implement RPC protocol (20)

Performance tips for Symfony2 & PHP
Performance tips for Symfony2 & PHPPerformance tips for Symfony2 & PHP
Performance tips for Symfony2 & PHP
Max Romanovsky
 
Yet another json rpc library (mole rpc)
Yet another json rpc library (mole rpc)Yet another json rpc library (mole rpc)
Yet another json rpc library (mole rpc)
Viktor Turskyi
 
Node Summit 2016: Web App Architectures
Node Summit 2016:  Web App ArchitecturesNode Summit 2016:  Web App Architectures
Node Summit 2016: Web App Architectures
Chris Bailey
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Alberto González Trastoy
 
Websocket 101 in Python
Websocket 101 in PythonWebsocket 101 in Python
Websocket 101 in Python
Juti Noppornpitak
 
High-speed, Reactive Microservices 2017
High-speed, Reactive Microservices 2017High-speed, Reactive Microservices 2017
High-speed, Reactive Microservices 2017
Rick Hightower
 
Building a web application with ontinuation monads
Building a web application with ontinuation monadsBuilding a web application with ontinuation monads
Building a web application with ontinuation monads
Seitaro Yuuki
 
Cytoscape CI Chapter 2
Cytoscape CI Chapter 2Cytoscape CI Chapter 2
Cytoscape CI Chapter 2
bdemchak
 
FreeSWITCH as a Microservice
FreeSWITCH as a MicroserviceFreeSWITCH as a Microservice
FreeSWITCH as a Microservice
Evan McGee
 
Massaging the Pony: Message Queues and You
Massaging the Pony: Message Queues and YouMassaging the Pony: Message Queues and You
Massaging the Pony: Message Queues and You
Shawn Rider
 
Isomorphic JavaScript with Nashorn
Isomorphic JavaScript with NashornIsomorphic JavaScript with Nashorn
Isomorphic JavaScript with Nashorn
Maxime Najim
 
High-Speed Reactive Microservices - trials and tribulations
High-Speed Reactive Microservices - trials and tribulationsHigh-Speed Reactive Microservices - trials and tribulations
High-Speed Reactive Microservices - trials and tribulations
Rick Hightower
 
Cosenza_MuleSoft_Meetup_1st.pptx
Cosenza_MuleSoft_Meetup_1st.pptxCosenza_MuleSoft_Meetup_1st.pptx
Cosenza_MuleSoft_Meetup_1st.pptx
AndreaCapolei2
 
How do async ap is survive in a rest world
How do async ap is survive in a rest world How do async ap is survive in a rest world
How do async ap is survive in a rest world
Red Hat
 
Are REST APIs Still Relevant Today?
Are REST APIs Still Relevant Today?Are REST APIs Still Relevant Today?
Are REST APIs Still Relevant Today?
Nordic APIs
 
Austin API Summit 2018: Are REST APIs Still Relevant Today?
Austin API Summit 2018: Are REST APIs Still Relevant Today?Austin API Summit 2018: Are REST APIs Still Relevant Today?
Austin API Summit 2018: Are REST APIs Still Relevant Today?
LaunchAny
 
A vision for ejabberd - ejabberd SF Meetup
A vision for ejabberd - ejabberd SF MeetupA vision for ejabberd - ejabberd SF Meetup
A vision for ejabberd - ejabberd SF Meetup
Mickaël Rémond
 
How Browser and server works
How Browser and server worksHow Browser and server works
How Browser and server works
Web Developer
 
apidays LIVE Helsinki - Implementing OpenAPI and GraphQL Services with gRPC b...
apidays LIVE Helsinki - Implementing OpenAPI and GraphQL Services with gRPC b...apidays LIVE Helsinki - Implementing OpenAPI and GraphQL Services with gRPC b...
apidays LIVE Helsinki - Implementing OpenAPI and GraphQL Services with gRPC b...
apidays
 
Microservices summit talk 1/31
Microservices summit talk   1/31Microservices summit talk   1/31
Microservices summit talk 1/31
Varun Talwar
 
Performance tips for Symfony2 & PHP
Performance tips for Symfony2 & PHPPerformance tips for Symfony2 & PHP
Performance tips for Symfony2 & PHP
Max Romanovsky
 
Yet another json rpc library (mole rpc)
Yet another json rpc library (mole rpc)Yet another json rpc library (mole rpc)
Yet another json rpc library (mole rpc)
Viktor Turskyi
 
Node Summit 2016: Web App Architectures
Node Summit 2016:  Web App ArchitecturesNode Summit 2016:  Web App Architectures
Node Summit 2016: Web App Architectures
Chris Bailey
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Alberto González Trastoy
 
High-speed, Reactive Microservices 2017
High-speed, Reactive Microservices 2017High-speed, Reactive Microservices 2017
High-speed, Reactive Microservices 2017
Rick Hightower
 
Building a web application with ontinuation monads
Building a web application with ontinuation monadsBuilding a web application with ontinuation monads
Building a web application with ontinuation monads
Seitaro Yuuki
 
Cytoscape CI Chapter 2
Cytoscape CI Chapter 2Cytoscape CI Chapter 2
Cytoscape CI Chapter 2
bdemchak
 
FreeSWITCH as a Microservice
FreeSWITCH as a MicroserviceFreeSWITCH as a Microservice
FreeSWITCH as a Microservice
Evan McGee
 
Massaging the Pony: Message Queues and You
Massaging the Pony: Message Queues and YouMassaging the Pony: Message Queues and You
Massaging the Pony: Message Queues and You
Shawn Rider
 
Isomorphic JavaScript with Nashorn
Isomorphic JavaScript with NashornIsomorphic JavaScript with Nashorn
Isomorphic JavaScript with Nashorn
Maxime Najim
 
High-Speed Reactive Microservices - trials and tribulations
High-Speed Reactive Microservices - trials and tribulationsHigh-Speed Reactive Microservices - trials and tribulations
High-Speed Reactive Microservices - trials and tribulations
Rick Hightower
 
Cosenza_MuleSoft_Meetup_1st.pptx
Cosenza_MuleSoft_Meetup_1st.pptxCosenza_MuleSoft_Meetup_1st.pptx
Cosenza_MuleSoft_Meetup_1st.pptx
AndreaCapolei2
 
How do async ap is survive in a rest world
How do async ap is survive in a rest world How do async ap is survive in a rest world
How do async ap is survive in a rest world
Red Hat
 
Are REST APIs Still Relevant Today?
Are REST APIs Still Relevant Today?Are REST APIs Still Relevant Today?
Are REST APIs Still Relevant Today?
Nordic APIs
 
Austin API Summit 2018: Are REST APIs Still Relevant Today?
Austin API Summit 2018: Are REST APIs Still Relevant Today?Austin API Summit 2018: Are REST APIs Still Relevant Today?
Austin API Summit 2018: Are REST APIs Still Relevant Today?
LaunchAny
 
A vision for ejabberd - ejabberd SF Meetup
A vision for ejabberd - ejabberd SF MeetupA vision for ejabberd - ejabberd SF Meetup
A vision for ejabberd - ejabberd SF Meetup
Mickaël Rémond
 
How Browser and server works
How Browser and server worksHow Browser and server works
How Browser and server works
Web Developer
 
apidays LIVE Helsinki - Implementing OpenAPI and GraphQL Services with gRPC b...
apidays LIVE Helsinki - Implementing OpenAPI and GraphQL Services with gRPC b...apidays LIVE Helsinki - Implementing OpenAPI and GraphQL Services with gRPC b...
apidays LIVE Helsinki - Implementing OpenAPI and GraphQL Services with gRPC b...
apidays
 
Microservices summit talk 1/31
Microservices summit talk   1/31Microservices summit talk   1/31
Microservices summit talk 1/31
Varun Talwar
 
Ad

Recently uploaded (20)

Interactive odoo dashboards for sales, CRM , Inventory, Invoice, Purchase, Pr...
Interactive odoo dashboards for sales, CRM , Inventory, Invoice, Purchase, Pr...Interactive odoo dashboards for sales, CRM , Inventory, Invoice, Purchase, Pr...
Interactive odoo dashboards for sales, CRM , Inventory, Invoice, Purchase, Pr...
AxisTechnolabs
 
PRTG Network Monitor Crack Latest Version & Serial Key 2025 [100% Working]
PRTG Network Monitor Crack Latest Version & Serial Key 2025 [100% Working]PRTG Network Monitor Crack Latest Version & Serial Key 2025 [100% Working]
PRTG Network Monitor Crack Latest Version & Serial Key 2025 [100% Working]
saimabibi60507
 
WinRAR Crack for Windows (100% Working 2025)
WinRAR Crack for Windows (100% Working 2025)WinRAR Crack for Windows (100% Working 2025)
WinRAR Crack for Windows (100% Working 2025)
sh607827
 
Why Tapitag Ranks Among the Best Digital Business Card Providers
Why Tapitag Ranks Among the Best Digital Business Card ProvidersWhy Tapitag Ranks Among the Best Digital Business Card Providers
Why Tapitag Ranks Among the Best Digital Business Card Providers
Tapitag
 
Change Management Models and Tools for Organizational Transformation
Change Management Models and Tools for Organizational TransformationChange Management Models and Tools for Organizational Transformation
Change Management Models and Tools for Organizational Transformation
EHA Soft Solutions
 
Top Magento Hyvä Theme Features That Make It Ideal for E-commerce.pdf
Top Magento Hyvä Theme Features That Make It Ideal for E-commerce.pdfTop Magento Hyvä Theme Features That Make It Ideal for E-commerce.pdf
Top Magento Hyvä Theme Features That Make It Ideal for E-commerce.pdf
evrigsolution
 
Streamline Your Manufacturing Data. Strengthen Every Operation.
Streamline Your Manufacturing Data. Strengthen Every Operation.Streamline Your Manufacturing Data. Strengthen Every Operation.
Streamline Your Manufacturing Data. Strengthen Every Operation.
Aparavi
 
Automation Techniques in RPA - UiPath Certificate
Automation Techniques in RPA - UiPath CertificateAutomation Techniques in RPA - UiPath Certificate
Automation Techniques in RPA - UiPath Certificate
VICTOR MAESTRE RAMIREZ
 
From Vibe Coding to Vibe Testing - Complete PowerPoint Presentation
From Vibe Coding to Vibe Testing - Complete PowerPoint PresentationFrom Vibe Coding to Vibe Testing - Complete PowerPoint Presentation
From Vibe Coding to Vibe Testing - Complete PowerPoint Presentation
Shay Ginsbourg
 
How to avoid IT Asset Management mistakes during implementation_PDF.pdf
How to avoid IT Asset Management mistakes during implementation_PDF.pdfHow to avoid IT Asset Management mistakes during implementation_PDF.pdf
How to avoid IT Asset Management mistakes during implementation_PDF.pdf
victordsane
 
Effortless SMS Blasts from Salesforce with Message Blink — No Tab Switching!
Effortless SMS Blasts from Salesforce with Message Blink — No Tab Switching!Effortless SMS Blasts from Salesforce with Message Blink — No Tab Switching!
Effortless SMS Blasts from Salesforce with Message Blink — No Tab Switching!
Message Blink
 
Protect HPE VM Essentials using Veeam Agents-a50012338enw.pdf
Protect HPE VM Essentials using Veeam Agents-a50012338enw.pdfProtect HPE VM Essentials using Veeam Agents-a50012338enw.pdf
Protect HPE VM Essentials using Veeam Agents-a50012338enw.pdf
株式会社クライム
 
How can one start with crypto wallet development.pptx
How can one start with crypto wallet development.pptxHow can one start with crypto wallet development.pptx
How can one start with crypto wallet development.pptx
laravinson24
 
Surviving a Downturn Making Smarter Portfolio Decisions with OnePlan - Webina...
Surviving a Downturn Making Smarter Portfolio Decisions with OnePlan - Webina...Surviving a Downturn Making Smarter Portfolio Decisions with OnePlan - Webina...
Surviving a Downturn Making Smarter Portfolio Decisions with OnePlan - Webina...
OnePlan Solutions
 
Creating Automated Tests with AI - Cory House - Applitools.pdf
Creating Automated Tests with AI - Cory House - Applitools.pdfCreating Automated Tests with AI - Cory House - Applitools.pdf
Creating Automated Tests with AI - Cory House - Applitools.pdf
Applitools
 
Autodesk Inventor Crack (2025) Latest
Autodesk Inventor    Crack (2025) LatestAutodesk Inventor    Crack (2025) Latest
Autodesk Inventor Crack (2025) Latest
Google
 
AI in Business Software: Smarter Systems or Hidden Risks?
AI in Business Software: Smarter Systems or Hidden Risks?AI in Business Software: Smarter Systems or Hidden Risks?
AI in Business Software: Smarter Systems or Hidden Risks?
Amara Nielson
 
Best Accounting Practice Management Software Guide for 2025
Best Accounting Practice Management Software Guide for 2025Best Accounting Practice Management Software Guide for 2025
Best Accounting Practice Management Software Guide for 2025
Tidyflow
 
AEM User Group DACH - 2025 Inaugural Meeting
AEM User Group DACH - 2025 Inaugural MeetingAEM User Group DACH - 2025 Inaugural Meeting
AEM User Group DACH - 2025 Inaugural Meeting
jennaf3
 
Navigating EAA Compliance in Testing.pdf
Navigating EAA Compliance in Testing.pdfNavigating EAA Compliance in Testing.pdf
Navigating EAA Compliance in Testing.pdf
Applitools
 
Interactive odoo dashboards for sales, CRM , Inventory, Invoice, Purchase, Pr...
Interactive odoo dashboards for sales, CRM , Inventory, Invoice, Purchase, Pr...Interactive odoo dashboards for sales, CRM , Inventory, Invoice, Purchase, Pr...
Interactive odoo dashboards for sales, CRM , Inventory, Invoice, Purchase, Pr...
AxisTechnolabs
 
PRTG Network Monitor Crack Latest Version & Serial Key 2025 [100% Working]
PRTG Network Monitor Crack Latest Version & Serial Key 2025 [100% Working]PRTG Network Monitor Crack Latest Version & Serial Key 2025 [100% Working]
PRTG Network Monitor Crack Latest Version & Serial Key 2025 [100% Working]
saimabibi60507
 
WinRAR Crack for Windows (100% Working 2025)
WinRAR Crack for Windows (100% Working 2025)WinRAR Crack for Windows (100% Working 2025)
WinRAR Crack for Windows (100% Working 2025)
sh607827
 
Why Tapitag Ranks Among the Best Digital Business Card Providers
Why Tapitag Ranks Among the Best Digital Business Card ProvidersWhy Tapitag Ranks Among the Best Digital Business Card Providers
Why Tapitag Ranks Among the Best Digital Business Card Providers
Tapitag
 
Change Management Models and Tools for Organizational Transformation
Change Management Models and Tools for Organizational TransformationChange Management Models and Tools for Organizational Transformation
Change Management Models and Tools for Organizational Transformation
EHA Soft Solutions
 
Top Magento Hyvä Theme Features That Make It Ideal for E-commerce.pdf
Top Magento Hyvä Theme Features That Make It Ideal for E-commerce.pdfTop Magento Hyvä Theme Features That Make It Ideal for E-commerce.pdf
Top Magento Hyvä Theme Features That Make It Ideal for E-commerce.pdf
evrigsolution
 
Streamline Your Manufacturing Data. Strengthen Every Operation.
Streamline Your Manufacturing Data. Strengthen Every Operation.Streamline Your Manufacturing Data. Strengthen Every Operation.
Streamline Your Manufacturing Data. Strengthen Every Operation.
Aparavi
 
Automation Techniques in RPA - UiPath Certificate
Automation Techniques in RPA - UiPath CertificateAutomation Techniques in RPA - UiPath Certificate
Automation Techniques in RPA - UiPath Certificate
VICTOR MAESTRE RAMIREZ
 
From Vibe Coding to Vibe Testing - Complete PowerPoint Presentation
From Vibe Coding to Vibe Testing - Complete PowerPoint PresentationFrom Vibe Coding to Vibe Testing - Complete PowerPoint Presentation
From Vibe Coding to Vibe Testing - Complete PowerPoint Presentation
Shay Ginsbourg
 
How to avoid IT Asset Management mistakes during implementation_PDF.pdf
How to avoid IT Asset Management mistakes during implementation_PDF.pdfHow to avoid IT Asset Management mistakes during implementation_PDF.pdf
How to avoid IT Asset Management mistakes during implementation_PDF.pdf
victordsane
 
Effortless SMS Blasts from Salesforce with Message Blink — No Tab Switching!
Effortless SMS Blasts from Salesforce with Message Blink — No Tab Switching!Effortless SMS Blasts from Salesforce with Message Blink — No Tab Switching!
Effortless SMS Blasts from Salesforce with Message Blink — No Tab Switching!
Message Blink
 
Protect HPE VM Essentials using Veeam Agents-a50012338enw.pdf
Protect HPE VM Essentials using Veeam Agents-a50012338enw.pdfProtect HPE VM Essentials using Veeam Agents-a50012338enw.pdf
Protect HPE VM Essentials using Veeam Agents-a50012338enw.pdf
株式会社クライム
 
How can one start with crypto wallet development.pptx
How can one start with crypto wallet development.pptxHow can one start with crypto wallet development.pptx
How can one start with crypto wallet development.pptx
laravinson24
 
Surviving a Downturn Making Smarter Portfolio Decisions with OnePlan - Webina...
Surviving a Downturn Making Smarter Portfolio Decisions with OnePlan - Webina...Surviving a Downturn Making Smarter Portfolio Decisions with OnePlan - Webina...
Surviving a Downturn Making Smarter Portfolio Decisions with OnePlan - Webina...
OnePlan Solutions
 
Creating Automated Tests with AI - Cory House - Applitools.pdf
Creating Automated Tests with AI - Cory House - Applitools.pdfCreating Automated Tests with AI - Cory House - Applitools.pdf
Creating Automated Tests with AI - Cory House - Applitools.pdf
Applitools
 
Autodesk Inventor Crack (2025) Latest
Autodesk Inventor    Crack (2025) LatestAutodesk Inventor    Crack (2025) Latest
Autodesk Inventor Crack (2025) Latest
Google
 
AI in Business Software: Smarter Systems or Hidden Risks?
AI in Business Software: Smarter Systems or Hidden Risks?AI in Business Software: Smarter Systems or Hidden Risks?
AI in Business Software: Smarter Systems or Hidden Risks?
Amara Nielson
 
Best Accounting Practice Management Software Guide for 2025
Best Accounting Practice Management Software Guide for 2025Best Accounting Practice Management Software Guide for 2025
Best Accounting Practice Management Software Guide for 2025
Tidyflow
 
AEM User Group DACH - 2025 Inaugural Meeting
AEM User Group DACH - 2025 Inaugural MeetingAEM User Group DACH - 2025 Inaugural Meeting
AEM User Group DACH - 2025 Inaugural Meeting
jennaf3
 
Navigating EAA Compliance in Testing.pdf
Navigating EAA Compliance in Testing.pdfNavigating EAA Compliance in Testing.pdf
Navigating EAA Compliance in Testing.pdf
Applitools
 

Using RabbitMQ and Netty library to implement RPC protocol

  • 1. Tho Luong SILILAB Vietnam Hanoi, March 1, 2014 Rubichat
  • 2. Introduction 2  Rubichat:  A Realtime Communication Service  Allow website owner to communicate with customer more easily
  • 3. Rubichat: customer & operator 3
  • 4. Introduction 4  Rubichat:  A Realtime Communication Service  Allow website owner to communicate with customer more easily  Easy to setup:
  • 5. Architecture X user Facebook user Customer and operator X1 X2 crane crane RabbitMQ tractor tractor Java, php, spring, hibernate, amqp, nodejs, zend framework, netty sensor Apache ? MySQL, Redis and MongoDB
  • 6. Issue 6  Develop rubiweb project in PHP using Zend Framework  Some services were implemented in Java (30%)  Should we implement other services in Java or PHP or both of them?  3 solutions
  • 7. Solution #1 7  Reimplement all services in PHP  Some services will be implemented in both Java and PHP  not a big problem  PHP and Zend work well with MySQL, do they still work well with MongoDB and Redis?  Just some services use MongoDB and Redis  not a big problem
  • 8. Solution #1 8  When Java wants to use a service that is implemented in PHP  port this implementation to Java?  Some services are hard to implement, ex: access control service Solution #1: complicated and not easy for maintainance.
  • 9. Solution #2 9  Beauty and maintainability are #1 priority  All services will be implemented in Java  PHP calls Java service implementations remotely via RabbitMQ e2 PHP Java e1 req resp OK
  • 10. Solution #2 10  Problem: how to receive response properly? PHP -01 PHP-02 Resp-01 Resp-02  Mission impossible
  • 11. Solution #2 11  How about using one queue for each PHP request? PHP-01 PHP-02 ….. ….. e PHP-n  At least, one “dirty” queue is produced after each PHP request lifecycle No, RabbitMQ must manage a lot of queues.
  • 12. Solution #3 12  RPC: PHP invokes Java API remotely PHP Java Server X protocol  Issues: 1. System architecture 2. Protocol selection Flappy 3. Technology selections for Java Server
  • 13. System architecture 13  Option 1: flappy accesses database directly PHP Java Server X protocol Flappy MySQ L Mong oDB Redis  Option 2: flappy serves PHP connections, access service implentations via RabbitMQ PHP Java Server Flappy RabbitMQ MySQ L Mong oDB Redis Tractor Tractor ….. …..
  • 14. Protocol selection 14  Common RPC protocols  XML RPC  JSON RPC  Protobuf (google)  Thrift (facebook)  SOAP  Flappy uses XMPP (RFC 3920,RFC 3921) message format  Easy to control  Familiar to Rubichat developers
  • 15. XMPP in JSON format 15  Stanza: IQ  Stanza: M
  • 16. Binary data format 16  Data type: 1 byte  RABBIT_TRACTOR_IN, RABBIT_TRACTOR_OUT, FLAPPY_IN, FLAPPY_OUT, NA  Length: int: 4 byte  Body type length body 1 4 length
  • 17. Technologies selection 17  Socket library: Netty, a great library for network application  Twitter uses Netty to improve search engine performance. (3x faster)  Interceptor design in Tractor server is influenced by Netty
  • 18. Netty advantages 18  Asynchronous I/O: decouple threads from Client Socket Connections  Rich Buffer data structure  Advanced Components for More Rapid Development  Event Model based on the Interceptor Chain Pattern
  • 19. Test result 19  Create 100 users, find them and measure time: Service Query Tractor(ms) Client (ms) Δ (ms) Create 100 5196 5665 469 Find 1 187 203 16 Service Query Tractor(ms) Client (ms) Δ (ms) Create 100 4414 Find 1 34 (New FlappyClient implementation: use single connection(March 26, 2014))
  • 20. 20 Demo: 1. Flappy Server 2. Tractor
  • 21. Solution disadvantages 21 response PHP Java Server Flappy .phpModel ToJSON() request .jsonTo PhpModel() .jsonTo JavaModel() .javaModel ToJSON()  Write data-mappers manually
  • 22. Future work 22  Tool for generating data mappers  Optimize PHP FlappyClient and develop clients for other languages