Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Démystifier le réactif et l'orchestration de se...
Search
Julien Ponge
March 29, 2018
Programming
290
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Démystifier le réactif et l'orchestration de services avec Vert.x, Kubernetes et Kotlin
Julien Ponge
March 29, 2018
More Decks by Julien Ponge
See All by Julien Ponge
Quarkus Insights 2023-03-06
jponge
0
130
Reactive Streams. 4 Interfaces. Et après ?
jponge
0
64
Scalability and resilience in practice: current trends and opportunities
jponge
0
310
Eclipse Vert.x at BruJUG 2019
jponge
0
210
Du réactif au service du pneu connecté
jponge
0
400
Bringing Reactive to Enterprise Java Developers
jponge
0
350
Golo LyonJUG 2019
jponge
0
300
Vert.x Montreal JUG 2018
jponge
0
550
Bringing Reactive to Enterprise Application Developer // Reactive Summit 2018
jponge
0
300
Other Decks in Programming
See All in Programming
Datadog × OpenTelemetry 入門と実践のあいだ
kn_to_maxpno
1
150
決定論的オーケストレーションの設計と実装 / Design and Implementation of Deterministic Orchestration
nrslib
3
1.3k
LLMによるContent Moderationの本番運用の裏側と品質担保への挑戦
suikabar
2
570
LLM本来の能力を解き放つサンドボックス技術とAI民主化への適用
yukukotani
3
3.6k
CSC307 Lecture 17
javiergs
PRO
0
320
Make SRE Operations Easier with Azure SRE Agent
kkamegawa
0
5.4k
LLM Plugin for Node-REDの利用方法と開発について
404background
0
170
Inside Stream API
skrb
1
690
Signal Forms: Details & Live Coding @enterJS 2026 in Mannheim
manfredsteyer
PRO
0
100
Oxlintのカスタムルールの現況
syumai
6
1.1k
Contextとはなにか
chiroruxx
1
290
ふつうのFeature Flag実践入門
irof
7
3.7k
Featured
See All Featured
How Software Deployment tools have changed in the past 20 years
geshan
0
34k
Building Better People: How to give real-time feedback that sticks.
wjessup
370
20k
GraphQLとの向き合い方2022年版
quramy
50
15k
Visual Storytelling: How to be a Superhuman Communicator
reverentgeek
2
560
Efficient Content Optimization with Google Search Console & Apps Script
katarinadahlin
PRO
1
610
I Don’t Have Time: Getting Over the Fear to Launch Your Podcast
jcasabona
34
2.8k
JAMstack: Web Apps at Ludicrous Speed - All Things Open 2022
reverentgeek
1
470
Intergalactic Javascript Robots from Outer Space
tanoku
273
27k
Mobile First: as difficult as doing things right
swwweet
225
10k
エンジニアに許された特別な時間の終わり
watany
107
250k
The Web Performance Landscape in 2024 [PerfNow 2024]
tammyeverts
12
1.2k
The Invisible Side of Design
smashingmag
302
52k
Transcript
Démystifier le réactif et l'orchestration de services avec Vert.x, Kubernetes
et Kotlin
Julien Ponge Maitre de Conférences “Delegated consultant to Red Hat”
on Vert.x Eclipse Golo + extensive F/OSS background ! https://julien.ponge.org/ " @jponge # @jponge https://www.mixcloud.com/hclcast/
“No to average expertise on any of these technologies” !
" (or async)
Kotlin? (1 slide to be an expert)
data class Person(val name: String, val age: Int) fun String.yo()
{ println("$this -> Yo!") } fun wrap(block: () -> Unit) { println("{{{") block() println("}}}") } fun main(args: Array<String>) { wrap { val phil = Person(name="Philippe", age=45) println(phil) phil.name.yo() } }
data class Person(val name: String, val age: Int) fun String.yo()
{ println("$this -> Yo!") } fun wrap(block: () -> Unit) { println("{{{") block() println("}}}") } fun main(args: Array<String>) { wrap { val phil = Person(name="Philippe", age=45) println(phil) phil.name.yo() } }
data class Person(val name: String, val age: Int) fun String.yo()
{ println("$this -> Yo!") } fun wrap(block: () -> Unit) { println("{{{") block() println("}}}") } fun main(args: Array<String>) { wrap { val phil = Person(name="Philippe", age=45) println(phil) phil.name.yo() } }
data class Person(val name: String, val age: Int) fun String.yo()
{ println("$this -> Yo!") } fun wrap(block: () -> Unit) { println("{{{") block() println("}}}") } fun main(args: Array<String>) { wrap { val phil = Person(name="Philippe", age=45) println(phil) phil.name.yo() } } {{{ Person(name=Philippe, age=45) Philippe -> Yo! }}}
Reactive? (because resources are scarce)
None
Application
Reactive systems Reactive streams Reactive programming Reactive “Responding to stimuli”
Manifesto, Actor, Messages Resilience, Elasticity, Scalability, Asynchronous, non-blocking Data flow Back-pressure Non-blocking Data flow Events, Observable Spreadsheets Akka, Vert.x Akka Streams, RxJava, Reactor, Vert.x Reactor, Reactive Spring, RxJava, Vert.x
while (isRunning) { String line = bufferedReader.readLine(); switch (line.substring(0, 4))
{ case "ECHO": bufferedWriter.write(line); break // ... // other cases ( ...) // ... default: bufferedWriter.write("UNKW Unknown command"); } }
x 1000 = %
Virtual machines, Containers, etc
None
Vert.x? (async all the things!)
Eclipse Vert.x Open source project started in 2012 Eclipse /
Apache licensing A toolkit for building reactive applications for the JVM 7K ⋆ on ' Built on top of ! https://vertx.io " @vertx_project
( ) ( Http server verticle Database client verticle
Event Bus + ) “Details for user 1234?” “{data}” 4 instances 1 instance
Events Thread Event Loop
Verticles ( ( ( public class SomeVerticle extends AbstractVerticle
{ @Override public void start() throws Exception { } @Override public void stop() throws Exception { } } class SomeVerticle : AbstractVerticle() { override fun start() { } override fun stop() { } } exports.vertxStart = function() { } exports.vertxStop = function() { }
(demo) Hello Kotlin + Vert.x
None
Async is hard (callback hell is just one facet)
Kotlin coroutines Looks “like” sequential operations async/await, Go-style channels
None
RxJava2 + Kotlin extensions Declarative data flows over event sources
Operators transforming data + event streams
fun main(args: Array<String>) { val rand = Random() val o1
= Observable .fromCallable(rand ::nextInt) .repeat() .take(500, TimeUnit.MILLISECONDS) .filter { it > 0 } .filter { it % 2 == 0 } .map { "[${it}]" } val o2 = Observable.fromIterable(1 ..Long.MAX_VALUE) Observables .zip(o1, o2) { n, id -> "${id} -> ${n}" } .subscribeBy( onNext = logger ::info, onError = { logger.error("Oh?") }, onComplete = { logger.info("Done!") } ) } “id -> [n]” zip()
Kubernetes? (orchestrating containers for you)
https://cloud.google.com/kubernetes-engine/kubernetes-comic
None
https://cloud.google.com/kubernetes-engine/kubernetes-comic
https://cloud.google.com/kubernetes-engine/kubernetes-comic
Pod Pod Pod Pod Pod Pod Pod Pod Node Node
Master(s)
Same host Same network Same namespace Same volumes Same secrets
Pod Container Container Container
Container Container Container Pod replicas & scaling Readiness probes Liveness
probes Restart policy Rolling upgrades (…)
Using Kubernetes (minikube is your friend)
⚙ Temperatures services Aggregate Alarm
Vert.x callbacks Coroutines, liveness RxKotlin Discovery RxKotlin, SockJS event bus
bridge, VueJS, MongoDB
(demo) Kubernetes (minikube) https://github.com/jponge/demo-vertx-kotlin-rxjava2-kubernetes
Outro (how was the nap?)
Unified end-to-end reactive model + ecosystem (not just APIs…) For
all kinds of distributed applications (even the small-scale ones) Flexible toolkit, not a framework (your needs, your call)
https: //youtu.be/ZkWsilpiSqw - Applications réactives avec Eclipse Vert.x . Building
Reactive Microservices in Java https: //goo.gl/ep6yB9 . Guide to async programming with Vert.x for Java developers https: //goo.gl/AcWW3A
Q&A ! https://julien.ponge.org/ " @jponge # @jponge https://www.mixcloud.com/hclcast/