BE REACTIVE AND MICRO WITH A MICROPROFILE STACK...REACTIVE JAX-RS subscribe to REST requests and...

Preview:

Citation preview

BEREACTIVEANDMICROWITHAMICROPROFILE

STACK

OndroMihályi@OMIHALYI

WHATISMICROPROFILE?

open-sourcespecificationforJavamicroservices( )microprofile.io

@OMIHALYI

GOALSTOSOLVE

Betteruserexperiencesaveresources/costskeepupwithmassiveloadshandle/recoverfromFAILURES

@OMIHALYI

@OMIHALYI

REACTIVEINANUTSHELL

Traditional-singlethread

@OMIHALYI

REACTIVEINANUTSHELL

Reactive-notboundtoathread

@OMIHALYI

REACTIVEINANUTSHELL

Reactive-notboundtoathread

@OMIHALYI

REACTIVEPIPELINE

→ incomingrequest→ subscribe→ process→ publish(data/error)

@OMIHALYI

REACTIVESUPPORTINMICROPROFILE2.0

ReactiveREST&SSE(JAX-RS)AsyncCDIeventsMonitoringviaMetrics

@OMIHALYI

JAX-RS

@OMIHALYI

HOWMICROPROFILEFITSTHEPIPELINE

REACTIVEJAX-RSsubscribetoRESTrequestsandresponsespublishRESTresponses

SERVER-SENTEVENTS(JAX-RS)-publishviaHTTPASYNCCDIEVENTS-publishtoothercomponentsMONITORINGviaMetrics-publishmetricstoexternalsystems

@OMIHALYI

WHAT'SMISSING?

PROCESSINGstreamsofmessagesconnectsuscriberstopublishers

PUBLISHandSUBSRIBEtomessagequeues/topics

connectdecoupledpublisherstosubscribers

@OMIHALYI

MORETOCOMEINMICROPROFILEPROCESSINGstreamsofmessages

Reactiveoperators-PUBLISHandSUBSRIBEtomessagequeues/topics

ReactiveMessaging-Bonus:

Asynch.FaultToleranceinterceptors

releasecandidate

draftAPI

@OMIHALYI

WE'LLADDMOREFROMJAVAEE8

Message-DrivenBeansviaPUBLISHandSUBSRIBEtomessagequeues/topics

KafkaJCAconnector

@OMIHALYI

WE'LLFILLWHAT'SMISSING

RxJava(ReactiveStreams)PROCESSINGstreamsofmessages

asynchronousFaultTolerance

React.jsturnmessagestreamintoUIupdate

@OMIHALYI

ANDRUNWITHPAYARAMICRO

JAVAEEandMICROPROFILEtogetherexecutableJAR,<70MBeasytorunappswithnoinstallation

commandline,mavenplugin

builduberJARhttps://payara.fish

@OMIHALYI

OURDEMOAPPLICATION

@OMIHALYI

DEMOSource:https://github.com/OndrejM-demonstrations/Reactive-and-Micro-

with-MicroProfile-and-Payara

@OMIHALYI

FURTHERRESOURCES

JCACloudConnectors:

MicroProfileReactiveOperators:

https://github.com/payara/Cloud-Connectors

https://github.com/eclipse/microprofile-reactive-streams

@OMIHALYI

THANKYOU!

OndroMihalyi( )

WorkingforPayaraMicroProfileprojectmemberEclipseFoundationandJCPmemberCzechJUGleader

ondro.inginea.eu

@OMIHALYI