Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Speaker Deck
PRO
Sign in
Sign up for free
Démystifier le réactif et l'orchestration de services avec Vert.x, Kubernetes et Kotlin
Julien Ponge
April 19, 2018
Programming
0
180
Démystifier le réactif et l'orchestration de services avec Vert.x, Kubernetes et Kotlin
At MiXiT 2018
Julien Ponge
April 19, 2018
Tweet
Share
More Decks by Julien Ponge
See All by Julien Ponge
Scalability and resilience in practice: current trends and opportunities
jponge
0
140
Eclipse Vert.x at BruJUG 2019
jponge
0
150
Du réactif au service du pneu connecté
jponge
0
250
Bringing Reactive to Enterprise Java Developers
jponge
0
170
Golo LyonJUG 2019
jponge
0
140
Vert.x Montreal JUG 2018
jponge
0
220
Bringing Reactive to Enterprise Application Developer // Reactive Summit 2018
jponge
0
200
Démystifier le réactif et l'orchestration de services avec Vert.x, Kubernetes et Kotlin
jponge
0
200
Services réactifs avec Vert.x et intégration avec Kotlin
jponge
0
140
Other Decks in Programming
See All in Programming
Pythonで鉄道指向プログラミング
usabarashi
0
130
パラメタライズドテスト
ledsun
0
220
このタイミングで知っておきたい 開発生産性の高いエンジニア組織の特徴とは / dev-sumi-20220721-productivity-features
findyinc
7
2.6k
Scaling Productivity- How we have improved our dev experience
sockeqwe
1
120
Git操作編
smt7174
2
250
Lookerとdbtの共存
ttccddtoki
0
630
企業内スモールデータでのデータ解析
hamage9
0
890
kintoneでランダム取得を作ってみた(imoniCamp 2022-07-27)
shokun1108
0
140
More Than Micro Frontends: 3 Further Use Cases for Module Federation @DWX 2022
manfredsteyer
PRO
0
370
Amazon Lookout for Visionで 筆跡鑑定してみた
cmnakamurashogo
0
160
Better Angular Architectures: Architectures with Standalone Components @DWX2022
manfredsteyer
PRO
1
410
Automating Gradle benchmarks at N26
ubiratansoares
PRO
1
140
Featured
See All Featured
The Mythical Team-Month
searls
210
39k
Designing for Performance
lara
597
64k
Done Done
chrislema
174
14k
How to train your dragon (web standard)
notwaldorf
60
3.9k
Principles of Awesome APIs and How to Build Them.
keavy
113
15k
Thoughts on Productivity
jonyablonski
44
2.4k
CSS Pre-Processors: Stylus, Less & Sass
bermonpainter
349
27k
Faster Mobile Websites
deanohume
294
28k
Helping Users Find Their Own Way: Creating Modern Search Experiences
danielanewman
7
1.1k
How GitHub (no longer) Works
holman
297
140k
Building Applications with DynamoDB
mza
84
4.8k
StorybookのUI Testing Handbookを読んだ
zakiyama
6
2.5k
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/