Building WebSocket and Server Side Events Applications using Atmosphere
1. Building WebSocket and Server Side Events
application using Atmosphere
JeanfrancoisArcand
twitter.com/jfarcand
facebook.com/jeanfrancois.arcand.3
2. Who I am?
Author of
Author of Grizzly GlassFish Micro
Framework Kernel
Author of AHC
HTTP/WebSocket
library
Author of
Atmosphere
10 years @
Sun
Microsystems
3. Atmosphere
Apache 2 Github ~900
« followers »
Client +
Supported server
by25
frameworks Scala, Groovy,
JRuby, Java
Depuis
60 000 unique
2008
download per months
1.0.9 /
1.1.beta2
4. Atmosphere
Apache 2 Github ~900
~1000 followers »
«
followerson Client +
Supported Twitter server
by25
frameworks Scala, Groovy,
~400 users
JRuby, Java
mailing list
Depuis
60 000 unique
2008
download per months
1.0.9 /
1.1.beta2
7. WebSockets
WebSocket is a web technology
providing full-duplex
communications channels over a
single TCP connection. The
WebSocket API is being
standardized by the W3C, and the
WebSocket protocol has been
standardized by the IETF as RFC
6455.
62. Go!!
Safari Tomcat
7
Firefox Jetty7
Jetty8
Chrome
GlassFis
Opera h3.
GlassFis
IE h
312
63. Free for all!
Safari Tomcat
7
Firefox Jetty7
Jetty8
Chrome
GlassFis
Opera h3.
GlassFis
IE h
312
64. Free for all!
Safari Tomcat
7
Firefox Jetty7
HELP Jetty8
Chrome
GlassFis
Opera h3.
GlassFis
IE h
312
65. Free for all!
Safari Tomcat
7
Streamin Jetty7
Firefox
g
Au Jetty8
Chrome
Secours
GlassFis
Opera !! h3.
GlassFis
IE h
312
66. Free for all!
Safari Tomcat
7
Streamin Jetty7
Firefox
g
Au SSE Jetty8
Chrome
Secours
GlassFis
Opera !! h3.
GlassFis
IE h
312
67. Free for all!
Safari Tomcat
7
Streamin Jetty7
Firefox
g
Au SSE Jetty8
Chrome
Secours
GlassFis
Opera !! JSONP
h3.
GlassFis
IE h
312
68. Free for all!
Safari Tomcat
7
Streamin Jetty7
Firefox
g
Au SSE Jetty8
Chrome
Secours
GlassFis
Opera !! JSONP
h3.
Long
GlassFis
IE Polling h
312
69. Safari Tomcat
7
Firefox Jetty7
Atmosphere
Chrome to the Jetty8
rescue!!! GlassFis
Opera h3.
GlassFis
IE h
312
70. Atmosphere -WebSockets
Safari Tomcat
7
Jetty7
Atmosphere API
Firefox
atmosphere.js
Jetty8
Chrome
GlassFis
Opera h3.
GlassFis
IE h
312
71. Atmosphere - HTML5 Server Side
Events
Safari Tomcat
7
Jetty7
Atmosphere API
Firefox
atmosphere.js
Servlet
Chrome
3
WebLogi
Opera c
GlassFis
IE h
312
72. Atmosphere Long-Polling/HTTP
Streaming
Safari JBoss
Jetty7
Atmosphere API
Firefox
atmosphere.js
Servlet
Chrome
3
WebLogi
Opera c.
GlassFis
IE h
73. Atmosphere
Safari JBoss
Jetty7
Atmosphere API
Firefox
atmosphere.js
One API to
Chrome rule them all Servlet
3
WebLogi
Opera c.
GlassFis
IE h
74. Socket.IO, GWT, Wicket, JSF, etc.
Safari JBoss
Jetty7
Atmosphere API
Firefox
Socket.IO
Servlet
Chrome
3
WebLogi
Opera c.
GlassFis
IE h
75. PORTABLE!!!!!
Safari JBoss
Jetty7
Atmosphere API
Firefox
Socket.IO
PORTABLE Servlet
Chrome
3
WebLogi
Opera c.
GlassFis
IE h
92. Atmosphere Components
• WebSocketHandler
• Only WebSocket (WARNING)!
• AtmosphereHandler
• All transports
• Jersey Resource
• All transports
• Meteor
• All transports
94. WebSocket Sub Protocol
• WebSocketProtocol
Define your own protocol on top of
WebSocket
• Default:
WebSocket message => POST
• SwaggerSocket:REST over
WebSockets -> More information