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
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
Julien Ponge
April 19, 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
At MiXiT 2018
Julien Ponge
April 19, 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
IBM Bobを活用したレガシーアプリの最新化
oniak3ibm
PRO
1
190
3Dシーンの圧縮
fadis
1
740
Oxcを導入して開発体験が向上した話
yug1224
4
310
Make SRE Operations Easier with Azure SRE Agent
kkamegawa
0
5.4k
技術記事、AIに書かせるか、自分で書くか? 〜それでも私が自分の手で書く理由〜 / #QiitaConference
jnchito
2
1.4k
PHPで使える日時の表現と、その知り方 #frontend_phpcon_do
o0h
PRO
0
230
TypeScript+Orvalで実現する型安全かつ堅牢でスケーラブルなマルチチャネル通知基盤 / TSKaigi Night talks ~after conference~
d0riven
0
330
Claspは野良GASの夢をみるか
takter00
0
180
メソッドのジェネリクスでGoの夢は広がるか? / Kyoto.go #65
utgwkk
3
690
TAKTでAI駆動開発の品質を設計する
j5ik2o
6
1.2k
These Five Tricks Can Make Your Apps Greener, Cheaper, & Nicer
hollycummins
0
280
キャリア迷子上等 ─ "ない道"は自分で作ればいい
16bitidol
3
2k
Featured
See All Featured
Stewardship and Sustainability of Urban and Community Forests
pwiseman
0
220
Crafting Experiences
bethany
1
180
Designing for Performance
lara
611
70k
New Earth Scene 8
popppiees
3
2.3k
Heart Work Chapter 1 - Part 1
lfama
PRO
7
36k
The agentic SEO stack - context over prompts
schlessera
0
810
How to train your dragon (web standard)
notwaldorf
97
6.7k
Tips & Tricks on How to Get Your First Job In Tech
honzajavorek
1
540
The Language of Interfaces
destraynor
162
27k
The Mindset for Success: Future Career Progression
greggifford
PRO
0
360
Leo the Paperboy
mayatellez
7
1.8k
Design and Strategy: How to Deal with People Who Don’t "Get" Design
morganepeng
133
19k
Transcript
Démystifier le réactif et l'orchestration de services avec Vert.x, Kubernetes
et Kotlin
! 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 C”, age=49) 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 C”, age=49) 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 C”, age=49) 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 C”, age=49) println(phil) phil.name.yo() } } {{{ Person(name=Philippe C, age=49) Philippe -> Yo! }}}
Reactive? (because resources are scarce)
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
Application
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 ( ( ( ( (
(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
1/2
None
None
RxJava2 + Kotlin extensions Declarative data flows over event sources
Operators transforming data + event streams 2/2
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!") } ) }
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!") } ) }
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
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
(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
Lunch at your company?
Q&A ! https://julien.ponge.org/ " @jponge # @jponge https://www.mixcloud.com/hclcast/