BE REACTIVE AND MICRO WITH A MICROPROFILE STACK€¦ · reactive REST client (JAX-RS) Server-Sent...

18
BE REACTIVE AND MICRO WITH A MICROPROFILE STACK Ondrej Mihályi @omihalyi

Transcript of BE REACTIVE AND MICRO WITH A MICROPROFILE STACK€¦ · reactive REST client (JAX-RS) Server-Sent...

Page 1: BE REACTIVE AND MICRO WITH A MICROPROFILE STACK€¦ · reactive REST client (JAX-RS) Server-Sent Events Kafka JCA connector Hazelcast distributed cache and other structures NoSQL

BEREACTIVEANDMICROWITHAMICROPROFILE

STACK

OndrejMihályi@omihalyi

Page 2: BE REACTIVE AND MICRO WITH A MICROPROFILE STACK€¦ · reactive REST client (JAX-RS) Server-Sent Events Kafka JCA connector Hazelcast distributed cache and other structures NoSQL

WHATDOWEWANT?

@OMihalyi

Page 3: BE REACTIVE AND MICRO WITH A MICROPROFILE STACK€¦ · reactive REST client (JAX-RS) Server-Sent Events Kafka JCA connector Hazelcast distributed cache and other structures NoSQL

thereshouldbeaPROBLEMtosolve

WHYDOWEWANTIT?

@OMihalyi

Page 4: BE REACTIVE AND MICRO WITH A MICROPROFILE STACK€¦ · reactive REST client (JAX-RS) Server-Sent Events Kafka JCA connector Hazelcast distributed cache and other structures NoSQL

BETTERUSEREXPERIENCE

updateswhenready,reducedwaitingerrorsraisedASAPuserscanreactfasteravoidsunnecessaryuserretries

@OMihalyi

Page 5: BE REACTIVE AND MICRO WITH A MICROPROFILE STACK€¦ · reactive REST client (JAX-RS) Server-Sent Events Kafka JCA connector Hazelcast distributed cache and other structures NoSQL

HANDLEHIGHLOADS

utilizeresourcesatmaximum(CPU)threadsaren'twastedbyblockingavoidblockingofnewrequests

@OMihalyi

Page 6: BE REACTIVE AND MICRO WITH A MICROPROFILE STACK€¦ · reactive REST client (JAX-RS) Server-Sent Events Kafka JCA connector Hazelcast distributed cache and other structures NoSQL

HANDLEMASSIVELOADS

scaletomorenodesmessagingtodistributetheload

@OMihalyi

Page 7: BE REACTIVE AND MICRO WITH A MICROPROFILE STACK€¦ · reactive REST client (JAX-RS) Server-Sent Events Kafka JCA connector Hazelcast distributed cache and other structures NoSQL

DON'TFORGETABOUTFAILURES

failfastandavoidwastemakesurefailuresarehandledfailureshappenalotmoreindistributedsystems

@OMihalyi

Page 8: BE REACTIVE AND MICRO WITH A MICROPROFILE STACK€¦ · reactive REST client (JAX-RS) Server-Sent Events Kafka JCA connector Hazelcast distributed cache and other structures NoSQL

WHATISMICROPROFILE?

open-sourcespecificationforJavamicroservices( )microprofile.io

@OMihalyi

Page 9: BE REACTIVE AND MICRO WITH A MICROPROFILE STACK€¦ · reactive REST client (JAX-RS) Server-Sent Events Kafka JCA connector Hazelcast distributed cache and other structures NoSQL

REACTIVESUPPORTINMICROPROFILE

AsynchronousREST(JAX-RS)CDIeventseasyFaultToleranceMonitoringviaMetrics

@OMihalyi

Page 10: BE REACTIVE AND MICRO WITH A MICROPROFILE STACK€¦ · reactive REST client (JAX-RS) Server-Sent Events Kafka JCA connector Hazelcast distributed cache and other structures NoSQL

WE'LLADDWHAT'SMISSING

RxJavahandlecallbacksanddatastreams

asynchronousFaultTolerance

React.jseasyupdatesonevents

@OMihalyi

Page 11: BE REACTIVE AND MICRO WITH A MICROPROFILE STACK€¦ · reactive REST client (JAX-RS) Server-Sent Events Kafka JCA connector Hazelcast distributed cache and other structures NoSQL

OURDEMOAPPLICATION

@OMihalyi

Page 12: BE REACTIVE AND MICRO WITH A MICROPROFILE STACK€¦ · reactive REST client (JAX-RS) Server-Sent Events Kafka JCA connector Hazelcast distributed cache and other structures NoSQL

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

with-MicroProfile-and-Payara

@OMihalyi

Page 13: BE REACTIVE AND MICRO WITH A MICROPROFILE STACK€¦ · reactive REST client (JAX-RS) Server-Sent Events Kafka JCA connector Hazelcast distributed cache and other structures NoSQL

WE'LLADDMORE

JavaEE8reactiveRESTclient(JAX-RS)Server-SentEvents

KafkaJCAconnectorHazelcast

distributedcacheandotherstructuresNoSQLdistributeddatastore

@OMihalyi

Page 14: BE REACTIVE AND MICRO WITH A MICROPROFILE STACK€¦ · reactive REST client (JAX-RS) Server-Sent Events Kafka JCA connector Hazelcast distributed cache and other structures NoSQL

DEMO

@OMihalyi

Page 15: BE REACTIVE AND MICRO WITH A MICROPROFILE STACK€¦ · reactive REST client (JAX-RS) Server-Sent Events Kafka JCA connector Hazelcast distributed cache and other structures NoSQL

PAYARASERVER

MicroProfile,JavaEE,Hazelcast,CloudJCAConnectors,CDIeventbusdynamicclustering(suitableforcloud)fastdevelopmentadminconsolemonitoring

@OMihalyi

Page 16: BE REACTIVE AND MICRO WITH A MICROPROFILE STACK€¦ · reactive REST client (JAX-RS) Server-Sent Events Kafka JCA connector Hazelcast distributed cache and other structures NoSQL

PAYARAMICRO

APIsasinServer(exceptSOAP,remoteEJB)mostoffeaturesoftheServerexecutableJAR,<70MBeasiertoinstallandrunapps

commandline,mavenplugin

builduberJAR

@OMihalyi

Page 17: BE REACTIVE AND MICRO WITH A MICROPROFILE STACK€¦ · reactive REST client (JAX-RS) Server-Sent Events Kafka JCA connector Hazelcast distributed cache and other structures NoSQL

WHATTOAVOID

relyingonrequestscoperelyingonthreadlocalusingsynchronousCDIinterceptorsDon'tjumptoreactivebeforeneeded

@OMihalyi

Page 18: BE REACTIVE AND MICRO WITH A MICROPROFILE STACK€¦ · reactive REST client (JAX-RS) Server-Sent Events Kafka JCA connector Hazelcast distributed cache and other structures NoSQL

QUESTIONS?

Thankyou!

@OMihalyi