web protocols for java developers - rainfocus · – doesn’t need to be image, but all cool demos...
TRANSCRIPT
![Page 1: Web protocols for Java Developers - RainFocus · – Doesn’t need to be image, but all cool demos are using that (remember SPDY) • Server push has its own issues – What if client](https://reader034.vdocument.in/reader034/viewer/2022042110/5e8a58c701a42370e50d5c92/html5/thumbnails/1.jpg)
![Page 2: Web protocols for Java Developers - RainFocus · – Doesn’t need to be image, but all cool demos are using that (remember SPDY) • Server push has its own issues – What if client](https://reader034.vdocument.in/reader034/viewer/2022042110/5e8a58c701a42370e50d5c92/html5/thumbnails/2.jpg)
![Page 3: Web protocols for Java Developers - RainFocus · – Doesn’t need to be image, but all cool demos are using that (remember SPDY) • Server push has its own issues – What if client](https://reader034.vdocument.in/reader034/viewer/2022042110/5e8a58c701a42370e50d5c92/html5/thumbnails/3.jpg)
Copyright©2016,Oracleand/oritsaffiliates.Allrightsreserved.|
WebprotocolsforJavaDevelopers
PavelBucekOracleSeptember,2016
CON4156
![Page 4: Web protocols for Java Developers - RainFocus · – Doesn’t need to be image, but all cool demos are using that (remember SPDY) • Server push has its own issues – What if client](https://reader034.vdocument.in/reader034/viewer/2022042110/5e8a58c701a42370e50d5c92/html5/thumbnails/4.jpg)
Copyright©2016,Oracleand/oritsaffiliates.Allrightsreserved.|
SafeHarborStatementTheprecedingisintendedtooutlineourgeneralproductdirecLon.ItisintendedforinformaLonpurposesonly,andmaynotbeincorporatedintoanycontract.Itisnotacommitmenttodeliveranymaterial,code,orfuncLonality,andshouldnotberelieduponinmakingpurchasingdecisions.Thedevelopment,release,andLmingofanyfeaturesorfuncLonalitydescribedforOracle’sproductsremainsatthesolediscreLonofOracle.
4
![Page 5: Web protocols for Java Developers - RainFocus · – Doesn’t need to be image, but all cool demos are using that (remember SPDY) • Server push has its own issues – What if client](https://reader034.vdocument.in/reader034/viewer/2022042110/5e8a58c701a42370e50d5c92/html5/thumbnails/5.jpg)
Copyright©2016,Oracleand/oritsaffiliates.Allrightsreserved.|
ProgramAgenda
EvoluLon–HTTPandrestREST
Polling,LongPolling
SSE,WebSocket
HTTP/2
Demo,Q&A
1
2
3
4
5
5
![Page 6: Web protocols for Java Developers - RainFocus · – Doesn’t need to be image, but all cool demos are using that (remember SPDY) • Server push has its own issues – What if client](https://reader034.vdocument.in/reader034/viewer/2022042110/5e8a58c701a42370e50d5c92/html5/thumbnails/6.jpg)
Copyright©2016,Oracleand/oritsaffiliates.Allrightsreserved.|
EvoluLon–HTTP
• HTTPV0.9(1991)– FirstversionproposedbyTimBerners-LeefromCERN– OnlyGETmethod,serverreturnedHTML– W3Cstandard– Funtoread,wholestandardisasinglepagehbps://www.w3.org/Protocols/HTTP/AsImplemented.html
• DaveRaggeb–leaderoftheHTTPWorkingGroup–expandingprotocolwithmoreoperaLons,meta-informaLon,security,..• HTTPV1.0introducedin1995–RFC1945
HypertextTransferProtocol
6
![Page 7: Web protocols for Java Developers - RainFocus · – Doesn’t need to be image, but all cool demos are using that (remember SPDY) • Server push has its own issues – What if client](https://reader034.vdocument.in/reader034/viewer/2022042110/5e8a58c701a42370e50d5c92/html5/thumbnails/7.jpg)
Copyright©2016,Oracleand/oritsaffiliates.Allrightsreserved.|
EvoluLon–HTTP
• HTTPWorkingGrouppublishedHTTP/1.1as“pre-standard”• RapidadopLonbyserversandbrowsers– (Arena,Netscape,Mosaic,Lynx,InternetExplorer)
• HTTP/1.1finalizedin1997(RFC2068),improvedin1999(RFC2616)• 2007-HTTPbisWorkinggroupformedtoreviseandclarifythespec– RFC7230–MessageSyntaxandRouLng,7231–SemanLcsandContent,7232–CondiLonalRequests,7233–RangeRequests,7234-Caching,7235–AuthenLcaLon
• HTTP/2–May2015–RFC7540
HypertextTransferProtocol
7
![Page 8: Web protocols for Java Developers - RainFocus · – Doesn’t need to be image, but all cool demos are using that (remember SPDY) • Server push has its own issues – What if client](https://reader034.vdocument.in/reader034/viewer/2022042110/5e8a58c701a42370e50d5c92/html5/thumbnails/8.jpg)
Copyright©2016,Oracleand/oritsaffiliates.Allrightsreserved.|
HypertextTransferProtocol
8
REQUESTGET/en/HTTP/1.1Host:www.java.comUser-Agent:curl/7.43.0Accept:*/*<CR><LF><CR><LF>
RESPONSEHTTP/1.1200OKServer:Oracle-ApplicaLon-Server-11gLast-Modified:Thu,31Mar201622:48:16GMTdevice_type:Anyhost_service:FutureTenseContentServer:11.1.1.8.0X-Powered-By:Servlet/2.5JSP/2.1Content-Type:text/html;charset=UTF-8Content-Language:enX-Frame-OpLons:SAMEORIGINContent-Length:7516Date:Mon,05Sep201620:22:35GMTConnecLon:keep-aliveVary:User-Agent...Content<CR><LF><CR><LF>
![Page 9: Web protocols for Java Developers - RainFocus · – Doesn’t need to be image, but all cool demos are using that (remember SPDY) • Server push has its own issues – What if client](https://reader034.vdocument.in/reader034/viewer/2022042110/5e8a58c701a42370e50d5c92/html5/thumbnails/9.jpg)
Copyright©2016,Oracleand/oritsaffiliates.Allrightsreserved.|
EvoluLon–REST
• Basicsovwarearchitecture/scheme• ExposesResources(URIs),whichhandleMETHODs– GET/PUT/POST/DELETE/HEAD/OPTIONS/TRACE/PATCH/…
• MediaType(Accept/Content-Type)– text/plain,text/html,applicaLon/json,…
• Caching(GET,HEAD),Hyperlinking,…
Representa@onalStateTransfer
9
![Page 10: Web protocols for Java Developers - RainFocus · – Doesn’t need to be image, but all cool demos are using that (remember SPDY) • Server push has its own issues – What if client](https://reader034.vdocument.in/reader034/viewer/2022042110/5e8a58c701a42370e50d5c92/html5/thumbnails/10.jpg)
Copyright©2016,Oracleand/oritsaffiliates.Allrightsreserved.|
EvoluLon–RESTRepresenta@onalStateTransfer
10
Client Server
GET/helloHTTP/1.1Header:value…
HTTP/1.1200OKHeader:value…<enLty>
![Page 11: Web protocols for Java Developers - RainFocus · – Doesn’t need to be image, but all cool demos are using that (remember SPDY) • Server push has its own issues – What if client](https://reader034.vdocument.in/reader034/viewer/2022042110/5e8a58c701a42370e50d5c92/html5/thumbnails/11.jpg)
Copyright©2016,Oracleand/oritsaffiliates.Allrightsreserved.|
JavaAPIforRESTfulWebServices(JAX-RS)
• JSR311–JAX-RS1.1–JavaEE6– ServersideRESTResources– @Path,@GET,@POST,@Produces,@Consumes,@QueryParam,@Context,…
• JSR399–JAX-RS2.0–JavaEE7– ClientAPI,FiltersandInterceptors,Asyncprocessing,integraLonwithotherEEspecs
• JAX-RS2.1–JavaEE8– Non-blockingIO,ReacLveClientAPI,ServerSentEvents,…
![Page 12: Web protocols for Java Developers - RainFocus · – Doesn’t need to be image, but all cool demos are using that (remember SPDY) • Server push has its own issues – What if client](https://reader034.vdocument.in/reader034/viewer/2022042110/5e8a58c701a42370e50d5c92/html5/thumbnails/12.jpg)
Copyright©2016,Oracleand/oritsaffiliates.Allrightsreserved.|
EvoluLon–RESTJavaAPI–JAX-RS
12
![Page 13: Web protocols for Java Developers - RainFocus · – Doesn’t need to be image, but all cool demos are using that (remember SPDY) • Server push has its own issues – What if client](https://reader034.vdocument.in/reader034/viewer/2022042110/5e8a58c701a42370e50d5c92/html5/thumbnails/13.jpg)
Copyright©2016,Oracleand/oritsaffiliates.Allrightsreserved.|
EvoluLon–Polling
13
Client Server
GET/helloHTTP/1.1Header:value…
HTTP/1.1200OKHeader:value…<enLty>
![Page 14: Web protocols for Java Developers - RainFocus · – Doesn’t need to be image, but all cool demos are using that (remember SPDY) • Server push has its own issues – What if client](https://reader034.vdocument.in/reader034/viewer/2022042110/5e8a58c701a42370e50d5c92/html5/thumbnails/14.jpg)
Copyright©2016,Oracleand/oritsaffiliates.Allrightsreserved.|
EvoluLon–Long-Polling
14
Client Server
GET/helloHTTP/1.1Header:value…
HTTP/1.1200OKHeader:value…<enLty-CHUNK>
<enLty-CHUNK>
![Page 15: Web protocols for Java Developers - RainFocus · – Doesn’t need to be image, but all cool demos are using that (remember SPDY) • Server push has its own issues – What if client](https://reader034.vdocument.in/reader034/viewer/2022042110/5e8a58c701a42370e50d5c92/html5/thumbnails/15.jpg)
Copyright©2016,Oracleand/oritsaffiliates.Allrightsreserved.|
EvoluLon–SSE
• Channelforsendingeventsfromtheservertotheclient• Verysimilartolongpolling• Accept:text/event-stream• Semi-permanentconnecLon• Limitedbrowsersupport(noIE,noAndroid)• JavaEE8+J– IncludedinJAX-RS2.1
ServerSentEvents
15
![Page 16: Web protocols for Java Developers - RainFocus · – Doesn’t need to be image, but all cool demos are using that (remember SPDY) • Server push has its own issues – What if client](https://reader034.vdocument.in/reader034/viewer/2022042110/5e8a58c701a42370e50d5c92/html5/thumbnails/16.jpg)
Copyright©2016,Oracleand/oritsaffiliates.Allrightsreserved.|
HTTP/1.1200OKContent-Type:text/event-streamDate:Tue,06Sep201615:39:30GMTTransfer-Encoding:chunkedevent:custom-messagedata:JAX-RS2.1event:custom-messagedata:testevent:custom-messagedata:JavaOne2016
ServerSentEvents
16
Client Server
GET/sseAccept:text/event-stream
![Page 17: Web protocols for Java Developers - RainFocus · – Doesn’t need to be image, but all cool demos are using that (remember SPDY) • Server push has its own issues – What if client](https://reader034.vdocument.in/reader034/viewer/2022042110/5e8a58c701a42370e50d5c92/html5/thumbnails/17.jpg)
Copyright©2016,Oracleand/oritsaffiliates.Allrightsreserved.|
HTTP/1.1200OKContent-Type:text/event-streamDate:Tue,06Sep201615:39:30GMTTransfer-Encoding:chunkedevent:custom-messagedata:JAX-RS2.1event:custom-messagedata:testevent:custom-messagedata:JavaOne2016
ServerSentEvents
17
Client Server
GET/sseAccept:text/event-stream
![Page 18: Web protocols for Java Developers - RainFocus · – Doesn’t need to be image, but all cool demos are using that (remember SPDY) • Server push has its own issues – What if client](https://reader034.vdocument.in/reader034/viewer/2022042110/5e8a58c701a42370e50d5c92/html5/thumbnails/18.jpg)
Copyright©2016,Oracleand/oritsaffiliates.Allrightsreserved.|
ServerSentEvents
18
UseExecutorServiceinstead
P
![Page 19: Web protocols for Java Developers - RainFocus · – Doesn’t need to be image, but all cool demos are using that (remember SPDY) • Server push has its own issues – What if client](https://reader034.vdocument.in/reader034/viewer/2022042110/5e8a58c701a42370e50d5c92/html5/thumbnails/19.jpg)
Copyright©2016,Oracleand/oritsaffiliates.Allrightsreserved.|
ServerSentEvents
19 P
![Page 20: Web protocols for Java Developers - RainFocus · – Doesn’t need to be image, but all cool demos are using that (remember SPDY) • Server push has its own issues – What if client](https://reader034.vdocument.in/reader034/viewer/2022042110/5e8a58c701a42370e50d5c92/html5/thumbnails/20.jpg)
Copyright©2016,Oracleand/oritsaffiliates.Allrightsreserved.|
ServerSentEvents
20 P
![Page 21: Web protocols for Java Developers - RainFocus · – Doesn’t need to be image, but all cool demos are using that (remember SPDY) • Server push has its own issues – What if client](https://reader034.vdocument.in/reader034/viewer/2022042110/5e8a58c701a42370e50d5c92/html5/thumbnails/21.jpg)
Copyright©2016,Oracleand/oritsaffiliates.Allrightsreserved.|
EvoluLon–WebSocket
• RFC6455(December2011)• Bi-direcLonalcommunicaLon• UsesHTTP/1.1foriniLalhandshake– Completelydifferentprotocolaverwards
• “Server”and“client”endpointsareequalaverhandshake• Textorbinarypayload• Supportedinallmodernbrowsers
21
![Page 22: Web protocols for Java Developers - RainFocus · – Doesn’t need to be image, but all cool demos are using that (remember SPDY) • Server push has its own issues – What if client](https://reader034.vdocument.in/reader034/viewer/2022042110/5e8a58c701a42370e50d5c92/html5/thumbnails/22.jpg)
Copyright©2016,Oracleand/oritsaffiliates.Allrightsreserved.|
EvoluLon–WebSocketWebSocketFrame
22
![Page 23: Web protocols for Java Developers - RainFocus · – Doesn’t need to be image, but all cool demos are using that (remember SPDY) • Server push has its own issues – What if client](https://reader034.vdocument.in/reader034/viewer/2022042110/5e8a58c701a42370e50d5c92/html5/thumbnails/23.jpg)
Copyright©2016,Oracleand/oritsaffiliates.Allrightsreserved.|
WebSocketusecases
• RFC7118–SIPoverWebSocket• RFC7355–SIP&CLF(CommonLogFormat)overWebSocket• RFC7395–XMPPoverWebSocket• Dravs– MSRP(MessageSessionRelayProtocol)overWebSocket– SDP(SessionDescripLonProtocol)overWebSocket– RemoteFramebufferProtocoloverWebSocket– <anything>overWebSocket
Subprotocols
23
![Page 24: Web protocols for Java Developers - RainFocus · – Doesn’t need to be image, but all cool demos are using that (remember SPDY) • Server push has its own issues – What if client](https://reader034.vdocument.in/reader034/viewer/2022042110/5e8a58c701a42370e50d5c92/html5/thumbnails/24.jpg)
Copyright©2016,Oracleand/oritsaffiliates.Allrightsreserved.|
JavaAPIforWebSocket
• JSR356–PartofJavaEE7– 1.0(May2013)– 1.1(August2014)
• AnnotatedandprogrammaLcwayhowtodeployandaccessWebSocketendpoints• Event-drivenmodel-@OnOpen,@OnMessage,@OnError,@OnClose• Encoders/Decoders,Path/Queryparameterhandling,Handshakeheadersinterceptors,CDIintegraLon,…
![Page 25: Web protocols for Java Developers - RainFocus · – Doesn’t need to be image, but all cool demos are using that (remember SPDY) • Server push has its own issues – What if client](https://reader034.vdocument.in/reader034/viewer/2022042110/5e8a58c701a42370e50d5c92/html5/thumbnails/25.jpg)
Copyright©2016,Oracleand/oritsaffiliates.Allrightsreserved.|
JavaAPIforWebSocket–AnnotatedEndpoint
![Page 26: Web protocols for Java Developers - RainFocus · – Doesn’t need to be image, but all cool demos are using that (remember SPDY) • Server push has its own issues – What if client](https://reader034.vdocument.in/reader034/viewer/2022042110/5e8a58c701a42370e50d5c92/html5/thumbnails/26.jpg)
Copyright©2016,Oracleand/oritsaffiliates.Allrightsreserved.|
JavaAPIforWebSocket–ProgrammaLcEndpoint
![Page 27: Web protocols for Java Developers - RainFocus · – Doesn’t need to be image, but all cool demos are using that (remember SPDY) • Server push has its own issues – What if client](https://reader034.vdocument.in/reader034/viewer/2022042110/5e8a58c701a42370e50d5c92/html5/thumbnails/27.jpg)
Copyright©2016,Oracleand/oritsaffiliates.Allrightsreserved.|
WebSocketvsREST
• MightseemtobesimilarandsomepeopleeventhinkaboutWebSocketasaboutanother“RevoluLon”–likeSOAP-->REST• Inreality,thesearetwodifferentconceptswhichCOMPLEMENTeachother.• RESTmakesmoresenseforstandardwebpages,forms,…• WebSocketprovidesbi-direcLonalchannel,suitableforexchanging“short”messageswiththebrowser.– (thescopeisnotlimited,youcanre-implementallyourcommunicaLonwithserver,butthereisnopointindoingthat..)
27
![Page 28: Web protocols for Java Developers - RainFocus · – Doesn’t need to be image, but all cool demos are using that (remember SPDY) • Server push has its own issues – What if client](https://reader034.vdocument.in/reader034/viewer/2022042110/5e8a58c701a42370e50d5c92/html5/thumbnails/28.jpg)
Copyright©2016,Oracleand/oritsaffiliates.Allrightsreserved.|
EvoluLon–HTTP/2
• SamesemanLcsasHTTP/1.1• Binaryprotocol• MulLplexedcommunicaLon– SingleTCPconnecLontosingleorigin,sharedforconsequent/parallelrequests
• Compressedheaders– HTTP/2introducesHPACK(compressionalgorithm)
• ServerPush– Servercanpush(cacheable)contenttotheclientbeforeclientasks
HTTP/2KeyFeatures
28
![Page 29: Web protocols for Java Developers - RainFocus · – Doesn’t need to be image, but all cool demos are using that (remember SPDY) • Server push has its own issues – What if client](https://reader034.vdocument.in/reader034/viewer/2022042110/5e8a58c701a42370e50d5c92/html5/thumbnails/29.jpg)
Copyright©2016,Oracleand/oritsaffiliates.Allrightsreserved.|
EvoluLon–HTTP/2
29
Client Server
HTTP/2connecLon(singleTCPconnecLon)
HTTP/2streams
:methodGET:path/resource1
:methodGET:path/resourceX
![Page 30: Web protocols for Java Developers - RainFocus · – Doesn’t need to be image, but all cool demos are using that (remember SPDY) • Server push has its own issues – What if client](https://reader034.vdocument.in/reader034/viewer/2022042110/5e8a58c701a42370e50d5c92/html5/thumbnails/30.jpg)
Copyright©2016,Oracleand/oritsaffiliates.Allrightsreserved.|
WebSocketvsHTTP/2
• Pushedresourcesarecachedonclientside• Whenclientdecidesitneedssomething(image,..),itlooksintothecache– Doesn’tneedtobeimage,butallcooldemosareusingthat(rememberSPDY)
• Serverpushhasitsownissues– Whatifclientdoesnotneedpushedresource?(theremightbeothercaches,…)– ClientneedtoexplicitlystatethatitacceptsServerpush
• Pushisnotaninterac@vemessageexchange
WebSocketvsServerpush
30
![Page 31: Web protocols for Java Developers - RainFocus · – Doesn’t need to be image, but all cool demos are using that (remember SPDY) • Server push has its own issues – What if client](https://reader034.vdocument.in/reader034/viewer/2022042110/5e8a58c701a42370e50d5c92/html5/thumbnails/31.jpg)
Copyright©2016,Oracleand/oritsaffiliates.Allrightsreserved.|
SSEandHTTP/2
31
Client Server
HTTP/2connecLon(singleTCPconnecLon)
HTTP/2streams
:methodGET:path/sse
:methodPOST:path/events
:status200OKContent-type:text/event-stream
![Page 32: Web protocols for Java Developers - RainFocus · – Doesn’t need to be image, but all cool demos are using that (remember SPDY) • Server push has its own issues – What if client](https://reader034.vdocument.in/reader034/viewer/2022042110/5e8a58c701a42370e50d5c92/html5/thumbnails/32.jpg)
Copyright©2016,Oracleand/oritsaffiliates.Allrightsreserved.|
WebSocketandHTTP/2
Standards..
32
• Currently,WebSocketisnotdefinedinHTTP/2world• WebSocketusesUPGRADEheader,whichgivescompletecontroloverTCPconnecLon• HTTP/2StreamscouldsupportWSmulLplex
![Page 33: Web protocols for Java Developers - RainFocus · – Doesn’t need to be image, but all cool demos are using that (remember SPDY) • Server push has its own issues – What if client](https://reader034.vdocument.in/reader034/viewer/2022042110/5e8a58c701a42370e50d5c92/html5/thumbnails/33.jpg)
Copyright©2016,Oracleand/oritsaffiliates.Allrightsreserved.| 33
Usecases HTTP SSE
WebSockets
Chat
Sta@cpages
Forms
Games
Remotecontrol
Monitoring
Messaging/No@fica@on
XoverWS
Trackingprogress
Images,…
REST
![Page 34: Web protocols for Java Developers - RainFocus · – Doesn’t need to be image, but all cool demos are using that (remember SPDY) • Server push has its own issues – What if client](https://reader034.vdocument.in/reader034/viewer/2022042110/5e8a58c701a42370e50d5c92/html5/thumbnails/34.jpg)
Copyright©2016,Oracleand/oritsaffiliates.Allrightsreserved.|
Demo
34
![Page 35: Web protocols for Java Developers - RainFocus · – Doesn’t need to be image, but all cool demos are using that (remember SPDY) • Server push has its own issues – What if client](https://reader034.vdocument.in/reader034/viewer/2022042110/5e8a58c701a42370e50d5c92/html5/thumbnails/35.jpg)
Copyright©2016,Oracleand/oritsaffiliates.Allrightsreserved.|
Java9
• Replace“good”oldHbpURLConnecLon• JDK9–JEP110:HTTP/2Client:hbp://openjdk.java.net/jeps/110– DefineanewHTTPclientAPIthatimplementsHTTP/2andWebSocket,…
HTTP/REST&WebSocketclient
35
![Page 36: Web protocols for Java Developers - RainFocus · – Doesn’t need to be image, but all cool demos are using that (remember SPDY) • Server push has its own issues – What if client](https://reader034.vdocument.in/reader034/viewer/2022042110/5e8a58c701a42370e50d5c92/html5/thumbnails/36.jpg)
Copyright©2016,Oracleand/oritsaffiliates.Allrightsreserved.|
NextSteps
• Takethesurvey– hbp://glassfish.org/survey
• Sendtechnicalcommentsto– [email protected]
• JointheJCP–cometoHackergardeninJavaHub– hbps://jcp.org/en/parLcipaLon/membership_drive
• JoinortracktheJSRsastheyprogress– hbps://java.net/projects/javaee-spec/pages/SpecificaLons
• Adopt-a-JSR– hbps://community.oracle.com/community/java/jcp/adopt-a-jsr
Giveusyourfeedback
36
![Page 37: Web protocols for Java Developers - RainFocus · – Doesn’t need to be image, but all cool demos are using that (remember SPDY) • Server push has its own issues – What if client](https://reader034.vdocument.in/reader034/viewer/2022042110/5e8a58c701a42370e50d5c92/html5/thumbnails/37.jpg)
Copyright©2016,Oracleand/oritsaffiliates.Allrightsreserved.|
WheretoLearnMoreatJavaOne
37
SessionNumber SessionTitle Day/Time
CON1558 What'sNewintheJavaAPIforJSONBinding Monday5:30p.m
BOF7984 JavaEEfortheCloud Monday7:00p.m
CON4022 CDI2.0IsComing Tuesday11:00a.m
CON7983 JAX-RS2.1forJavaEE8 Tuesday12:30p.m
CON7980 Servlet4.0:StatusUpdateandHTTP/2 Tuesday4:00p.m
CON7978 SecurityforJavaEE8andtheCloud Tuesday5:30p.m
CON7979 ConfiguraLonforJavaEE8andtheCloud Wednesday11:30a.m
CON7977 JavaEENext–HTTP/2andREST Wednesday1:00p.m
CON6077 TheIllusionofStatelessness Wednesday4:30p.m
CON7981 JSF2.3 Thursday11:30a.m
![Page 38: Web protocols for Java Developers - RainFocus · – Doesn’t need to be image, but all cool demos are using that (remember SPDY) • Server push has its own issues – What if client](https://reader034.vdocument.in/reader034/viewer/2022042110/5e8a58c701a42370e50d5c92/html5/thumbnails/38.jpg)
Copyright©2016,Oracleand/oritsaffiliates.Allrightsreserved.|
Contacts/QA
• PavelBucek([email protected])• Jersey/JAX-RSRI:hbp://jersey.java.net– [email protected]
• Tyrus/WebSocketRI:hbp://tyrus.java.net– [email protected]
FeelfreetoaskanyquesLonsnoworcontactmelater.
38
![Page 39: Web protocols for Java Developers - RainFocus · – Doesn’t need to be image, but all cool demos are using that (remember SPDY) • Server push has its own issues – What if client](https://reader034.vdocument.in/reader034/viewer/2022042110/5e8a58c701a42370e50d5c92/html5/thumbnails/39.jpg)
![Page 40: Web protocols for Java Developers - RainFocus · – Doesn’t need to be image, but all cool demos are using that (remember SPDY) • Server push has its own issues – What if client](https://reader034.vdocument.in/reader034/viewer/2022042110/5e8a58c701a42370e50d5c92/html5/thumbnails/40.jpg)
![Page 41: Web protocols for Java Developers - RainFocus · – Doesn’t need to be image, but all cool demos are using that (remember SPDY) • Server push has its own issues – What if client](https://reader034.vdocument.in/reader034/viewer/2022042110/5e8a58c701a42370e50d5c92/html5/thumbnails/41.jpg)
Copyright©2016,Oracleand/oritsaffiliates.Allrightsreserved.|
WebSocketandClustering
• Differentto“classic”cluster– We’dliketotalktoothersessions(clients)directly
• Clusteredenvironmentpresentdifferentchallenges– “FindingaWebSocketSession”mightnotbeastrivialasitseem
• Broadcast(mass-noLficaLon)iscommonusecase• Clusteringcanhelp– BroadcasLngto“allsessions”canbefasterinclusteredenvironment
41
![Page 42: Web protocols for Java Developers - RainFocus · – Doesn’t need to be image, but all cool demos are using that (remember SPDY) • Server push has its own issues – What if client](https://reader034.vdocument.in/reader034/viewer/2022042110/5e8a58c701a42370e50d5c92/html5/thumbnails/42.jpg)
Copyright©2016,Oracleand/oritsaffiliates.Allrightsreserved.|
WebSocketandClustering
42
JMS,JCache,Coherence,… LoadBalancer
![Page 43: Web protocols for Java Developers - RainFocus · – Doesn’t need to be image, but all cool demos are using that (remember SPDY) • Server push has its own issues – What if client](https://reader034.vdocument.in/reader034/viewer/2022042110/5e8a58c701a42370e50d5c92/html5/thumbnails/43.jpg)
Copyright©2016,Oracleand/oritsaffiliates.Allrightsreserved.|
WebSocketandClustering
43
JMS,JCache,Coherence,… LoadBalancer
![Page 44: Web protocols for Java Developers - RainFocus · – Doesn’t need to be image, but all cool demos are using that (remember SPDY) • Server push has its own issues – What if client](https://reader034.vdocument.in/reader034/viewer/2022042110/5e8a58c701a42370e50d5c92/html5/thumbnails/44.jpg)
Copyright©2016,Oracleand/oritsaffiliates.Allrightsreserved.|
WebSocketandClustering
44
JMS,JCache,Coherence,… LoadBalancer
![Page 45: Web protocols for Java Developers - RainFocus · – Doesn’t need to be image, but all cool demos are using that (remember SPDY) • Server push has its own issues – What if client](https://reader034.vdocument.in/reader034/viewer/2022042110/5e8a58c701a42370e50d5c92/html5/thumbnails/45.jpg)
Copyright©2016,Oracleand/oritsaffiliates.Allrightsreserved.|
WebSocketandClustering
45
JMS,JCache,Coherence,… LoadBalancer
![Page 46: Web protocols for Java Developers - RainFocus · – Doesn’t need to be image, but all cool demos are using that (remember SPDY) • Server push has its own issues – What if client](https://reader034.vdocument.in/reader034/viewer/2022042110/5e8a58c701a42370e50d5c92/html5/thumbnails/46.jpg)
Copyright©2016,Oracleand/oritsaffiliates.Allrightsreserved.|
WebSocketandClustering
• Differentrequirements• LoadbalancersmightneedtomanagemoreopenconnecLons• Cannotre-balancewhensessionisalreadycreated– Nodeisadded–ok,butIcannoteasilydecreaseloadonothernodes,IcanusethenewnodeonlyfornewconnecLons
• Nodegoingdownisnottransparenttoclient– Robustclientscanhidethis,butfornow,thisrequirescustomsoluLon– WLS12.2.1offersasoluLonforthis..
46
![Page 47: Web protocols for Java Developers - RainFocus · – Doesn’t need to be image, but all cool demos are using that (remember SPDY) • Server push has its own issues – What if client](https://reader034.vdocument.in/reader034/viewer/2022042110/5e8a58c701a42370e50d5c92/html5/thumbnails/47.jpg)
Copyright©2016,Oracleand/oritsaffiliates.Allrightsreserved.|
WebSocketandClustering
47
JMS,JCache,Coherence,… LoadBalancer
![Page 48: Web protocols for Java Developers - RainFocus · – Doesn’t need to be image, but all cool demos are using that (remember SPDY) • Server push has its own issues – What if client](https://reader034.vdocument.in/reader034/viewer/2022042110/5e8a58c701a42370e50d5c92/html5/thumbnails/48.jpg)
Copyright©2016,Oracleand/oritsaffiliates.Allrightsreserved.|
WebSocketandClustering
48
JMS,JCache,Coherence,… LoadBalancer
![Page 49: Web protocols for Java Developers - RainFocus · – Doesn’t need to be image, but all cool demos are using that (remember SPDY) • Server push has its own issues – What if client](https://reader034.vdocument.in/reader034/viewer/2022042110/5e8a58c701a42370e50d5c92/html5/thumbnails/49.jpg)
Copyright©2016,Oracleand/oritsaffiliates.Allrightsreserved.|
WebSocketandClustering
• MightrequiremoreapplicaLoncode– Properhandlingonclientside– Evenmorecodewhenyouwanttohavesomethinglikeautoreconnect+“sessionrecovery”
• Infrastructurerequirements– SimilartoSSL(persistentconnecLon,…)
• MuchmoreeffecLvewhencomparedtothesameappimplementedusinglong-polling
49