SlideShare ist ein Scribd-Unternehmen logo
1 von 55
Downloaden Sie, um offline zu lesen
KNOTX.io
When Vert.x & RxJava meet
highly-efficient and scalable integration approach
for modern platforms
Maciej Laskowski
Tomasz Michalak
KNOTX.io
300 pageviews / second
Page available in less than 3 seconds
KNOTX.io
KNOTX.io
KNOTX.io
Ready?
> 300 views / s
< 0.05 s
KNOTX.io
Challenge
- The client is one of the biggest
perfume and cosmetics
retailer in Europe.
- Its sales concentrate on an
online platform.
- The client needs to connect
several incompatible systems.
KNOTX.io
Challenge
KNOTX.io
Traditional approach
KNOTX.io
Client-side approach
KNOTX.io
Nope!
KNOTX.io
Modern approach
● Scalable
● Transparent
● Reusable
● Each component
easy to replace
KNOTX.ioKNOTX.io
TEAMWORK
KNOTX.io
Modern approach
KNOTX.io
HACKATHON
OPEN SOURCE
KNOTX.io
Integration layer == Knot.x
KNOTX.io
Knot.x features: Data ingestion
<script
data-knotx-knots="services,handlebars"
data-knotx-service="welcome"
type="text/knotx-snippet">
<h1>{{message}}</h1>
<div>
<div>Message type - {{body.type}}</div>
<div>Statistics: {{statistics}}</div>
</div>
</script>
CMS
KNOTX.io
Knot.x features: Data ingestion
{
"message": "Hello from Knot.x!",
"body": {
"type": "greeting",
"priority": "1"
},
"statistics": 20
}
<script
data-knotx-knots="services,handlebars"
data-knotx-service="welcome"
type="text/knotx-snippet">
<h1>{{message}}</h1>
<div>
<div>Message type - {{body.type}}</div>
<div>Statistics: {{statistics}}</div>
</div>
</script>
CMS
Service
KNOTX.io
Knot.x features: Data ingestion
<h1>Hello from Knot.x!</h1>
<div>
<div>Message type - greeting</div>
<div>Statistics: 20</div>
</div>
{
"message": "Hello from Knot.x!",
"body": {
"type": "greeting",
"priority": "1"
},
"statistics": 20
}
<script
data-knotx-knots="services,handlebars"
data-knotx-service="welcome"
type="text/knotx-snippet">
<h1>{{message}}</h1>
<div>
<div>Message type - {{body.type}}</div>
<div>Statistics: {{statistics}}</div>
</div>
</script>
CMS
Service
Final page
KNOTX.io
Knot.x features: forms
Knot.x supports simple and multi-step
forms. Easily handles submission
errors, form validations and redirects.
Knot.x allows you to define a graph of
interconnected steps, responding to
user input or site visitor choices.
KNOTX.io
Knot.x features: prototyping
Knot.x gives you the ability to use
simple Mocks. This allows you to
expose your sample data directly to
pages even if the real service is not
available yet, and switch to the real
service without any further
development work.
KNOTX.io
Knot.x features: extensions
Knot.x is a fully modular platform with
very flexible extension points that we
call Knots and Adapters that
efficiently communicates with Knot.x
Core using event bus. Thanks to the
polyglot nature of Vert.x you can
implement extensions in languages
other than Java.
KNOTX.io
is
an event-driven, non-blocking, polyglot
application framework
that runs on the Java Virtual Machine
KNOTX.io
Actor-like modules in Vert.x
VerticleHandlers
HTTP?
KNOTX.io
Vert.x Event Bus
Machine
KNOTX.io
Vert.x Event Bus
heavy
load
KNOTX.io
Vert.x Event Bus
KNOTX.io
Vert.x Event Bus
Machine 2Machine 1
KNOTX.io
Knot.x Architecture
- CMS (Repository) responds
with HTML markup.
- REST services respond with
JSON.
Knot.x Core
Modules
KNOTX.io
Knot.x Architecture
KNOTX.io
Performance
What’s ?
- message
- notification,
- HTTP request
- command/instruction
- file
- result
- error
KNOTX.io
Handlers
void operation(param1, param2,
Handler< > handler) {
// …
handler.handle( );
// …
}
void handle( ) {
// do something with
}
Event Loop
The Golden Rule: don’t block the Event Loop
KNOTX.io
Multi-thread
KNOTX.io
Personalized Search
KNOTX.io
Personalized Search (Vert.x Callbacks)
public class RequestHandler implements Handler<HttpServerRequest> {
@Override
public void handle(HttpServerRequest request) {
vertx.eventBus().send("user-tracking", userId, reply1 -> {
String userTrackingData = (String) reply1.result().body();
});
}
}
KNOTX.io
Personalized Search (Vert.x Callbacks)
public class RequestHandler implements Handler<HttpServerRequest> {
@Override
public void handle(HttpServerRequest request) {
vertx.eventBus().send("user-tracking", userId, reply1 -> {
String userTrackingData = (String) reply1.result().body();
vertx.eventBus().send("search-engine", query, reply2 -> {
String searchEngineData = (String) reply2.result().body();
});
});
}
}
KNOTX.io
Personalized Search (Vert.x Callbacks)
public class RequestHandler implements Handler<HttpServerRequest> {
@Override
public void handle(HttpServerRequest request) {
vertx.eventBus().send("user-tracking", userId, reply1 -> {
String userTrackingData = (String) reply1.result().body();
vertx.eventBus().send("search-engine", query, reply2 -> {
String searchEngineData = (String) reply2.result().body();
String combinedData = userTrackingData + "-" + searchEngineData;
vertx.eventBus().send("personalize", combinedData, reply3 -> {
request.response().end("Personalized results are: " + reply3.result().body());
});
});
});
}
}
KNOTX.io
Personalized Search (Vert.x Callbacks)
KNOTX.io
Personalized Search (Vert.x Callbacks)
KNOTX.io
Personalized Search (Vert.x Callbacks)
KNOTX.io
Callback Hell
public class RequestHandler implements Handler<HttpServerRequest> {
@Override
public void handle(HttpServerRequest request) {
vertx.eventBus().send("user-tracking", userId, reply1 -> {
String userTrackingData = (String) reply1.result().body();
vertx.eventBus().send("search-engine", query, reply2 -> {
String searchEngineData = (String) reply2.result().body();
String combinedData = userTrackingData + "-" + searchEngineData;
vertx.eventBus().send("personalize", combinedData, reply3 -> {
request.response().end("Personalized results are: " + reply3.result().body());
});
});
});
}
}
KNOTX.io
KNOTX.io
RxJava - Observable
source: http://reactivex.io/intro.html
KNOTX.io
RxJava
Observable.subscribe(
onNext( ),
onError( ),
onCompleted()
);
X
Data stream #1:
Data stream #2: X
|
|
Each form the stream goes here.
Whenever any error happens, it triggers
onError and finishes processing.
X
When all were processed (no more
events: ), this is triggered|
KNOTX.io
RxJava
Observable.subscribe(
onNext( ),
onError( ),
onCompleted()
);
Data stream #1: |
x3
x1
KNOTX.io
RxJava
Observable.subscribe(
onNext( ),
onError( ),
onCompleted()
);
X
Data stream #2:
X |
x2
x1
KNOTX.io
Personalized Search (RxJava)
public class RequestHandler implements Handler<HttpServerRequest> {
@Override
public void handle(HttpServerRequest request) {
Observable<Message<String>> reply1 = vertx.eventBus()
.sendObservable("user-tracking", userId);
Observable<Message<String>> reply2 = vertx.eventBus()
.sendObservable("search-engine", query);
}
}
KNOTX.io
Personalized Search (RxJava)
public class RequestHandler implements Handler<HttpServerRequest> {
@Override
public void handle(HttpServerRequest request) {
Observable<Message<String>> reply1 = vertx.eventBus()
.sendObservable("user-tracking", userId);
Observable<Message<String>> reply2 = vertx.eventBus()
.sendObservable("search-engine", query);
Observable
.zip(reply1, reply2, (Message resp1, Message resp2) -> resp1.body() + "-" + resp2.body())
.subscribe(combinedData -> vertx.eventBus().sendObservable("personalize", combinedData)
.subscribe(reply3 ->
request.response().end("Personalized results are: " + reply3.body()))
);
}
}
KNOTX.io
Personalized Search (RxJava)
KNOTX.io
RxJava - abstraction over low-level threading
public class RequestHandler implements Handler<HttpServerRequest> {
@Override
public void handle(HttpServerRequest request) {
Observable<Message<String>> reply1 = vertx.eventBus()
.sendObservable("user-tracking", userId);
Observable<Message<String>> reply2 = vertx.eventBus()
.sendObservable("search-engine", query);
Observable
.zip(reply1, reply2, (Message resp1, Message resp2) -> resp1.body() + "-" + resp2.body())
.subscribe(combinedData -> vertx.eventBus().sendObservable("personalize", combinedData)
.subscribe(reply3 ->
request.response().end("Personalized results are: " + reply3.body()))
);
}
}
Nothing happens
here. Just
declarations.
KNOTX.io
RxJava - abstraction over low-level threading
public class RequestHandler implements Handler<HttpServerRequest> {
@Override
public void handle(HttpServerRequest request) {
Observable<Message<String>> reply1 = vertx.eventBus()
.sendObservable("user-tracking", userId);
Observable<Message<String>> reply2 = vertx.eventBus()
.sendObservable("search-engine", query);
Observable
.zip(reply1, reply2, (Message resp1, Message resp2) -> resp1.body() + "-" + resp2.body())
.subscribe(combinedData -> vertx.eventBus().sendObservable("personalize", combinedData)
.subscribe(reply3 ->
request.response().end("Personalized results are: " + reply3.body()))
);
}
}
Nothing happens
here. Just
declarations.
Also, no actions
here until we
subscribe.
KNOTX.io
RxJava - abstraction over low-level threading
public class RequestHandler implements Handler<HttpServerRequest> {
@Override
public void handle(HttpServerRequest request) {
Observable<Message<String>> reply1 = vertx.eventBus()
.sendObservable("user-tracking", userId);
Observable<Message<String>> reply2 = vertx.eventBus()
.sendObservable("search-engine", query);
Observable
.zip(reply1, reply2, (Message resp1, Message resp2) -> resp1.body() + "-" + resp2.body())
.subscribe(combinedData -> vertx.eventBus().sendObservable("personalize", combinedData)
.subscribe(reply3 ->
request.response().end("Personalized results are: " + reply3.body()))
);
}
}
Nothing happens
here. Just
declarations.
Also, no actions
here until we
subscribe.
This subscribe triggers
simultaneous calls to search-engine
and user-tracking.
This subscribe triggers calling
personalized service.
KNOTX.io
RxJava - Marble Diagrams
KNOTX.io
RxJava - Marble Diagrams
KNOTX.io
Live demo
https://goo.gl/lqG76x
KNOTX.io
Thank you
● Tutorials: www.knotx.io
● Sources & Wiki: https://github.com/Cognifide/knotx
● Twitter: @knotx_project
● Gitter / Google Groups
Maciej Laskowski
@skejven
https://github.com/Skejven
Tomasz Michalak
@tomichalak
https://github.com/tomaszmichalak

Weitere ähnliche Inhalte

Was ist angesagt?

Advanced Hibernate V2
Advanced Hibernate V2Advanced Hibernate V2
Advanced Hibernate V2Haitham Raik
 
Cassandra Summit EU 2014 Lightning talk - Paging (no animation)
Cassandra Summit EU 2014 Lightning talk - Paging (no animation)Cassandra Summit EU 2014 Lightning talk - Paging (no animation)
Cassandra Summit EU 2014 Lightning talk - Paging (no animation)Christopher Batey
 
Introduction to Restkit
Introduction to RestkitIntroduction to Restkit
Introduction to Restkitpetertmarks
 
Fault tolerant microservices - LJC Skills Matter 4thNov2014
Fault tolerant microservices - LJC Skills Matter 4thNov2014Fault tolerant microservices - LJC Skills Matter 4thNov2014
Fault tolerant microservices - LJC Skills Matter 4thNov2014Christopher Batey
 
Cassandra Summit EU 2014 - Testing Cassandra Applications
Cassandra Summit EU 2014 - Testing Cassandra ApplicationsCassandra Summit EU 2014 - Testing Cassandra Applications
Cassandra Summit EU 2014 - Testing Cassandra ApplicationsChristopher Batey
 
MicroProfile: uma nova forma de desenvolver aplicações corporativas na era do...
MicroProfile: uma nova forma de desenvolver aplicações corporativas na era do...MicroProfile: uma nova forma de desenvolver aplicações corporativas na era do...
MicroProfile: uma nova forma de desenvolver aplicações corporativas na era do...Otávio Santana
 
Let's build a blockchain.... in 40 minutes!
Let's build a blockchain.... in 40 minutes!Let's build a blockchain.... in 40 minutes!
Let's build a blockchain.... in 40 minutes!Michel Schudel
 
Decentralized access control with anonymous authentication of data stored in ...
Decentralized access control with anonymous authentication of data stored in ...Decentralized access control with anonymous authentication of data stored in ...
Decentralized access control with anonymous authentication of data stored in ...Vasanth Mca
 
Creating a Java EE 7 Websocket Chat Application
Creating a Java EE 7 Websocket Chat ApplicationCreating a Java EE 7 Websocket Chat Application
Creating a Java EE 7 Websocket Chat ApplicationMicha Kops
 
#3 (Multi Threads With TCP)
#3 (Multi Threads With TCP)#3 (Multi Threads With TCP)
#3 (Multi Threads With TCP)Ghadeer AlHasan
 
Слава Бобик «NancyFx для самых маленьких»
Слава Бобик «NancyFx для самых маленьких»Слава Бобик «NancyFx для самых маленьких»
Слава Бобик «NancyFx для самых маленьких»SpbDotNet Community
 
Java Svet - Communication Between Android App Components
Java Svet - Communication Between Android App ComponentsJava Svet - Communication Between Android App Components
Java Svet - Communication Between Android App ComponentsAleksandar Ilić
 
130919 jim cordy - when is a clone not a clone
130919   jim cordy - when is a clone not a clone130919   jim cordy - when is a clone not a clone
130919 jim cordy - when is a clone not a clonePtidej Team
 
Elasticsearch und die Java-Welt
Elasticsearch und die Java-WeltElasticsearch und die Java-Welt
Elasticsearch und die Java-WeltFlorian Hopf
 
Weaving the ILP Fabric into Bigchain DB
Weaving the ILP Fabric into Bigchain DBWeaving the ILP Fabric into Bigchain DB
Weaving the ILP Fabric into Bigchain DBInterledger
 
Bare-knuckle web development
Bare-knuckle web developmentBare-knuckle web development
Bare-knuckle web developmentJohannes Brodwall
 
Cassandra is great but how do I test my application?
Cassandra is great but how do I test my application?Cassandra is great but how do I test my application?
Cassandra is great but how do I test my application?Christopher Batey
 
Work Stealing For Fun & Profit: Jim Nelson
Work Stealing For Fun & Profit: Jim NelsonWork Stealing For Fun & Profit: Jim Nelson
Work Stealing For Fun & Profit: Jim NelsonRedis Labs
 

Was ist angesagt? (18)

Advanced Hibernate V2
Advanced Hibernate V2Advanced Hibernate V2
Advanced Hibernate V2
 
Cassandra Summit EU 2014 Lightning talk - Paging (no animation)
Cassandra Summit EU 2014 Lightning talk - Paging (no animation)Cassandra Summit EU 2014 Lightning talk - Paging (no animation)
Cassandra Summit EU 2014 Lightning talk - Paging (no animation)
 
Introduction to Restkit
Introduction to RestkitIntroduction to Restkit
Introduction to Restkit
 
Fault tolerant microservices - LJC Skills Matter 4thNov2014
Fault tolerant microservices - LJC Skills Matter 4thNov2014Fault tolerant microservices - LJC Skills Matter 4thNov2014
Fault tolerant microservices - LJC Skills Matter 4thNov2014
 
Cassandra Summit EU 2014 - Testing Cassandra Applications
Cassandra Summit EU 2014 - Testing Cassandra ApplicationsCassandra Summit EU 2014 - Testing Cassandra Applications
Cassandra Summit EU 2014 - Testing Cassandra Applications
 
MicroProfile: uma nova forma de desenvolver aplicações corporativas na era do...
MicroProfile: uma nova forma de desenvolver aplicações corporativas na era do...MicroProfile: uma nova forma de desenvolver aplicações corporativas na era do...
MicroProfile: uma nova forma de desenvolver aplicações corporativas na era do...
 
Let's build a blockchain.... in 40 minutes!
Let's build a blockchain.... in 40 minutes!Let's build a blockchain.... in 40 minutes!
Let's build a blockchain.... in 40 minutes!
 
Decentralized access control with anonymous authentication of data stored in ...
Decentralized access control with anonymous authentication of data stored in ...Decentralized access control with anonymous authentication of data stored in ...
Decentralized access control with anonymous authentication of data stored in ...
 
Creating a Java EE 7 Websocket Chat Application
Creating a Java EE 7 Websocket Chat ApplicationCreating a Java EE 7 Websocket Chat Application
Creating a Java EE 7 Websocket Chat Application
 
#3 (Multi Threads With TCP)
#3 (Multi Threads With TCP)#3 (Multi Threads With TCP)
#3 (Multi Threads With TCP)
 
Слава Бобик «NancyFx для самых маленьких»
Слава Бобик «NancyFx для самых маленьких»Слава Бобик «NancyFx для самых маленьких»
Слава Бобик «NancyFx для самых маленьких»
 
Java Svet - Communication Between Android App Components
Java Svet - Communication Between Android App ComponentsJava Svet - Communication Between Android App Components
Java Svet - Communication Between Android App Components
 
130919 jim cordy - when is a clone not a clone
130919   jim cordy - when is a clone not a clone130919   jim cordy - when is a clone not a clone
130919 jim cordy - when is a clone not a clone
 
Elasticsearch und die Java-Welt
Elasticsearch und die Java-WeltElasticsearch und die Java-Welt
Elasticsearch und die Java-Welt
 
Weaving the ILP Fabric into Bigchain DB
Weaving the ILP Fabric into Bigchain DBWeaving the ILP Fabric into Bigchain DB
Weaving the ILP Fabric into Bigchain DB
 
Bare-knuckle web development
Bare-knuckle web developmentBare-knuckle web development
Bare-knuckle web development
 
Cassandra is great but how do I test my application?
Cassandra is great but how do I test my application?Cassandra is great but how do I test my application?
Cassandra is great but how do I test my application?
 
Work Stealing For Fun & Profit: Jim Nelson
Work Stealing For Fun & Profit: Jim NelsonWork Stealing For Fun & Profit: Jim Nelson
Work Stealing For Fun & Profit: Jim Nelson
 

Ähnlich wie Knot.x: when Vert.x and RxJava meet

Customising Your Own Web Framework In Go
Customising Your Own Web Framework In GoCustomising Your Own Web Framework In Go
Customising Your Own Web Framework In GoJonathan Gomez
 
Taming Core Data by Arek Holko, Macoscope
Taming Core Data by Arek Holko, MacoscopeTaming Core Data by Arek Holko, Macoscope
Taming Core Data by Arek Holko, MacoscopeMacoscope
 
Vert.x for Microservices Architecture
Vert.x for Microservices ArchitectureVert.x for Microservices Architecture
Vert.x for Microservices ArchitectureIdan Fridman
 
Meet the squirrel @ #CSHUG
Meet the squirrel @ #CSHUGMeet the squirrel @ #CSHUG
Meet the squirrel @ #CSHUGMárton Balassi
 
Hazelcast and MongoDB at Cloud CMS
Hazelcast and MongoDB at Cloud CMSHazelcast and MongoDB at Cloud CMS
Hazelcast and MongoDB at Cloud CMSuzquiano
 
Ajax tutorial
Ajax tutorialAjax tutorial
Ajax tutorialKat Roque
 
Fun Teaching MongoDB New Tricks
Fun Teaching MongoDB New TricksFun Teaching MongoDB New Tricks
Fun Teaching MongoDB New TricksMongoDB
 
May 2010 - RestEasy
May 2010 - RestEasyMay 2010 - RestEasy
May 2010 - RestEasyJBug Italy
 
Nginx: Accelerate Rails, HTTP Tricks
Nginx: Accelerate Rails, HTTP TricksNginx: Accelerate Rails, HTTP Tricks
Nginx: Accelerate Rails, HTTP TricksAdam Wiggins
 
Developing your first application using FIWARE
Developing your first application using FIWAREDeveloping your first application using FIWARE
Developing your first application using FIWAREFIWARE
 
Cutting Edge Data Processing with PHP & XQuery
Cutting Edge Data Processing with PHP & XQueryCutting Edge Data Processing with PHP & XQuery
Cutting Edge Data Processing with PHP & XQueryWilliam Candillon
 
Do you know what your drupal is doing? Observe it!
Do you know what your drupal is doing? Observe it!Do you know what your drupal is doing? Observe it!
Do you know what your drupal is doing? Observe it!Luca Lusso
 
gRPC on .NET Core - NDC Oslo 2020
gRPC on .NET Core - NDC Oslo 2020gRPC on .NET Core - NDC Oslo 2020
gRPC on .NET Core - NDC Oslo 2020James Newton-King
 
Solving anything in VCL
Solving anything in VCLSolving anything in VCL
Solving anything in VCLFastly
 

Ähnlich wie Knot.x: when Vert.x and RxJava meet (20)

Customising Your Own Web Framework In Go
Customising Your Own Web Framework In GoCustomising Your Own Web Framework In Go
Customising Your Own Web Framework In Go
 
RESTEasy
RESTEasyRESTEasy
RESTEasy
 
Taming Core Data by Arek Holko, Macoscope
Taming Core Data by Arek Holko, MacoscopeTaming Core Data by Arek Holko, Macoscope
Taming Core Data by Arek Holko, Macoscope
 
Vert.x for Microservices Architecture
Vert.x for Microservices ArchitectureVert.x for Microservices Architecture
Vert.x for Microservices Architecture
 
Meet the squirrel @ #CSHUG
Meet the squirrel @ #CSHUGMeet the squirrel @ #CSHUG
Meet the squirrel @ #CSHUG
 
Vertx daitan
Vertx daitanVertx daitan
Vertx daitan
 
Vertx SouJava
Vertx SouJavaVertx SouJava
Vertx SouJava
 
Hazelcast and MongoDB at Cloud CMS
Hazelcast and MongoDB at Cloud CMSHazelcast and MongoDB at Cloud CMS
Hazelcast and MongoDB at Cloud CMS
 
Ajax tutorial
Ajax tutorialAjax tutorial
Ajax tutorial
 
Fun Teaching MongoDB New Tricks
Fun Teaching MongoDB New TricksFun Teaching MongoDB New Tricks
Fun Teaching MongoDB New Tricks
 
Ajax Lecture Notes
Ajax Lecture NotesAjax Lecture Notes
Ajax Lecture Notes
 
May 2010 - RestEasy
May 2010 - RestEasyMay 2010 - RestEasy
May 2010 - RestEasy
 
Vert.x devoxx london 2013
Vert.x devoxx london 2013Vert.x devoxx london 2013
Vert.x devoxx london 2013
 
Nginx: Accelerate Rails, HTTP Tricks
Nginx: Accelerate Rails, HTTP TricksNginx: Accelerate Rails, HTTP Tricks
Nginx: Accelerate Rails, HTTP Tricks
 
Developing your first application using FIWARE
Developing your first application using FIWAREDeveloping your first application using FIWARE
Developing your first application using FIWARE
 
Cutting Edge Data Processing with PHP & XQuery
Cutting Edge Data Processing with PHP & XQueryCutting Edge Data Processing with PHP & XQuery
Cutting Edge Data Processing with PHP & XQuery
 
Socket.io
Socket.ioSocket.io
Socket.io
 
Do you know what your drupal is doing? Observe it!
Do you know what your drupal is doing? Observe it!Do you know what your drupal is doing? Observe it!
Do you know what your drupal is doing? Observe it!
 
gRPC on .NET Core - NDC Oslo 2020
gRPC on .NET Core - NDC Oslo 2020gRPC on .NET Core - NDC Oslo 2020
gRPC on .NET Core - NDC Oslo 2020
 
Solving anything in VCL
Solving anything in VCLSolving anything in VCL
Solving anything in VCL
 

Kürzlich hochgeladen

"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
 
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
 
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
 
What is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfWhat is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfMounikaPolabathina
 
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESSALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESmohitsingh558521
 
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
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
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
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 3652toLead Limited
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxLoriGlavin3
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity PlanDatabarracks
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxLoriGlavin3
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .Alan Dix
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxLoriGlavin3
 
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
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxLoriGlavin3
 

Kürzlich hochgeladen (20)

"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
 
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
 
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.
 
What is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfWhat is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdf
 
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESSALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
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)
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
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
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity Plan
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
 
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
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
 

Knot.x: when Vert.x and RxJava meet

  • 1. KNOTX.io When Vert.x & RxJava meet highly-efficient and scalable integration approach for modern platforms Maciej Laskowski Tomasz Michalak
  • 2. KNOTX.io 300 pageviews / second Page available in less than 3 seconds
  • 6. KNOTX.io Challenge - The client is one of the biggest perfume and cosmetics retailer in Europe. - Its sales concentrate on an online platform. - The client needs to connect several incompatible systems.
  • 11. KNOTX.io Modern approach ● Scalable ● Transparent ● Reusable ● Each component easy to replace
  • 16. KNOTX.io Knot.x features: Data ingestion <script data-knotx-knots="services,handlebars" data-knotx-service="welcome" type="text/knotx-snippet"> <h1>{{message}}</h1> <div> <div>Message type - {{body.type}}</div> <div>Statistics: {{statistics}}</div> </div> </script> CMS
  • 17. KNOTX.io Knot.x features: Data ingestion { "message": "Hello from Knot.x!", "body": { "type": "greeting", "priority": "1" }, "statistics": 20 } <script data-knotx-knots="services,handlebars" data-knotx-service="welcome" type="text/knotx-snippet"> <h1>{{message}}</h1> <div> <div>Message type - {{body.type}}</div> <div>Statistics: {{statistics}}</div> </div> </script> CMS Service
  • 18. KNOTX.io Knot.x features: Data ingestion <h1>Hello from Knot.x!</h1> <div> <div>Message type - greeting</div> <div>Statistics: 20</div> </div> { "message": "Hello from Knot.x!", "body": { "type": "greeting", "priority": "1" }, "statistics": 20 } <script data-knotx-knots="services,handlebars" data-knotx-service="welcome" type="text/knotx-snippet"> <h1>{{message}}</h1> <div> <div>Message type - {{body.type}}</div> <div>Statistics: {{statistics}}</div> </div> </script> CMS Service Final page
  • 19. KNOTX.io Knot.x features: forms Knot.x supports simple and multi-step forms. Easily handles submission errors, form validations and redirects. Knot.x allows you to define a graph of interconnected steps, responding to user input or site visitor choices.
  • 20. KNOTX.io Knot.x features: prototyping Knot.x gives you the ability to use simple Mocks. This allows you to expose your sample data directly to pages even if the real service is not available yet, and switch to the real service without any further development work.
  • 21. KNOTX.io Knot.x features: extensions Knot.x is a fully modular platform with very flexible extension points that we call Knots and Adapters that efficiently communicates with Knot.x Core using event bus. Thanks to the polyglot nature of Vert.x you can implement extensions in languages other than Java.
  • 22. KNOTX.io is an event-driven, non-blocking, polyglot application framework that runs on the Java Virtual Machine
  • 23. KNOTX.io Actor-like modules in Vert.x VerticleHandlers HTTP?
  • 28. KNOTX.io Knot.x Architecture - CMS (Repository) responds with HTML markup. - REST services respond with JSON. Knot.x Core Modules
  • 30. KNOTX.io Performance What’s ? - message - notification, - HTTP request - command/instruction - file - result - error
  • 31. KNOTX.io Handlers void operation(param1, param2, Handler< > handler) { // … handler.handle( ); // … } void handle( ) { // do something with } Event Loop The Golden Rule: don’t block the Event Loop
  • 34. KNOTX.io Personalized Search (Vert.x Callbacks) public class RequestHandler implements Handler<HttpServerRequest> { @Override public void handle(HttpServerRequest request) { vertx.eventBus().send("user-tracking", userId, reply1 -> { String userTrackingData = (String) reply1.result().body(); }); } }
  • 35. KNOTX.io Personalized Search (Vert.x Callbacks) public class RequestHandler implements Handler<HttpServerRequest> { @Override public void handle(HttpServerRequest request) { vertx.eventBus().send("user-tracking", userId, reply1 -> { String userTrackingData = (String) reply1.result().body(); vertx.eventBus().send("search-engine", query, reply2 -> { String searchEngineData = (String) reply2.result().body(); }); }); } }
  • 36. KNOTX.io Personalized Search (Vert.x Callbacks) public class RequestHandler implements Handler<HttpServerRequest> { @Override public void handle(HttpServerRequest request) { vertx.eventBus().send("user-tracking", userId, reply1 -> { String userTrackingData = (String) reply1.result().body(); vertx.eventBus().send("search-engine", query, reply2 -> { String searchEngineData = (String) reply2.result().body(); String combinedData = userTrackingData + "-" + searchEngineData; vertx.eventBus().send("personalize", combinedData, reply3 -> { request.response().end("Personalized results are: " + reply3.result().body()); }); }); }); } }
  • 40. KNOTX.io Callback Hell public class RequestHandler implements Handler<HttpServerRequest> { @Override public void handle(HttpServerRequest request) { vertx.eventBus().send("user-tracking", userId, reply1 -> { String userTrackingData = (String) reply1.result().body(); vertx.eventBus().send("search-engine", query, reply2 -> { String searchEngineData = (String) reply2.result().body(); String combinedData = userTrackingData + "-" + searchEngineData; vertx.eventBus().send("personalize", combinedData, reply3 -> { request.response().end("Personalized results are: " + reply3.result().body()); }); }); }); } }
  • 42. KNOTX.io RxJava - Observable source: http://reactivex.io/intro.html
  • 43. KNOTX.io RxJava Observable.subscribe( onNext( ), onError( ), onCompleted() ); X Data stream #1: Data stream #2: X | | Each form the stream goes here. Whenever any error happens, it triggers onError and finishes processing. X When all were processed (no more events: ), this is triggered|
  • 46. KNOTX.io Personalized Search (RxJava) public class RequestHandler implements Handler<HttpServerRequest> { @Override public void handle(HttpServerRequest request) { Observable<Message<String>> reply1 = vertx.eventBus() .sendObservable("user-tracking", userId); Observable<Message<String>> reply2 = vertx.eventBus() .sendObservable("search-engine", query); } }
  • 47. KNOTX.io Personalized Search (RxJava) public class RequestHandler implements Handler<HttpServerRequest> { @Override public void handle(HttpServerRequest request) { Observable<Message<String>> reply1 = vertx.eventBus() .sendObservable("user-tracking", userId); Observable<Message<String>> reply2 = vertx.eventBus() .sendObservable("search-engine", query); Observable .zip(reply1, reply2, (Message resp1, Message resp2) -> resp1.body() + "-" + resp2.body()) .subscribe(combinedData -> vertx.eventBus().sendObservable("personalize", combinedData) .subscribe(reply3 -> request.response().end("Personalized results are: " + reply3.body())) ); } }
  • 49. KNOTX.io RxJava - abstraction over low-level threading public class RequestHandler implements Handler<HttpServerRequest> { @Override public void handle(HttpServerRequest request) { Observable<Message<String>> reply1 = vertx.eventBus() .sendObservable("user-tracking", userId); Observable<Message<String>> reply2 = vertx.eventBus() .sendObservable("search-engine", query); Observable .zip(reply1, reply2, (Message resp1, Message resp2) -> resp1.body() + "-" + resp2.body()) .subscribe(combinedData -> vertx.eventBus().sendObservable("personalize", combinedData) .subscribe(reply3 -> request.response().end("Personalized results are: " + reply3.body())) ); } } Nothing happens here. Just declarations.
  • 50. KNOTX.io RxJava - abstraction over low-level threading public class RequestHandler implements Handler<HttpServerRequest> { @Override public void handle(HttpServerRequest request) { Observable<Message<String>> reply1 = vertx.eventBus() .sendObservable("user-tracking", userId); Observable<Message<String>> reply2 = vertx.eventBus() .sendObservable("search-engine", query); Observable .zip(reply1, reply2, (Message resp1, Message resp2) -> resp1.body() + "-" + resp2.body()) .subscribe(combinedData -> vertx.eventBus().sendObservable("personalize", combinedData) .subscribe(reply3 -> request.response().end("Personalized results are: " + reply3.body())) ); } } Nothing happens here. Just declarations. Also, no actions here until we subscribe.
  • 51. KNOTX.io RxJava - abstraction over low-level threading public class RequestHandler implements Handler<HttpServerRequest> { @Override public void handle(HttpServerRequest request) { Observable<Message<String>> reply1 = vertx.eventBus() .sendObservable("user-tracking", userId); Observable<Message<String>> reply2 = vertx.eventBus() .sendObservable("search-engine", query); Observable .zip(reply1, reply2, (Message resp1, Message resp2) -> resp1.body() + "-" + resp2.body()) .subscribe(combinedData -> vertx.eventBus().sendObservable("personalize", combinedData) .subscribe(reply3 -> request.response().end("Personalized results are: " + reply3.body())) ); } } Nothing happens here. Just declarations. Also, no actions here until we subscribe. This subscribe triggers simultaneous calls to search-engine and user-tracking. This subscribe triggers calling personalized service.
  • 55. KNOTX.io Thank you ● Tutorials: www.knotx.io ● Sources & Wiki: https://github.com/Cognifide/knotx ● Twitter: @knotx_project ● Gitter / Google Groups Maciej Laskowski @skejven https://github.com/Skejven Tomasz Michalak @tomichalak https://github.com/tomaszmichalak