Enterprise Java Developers Bringing Reactive to · 2018-10-30 · Enterprise Java Developers Julien...

Post on 22-May-2020

33 views 0 download

transcript

Bringing Reactive to Enterprise Java Developers

Julien Ponge, Thomas Segismont and Clement EscoffierRed Hat

Reactive Summit 20182

Hello!

We work on Eclipse Vert.x, a toolkit for writing asynchronous and reactive applications on the JVM

Reactive Summit 20183

(s a l p u )

50% off with mlponge code

Reactive Summit 20184

Reactive Summit 20185

Vert.x MicroProfile Jakarta EE

Introducing reactive to the EE world...without breaking everything!

Times change quickly

Reactive Summit 20187

‘14

Java EE 8

‘17

From Java EE to Jakarta EE

‘13

Java EE 7

‘07

JAX-RS

‘09

CDI(Java EE 6)

MicroservicesDocker

KubernetesReactivemanifesto

‘12

Vert.xNode.js

MVC 1.0

‘11

Kafka Serverless

Reactive Summit 20188

Typical use-case

CRUD

Database with ORM

Development model

CDI (injection)

JAX-RS (REST API)

JPA, Bean Validation, JTA, Management...

Execution model

Servlets

1 thread per request

Java EE: a feet in the past

Reactive Summit 20189

Not cloud-friendly, not reactive

Based on the concept of application server➔ 1 server = many applications

Does not fit the “cloud model”➔ Small, lightweight applications➔ Each service in its own process

Reactive Summit 201810

Not cloud-friendly, not reactive

Most of the model is synchronous except● Asynchronous servlets● CDI events

Also:➔ No stream support➔ No back-pressure

Reactive Summit 201811

A new hope?

MicroProfile - the rogue child➔ A new set of specs➔ Microservice-friendly➔ Very iterative➔ Reactive working group!

Jakarta EE➔ New spec model➔ Faster processes➔ Growing interest for reactive

Reactive and MicroProfile

Reactive Summit 201813

Traction from: Lightbend, Red Hat, Oracle, IBM

Reactive Microprofile specifications

Reactive Streams OperatorsReactive MessagingConcurrency

Reactive Summit 201814

JAX-RS and reactive

Stream data as SSE

Reactive Summit 201815

Reactive Messaging (and data streaming)

Reactive Summit 201816

Reactive Messaging (and data streaming)

Manuel, pre and post

processing

Reactive Summit 201817

Reactive Stream Operators

Compose and

transform

Demos*

* no rabbits were harmed in the making of this.

Reactive Summit 201819

Step #1RestEasy, server-sent events and reactive streams

Server

{sleeping, awake, eating}

Reactive Summit 201820

Step #2Introducing MicroProfile Reactive Messaging

HealthDataBean

(temperature, heartbeat, pressure)

Neo

(sleeping, awake, eating)

Processor

state

Health dataHeartbeat

Reactive Summit 201821

Step #3Introducing MicroProfile Reactive Streams Operators

HealthDataBean

(temperature, heartbeat, pressure)

Processor

Health data

Heartbeat

HTTP Client(Vert.x)

Snapshot service(latest data)

Health data

Health data1 2

Reactive Summit 201822

Step #4Health data comes from MQTT

Processor

Health data

Heartbeat

HTTP Client(Vert.x)

Snapshot service(latest data)

Health data

Health data1 2

MQTT

Reactive Summit 201823

Step #5Event-driven and asynchronous microservices

MQTT

Kafka

Collector service

Snapshot service

Web application

Health data

Events split by topic

SSE

HTTPEvents

Before we wrap up...

Reactive Summit 201825

Reactive Summit 201826

JAX-RS

Vert.x

CDI (Weld)

RestEasy

Reactive Messaging

Vert.x-powered

MQTT

Apache Kafka

Apache Camel

AMQP 1.0

Reactive Stream Ops

Vert.x + RxJava2

SmallRye

Reactive Summit 201827

Roadmap

● MicroProfile Reactive Stream Operators○ Approaching 1.0○ Starting to infuse in the other MicroProfile specifications○ Integration in the next MicroProfile release (February 2019)

● MicroProfile Reactive Messaging○ Data streaming and Event-driven microservice○ Integration in the next MicroProfile release (February 2019)

● MicroProfile Concurrency○ Async context propagation

Reactive Summit 201828

(s a l p u #2)

50% off with mlponge code

Q&A

@jponge @tsegismont @clementplop

THANK YOUplus.google.com/+RedHat

linkedin.com/company/red-hat

youtube.com/user/RedHatVideos

facebook.com/redhatinc

twitter.com/RedHat