Slide 1

Slide 1 text

GeeCon Krakow 2023 Modern Java App Development in the Cloud Rustam Mehmandarov @RMehmandarov Mads Opheim @MadsOpheim

Slide 2

Slide 2 text

The main story: From code ---> to production

Slide 3

Slide 3 text

3 Questions? Url: sli.do Code: #geecon Room 1 (we have hoodies and stickers!)

Slide 4

Slide 4 text

Our application We want an application that gives us two random words 4

Slide 5

Slide 5 text

Screenshot e.l. 5

Slide 6

Slide 6 text

Screenshot e.l. 6

Slide 7

Slide 7 text

Step 1: The logic 7

Slide 8

Slide 8 text

8

Slide 9

Slide 9 text

Step 2: Running code 9

Slide 10

Slide 10 text

Screenshot e.l. 10

Slide 11

Slide 11 text

Jakarta EE + MicroProfile to the rescue! 11

Slide 12

Slide 12 text

Wait! What is this MicroProfile thing?

Slide 13

Slide 13 text

Jakarta EE for microservices 13

Slide 14

Slide 14 text

Authentication 3.0 Concurrency 3.0 CDI 4.0 Persistence 3.1 Faces 4.0 Security 3.0 Servlet 6.0 Standard Tag Libraries 3.0 Server Pages 3.1 WebSocket 2.1 Bean Validation 3.0 Debugging Support 2.0 Enterprise Beans Lite 4.0 Managed Beans 2.0 Transactions 2.0 Jakarta EE 10 Platform Jakarta EE 10 Web Profile Jakarta EE 10 Platform Interceptors 2.1 Dependency Injection 2.0 Authorization 2.1 Activation 2.1 Batch 2.1 Connectors 2.1 Messaging 3.1 Enterprise Beans 4.0 Mail 2.1 JSON Binding 3.0 Annotations 2.1 Updated Not Updated New Jakarta EE 10 Core Profile Expression Language 5.0 Restful Web Services 3.1 Json Processing 2.1 Dependency Injection 2.0 CDI Lite 4

Slide 15

Slide 15 text

15 MicroProfile 6.0 Jakarta EE 10 Core Profile Config 3.0 Fault Tolerance 4.0 JWT Authentication 2.1 Health 4.0 Metrics 5.0 Open Tracing 3.0 Open API 3.1 = Updated = No change from last release = New Rest Client 3.0 Standalone Context Propagation 1.3 Reactive Streams Operators 3.0 Outside umbrella Reactive Messaging 3.0 GraphQL 2.0 LRA 2.0 MicroProfile Releases in 2022 Telemetry 1.0

Slide 16

Slide 16 text

● MicroProfile is an open-source community specification for Enterprise Java microservices ● A community of individuals, organizations, and vendors collaborating within an open source Eclipse Foundation Working Group to bring microservices to the Enterprise Java community 16 What is MicroProfile?

Slide 17

Slide 17 text

17 Working Group Corporate Members

Slide 18

Slide 18 text

Why MicroProfile?

Slide 19

Slide 19 text

Write your logic, not boilerplate code 19

Slide 20

Slide 20 text

Lightweight 20

Slide 21

Slide 21 text

Interchangeable 21

Slide 22

Slide 22 text

22 Current MicroProfile Implementations

Slide 23

Slide 23 text

Where do I start?

Slide 24

Slide 24 text

24 https://start.microprofile.io/

Slide 25

Slide 25 text

25

Slide 26

Slide 26 text

It works on my machine! Now what? 26

Slide 27

Slide 27 text

Step 3: Containerize it! 27

Slide 28

Slide 28 text

Your Dockerfile Things to consider: - Multistage builds - Slim base images - Layers - etc. 28

Slide 29

Slide 29 text

Step 4: To the Cloud! ...and beyond? 29

Slide 30

Slide 30 text

Automate your builds! ...and everything else!

Slide 31

Slide 31 text

31 Cloud Build

Slide 32

Slide 32 text

Dockerfile - or - cloudbuild.yaml 32

Slide 33

Slide 33 text

So now we have built a container image in the Cloud. Now what? 33

Slide 34

Slide 34 text

Serverless, of course!

Slide 35

Slide 35 text

35

Slide 36

Slide 36 text

36

Slide 37

Slide 37 text

When not to go serverless? 37

Slide 38

Slide 38 text

Step 5: Make it fast! 🏎 38

Slide 39

Slide 39 text

Runtimes differ... 39

Slide 40

Slide 40 text

40

Slide 41

Slide 41 text

HowTo: Migrating to Quarkus 1. Download the Quarkus starter, copy the Dockerfiles and pom files into your project 2. Adapt the pom file to your project 3. Move config to application.properties 4. Update your cloudbuild.yaml 5. Run 41

Slide 42

Slide 42 text

42

Slide 43

Slide 43 text

Step 6: And even faster! 🏎🏎 43

Slide 44

Slide 44 text

+ 44

Slide 45

Slide 45 text

Voila! 🎉

Slide 46

Slide 46 text

46 Question time! url: sli.do code: #geecon

Slide 47

Slide 47 text

Everything’s on GitHub! 47 https://github.com/mehmandarov/microprofile-randomstrings https://github.com/madsop/quarkus-multistage https://microprofile.io https://quarkus.io https://cloud.google.com

Slide 48

Slide 48 text

Thank you! Rustam Mehmandarov @RMehmandarov Mads Opheim @MadsOpheim