SlideShare a Scribd company logo
{CJUG}

WebSockets in Java
Jonathan Freeman
@freethejazz
{Open Software Integrators} { www.osintegrators.com} {@osintegrators}
WebSockets in Java

Open Software Integrators
●

Jonathan Freeman
@freethejazz

Founded January 2008 by Andrew C. Oliver
○ Durham, NC

Revenue and staff has at least doubled every year since
2009.
●

New office (2012) in Chicago, IL
○ We're hiring associate to senior level as well as UI Developers
(JQuery, Javascript, HTML, CSS)
○ Up to 50% travel (probably less), salary + bonus, 401k, health,
etc etc
○ Preferred: Java, Tomcat, JBoss, Hibernate, Spring, RDBMS,
JQuery
○ Nice to have: Hadoop, Neo4j, MongoDB, Ruby a/o at least one
Cloud platform

{Open Software Integrators} { www.osintegrators.com} {@osintegrators}
WebSockets in Java

Overview

Jonathan Freeman
@freethejazz

● Gradients of client server communication
● Intro to WebSockets
● Implementing WebSockets

{Open Software Integrators} { www.osintegrators.com} {@osintegrators}
{WebSockets in Java}

Client/Server
Communication

{Open Software Integrators} { www.osintegrators.com} {@osintegrators}
WebSockets in Java
Jonathan Freeman
@freethejazz

Basic Web Applications

{Open Software Integrators} { www.osintegrators.com} {@osintegrators}
WebSockets in Java
Jonathan Freeman
@freethejazz

{Open Software Integrators} { www.osintegrators.com} {@osintegrators}
WebSockets in Java
Jonathan Freeman
@freethejazz

Pros
●
●
●

Simple
Client gets what it wants(and when)
Minimal interaction between the server and the client

For the server, this is a highly reactive model. Sits around waiting until it gets a request, then
delivers back whatever is needed.

Cons
●
●

Server cannot initiate the communication, only the client
new client request == new page load

{Open Software Integrators} { www.osintegrators.com} {@osintegrators}
WebSockets in Java
Jonathan Freeman
@freethejazz

How do we add more interaction
between the client and the server?

{Open Software Integrators} { www.osintegrators.com} {@osintegrators}
WebSockets in Java
Jonathan Freeman
@freethejazz

Variations on the basic model
● AJAX
● Long-Polling
New models
● SSE
● WebSockets

{Open Software Integrators} { www.osintegrators.com} {@osintegrators}
WebSockets in Java
Jonathan Freeman
@freethejazz

AJAX

{Open Software Integrators} { www.osintegrators.com} {@osintegrators}
WebSockets in Java
Jonathan Freeman
@freethejazz

{Open Software Integrators} { www.osintegrators.com} {@osintegrators}
WebSockets in Java
Jonathan Freeman
@freethejazz

Pros
●
●
●
●
●

Simple
Client gets what it wants(and when)
Minimal interaction between the server and the client
Piecemeal approach adds value to the client
Client can update based on the response from the server without loading a new page.

For the server, this is a still highly reactive model. Sits around waiting until it gets a request, then
delivers back whatever is needed.

Cons
●
●

Server cannot initiate the communication
New client request != new page load

{Open Software Integrators} { www.osintegrators.com} {@osintegrators}
WebSockets in Java
Jonathan Freeman
@freethejazz

Long Polling

{Open Software Integrators} { www.osintegrators.com} {@osintegrators}
WebSockets in Java
Jonathan Freeman
@freethejazz

{Open Software Integrators} { www.osintegrators.com} {@osintegrators}
WebSockets in Java
Jonathan Freeman
@freethejazz

Pros
●

Emulating a more real-time communication model from server to client.

Cons
●
●

Dealing with more longer and repeated connections, so you’ll have to account for that
It’s kind of a hack.

{Open Software Integrators} { www.osintegrators.com} {@osintegrators}
WebSockets in Java
Jonathan Freeman
@freethejazz

Server-Sent Events

{Open Software Integrators} { www.osintegrators.com} {@osintegrators}
WebSockets in Java
Jonathan Freeman
@freethejazz

{Open Software Integrators} { www.osintegrators.com} {@osintegrators}
WebSockets in Java
Jonathan Freeman
@freethejazz

Pros
●

A real-time communication model from server to client

Cons
●

Communication is only one way

{Open Software Integrators} { www.osintegrators.com} {@osintegrators}
Intro to WebSockets (in Java)
{WebSockets in Java}

Intro to
WebSockets

{Open Software Integrators} { www.osintegrators.com} {@osintegrators}
WebSockets in Java
Jonathan Freeman
@freethejazz

{Open Software Integrators} { www.osintegrators.com} {@osintegrators}
WebSockets in Java
Jonathan Freeman
@freethejazz

Pros
●

A real-time communication model

Cons
●
●
●

May be overkill for your particular application
Spec still being defined
Security vulnerabilities in previous implementation

{Open Software Integrators} { www.osintegrators.com} {@osintegrators}
Intro to WebSockets (in Java)
WebSockets in Java
Jonathan Freeman
@freethejazz

Why use WebSockets?

{Open Software Integrators} { www.osintegrators.com} {@osintegrators}
WebSockets in Java
Jonathan Freeman
@freethejazz

●
●
●
●

Chat applications
Instagram-like applications(social streams)
Financial tickers
Multiplayer games

{Open Software Integrators} { www.osintegrators.com} {@osintegrators}
{WebSockets in Java}

Implementing
WebSockets

{Open Software Integrators} { www.osintegrators.com} {@osintegrators}
WebSockets in Java
Jonathan Freeman
@freethejazz

1. Create an endpoint class
(programmatic or annotated)
2. Override/annotate the lifecycle methods
(depending on how you create the endpoint)
3. Add your business logic
4. Deploy!

{Open Software Integrators} { www.osintegrators.com} {@osintegrators}
WebSockets in Java
Jonathan Freeman
@freethejazz
Creating the endpoint class
public class MyWebSocketEndoint extends Endpoint {
@Override
public void onOpen(final Session session, EndpointConfig config) {
session.addMessageHandler(new MessageHandler.Whole<String>() {
@Override
public void onMessage(String msg) {
try {
session.getBasicRemote().sendText(msg);
} catch (IOException e) { ... }
}
});
}
}
{Open Software Integrators} { www.osintegrators.com} {@osintegrators}
WebSockets in Java
Jonathan Freeman
@freethejazz

MessageHandler methods to override:
onMessage

{Open Software Integrators} { www.osintegrators.com} {@osintegrators}
WebSockets in Java
Jonathan Freeman
@freethejazz

ServerEndpointConfig.Builder.create(MySocketEndpoint.class,
"/mywebsocket").build();

{Open Software Integrators} { www.osintegrators.com} {@osintegrators}
WebSockets in Java
Jonathan Freeman
@freethejazz
Creating the endpoint class
@ServerEndpoint("/mywebsocket")
public class MyWebSocketEndpoint {
@OnMessage
public void onMessage(Session session, String message) {
try {
//to do some work
} catch (IOException e) { ... }
}
}

{Open Software Integrators} { www.osintegrators.com} {@osintegrators}
WebSockets in Java
Jonathan Freeman
@freethejazz

Possible Annotations:
@OnOpen
@OnMessage
@OnError
@OnClose

{Open Software Integrators} { www.osintegrators.com} {@osintegrators}
WebSockets in Java
Jonathan Freeman
@freethejazz
Sending a response to a single client
@ServerEndpoint("/mywebsocket")
public class MyWebSocketEndpoint {
@OnMessage
public void onMessage(Session session, String message) {
RemoteEndpoint remote = session.getBasicRemote();
try {
remote.sendText(message);
} catch (IOException e) { ... }
}
}

{Open Software Integrators} { www.osintegrators.com} {@osintegrators}
WebSockets in Java
Jonathan Freeman
@freethejazz
Sending a response to all connected clients
@ServerEndpoint("/mywebsocket")
public class MyWebSocketEndpoint {
@OnMessage
public void onMessage(Session session, String message) {
try {
for (Session sess : session.getOpenSessions()) {
if (sess.isOpen())
sess.getBasicRemote().sendText(message);
}
} catch (IOException e) { ... }
}
}

{Open Software Integrators} { www.osintegrators.com} {@osintegrators}
WebSockets in Java
Jonathan Freeman
@freethejazz

In Spring 4...

{Open Software Integrators} { www.osintegrators.com} {@osintegrators}
WebSockets in Java
Jonathan Freeman
@freethejazz

@Controller
public class MyWebSocketController {
@RequestMapping(value=”/mywebsocket”, method=POST)
public void overHttp(String text) {
// ...
}
@MessageMapping("/mywebsocket")
public void overStomp(String text) {
// ...
}
}

http://blog.gopivotal.com/products/websocket-architecture-in-spring-4-0
http://assets.spring.io/wp/WebSocketBlogPost.html

{Open Software Integrators} { www.osintegrators.com} {@osintegrators}
WebSockets in Java
Jonathan Freeman
@freethejazz

References:
https://www.openshift.com/blogs/how-to-build-java-websocket-applications-using-the-jsr-356-api
http://docs.oracle.com/javaee/7/tutorial/doc/websocket.htm

{Open Software Integrators} { www.osintegrators.com} {@osintegrators}
WebSockets in Java
Jonathan Freeman
@freethejazz
Image Attribution:
client-server communication diagrams: http://stackoverflow.com/questions/11077857/what-are-longpolling-websockets-server-sent-events-sse-and-comet

{Open Software Integrators} { www.osintegrators.com} {@osintegrators}
{WebSockets in Java}

Thank You

{Open Software Integrators} { www.osintegrators.com} {@osintegrators}

More Related Content

PDF
Usability in the GeoWeb
PDF
Create a meteor chat app in 30 minutes
ODP
code-camp-meteor
PPT
PPT
Developing PHP Web Applications with the Raxan Framework
PDF
Hackathon - Building vaadin add on components
PDF
The web - What it has, what it lacks and where it must go - Istanbul
ODP
WebTest - Efficient Functional Web Testing with HtmlUnit and Beyond
Usability in the GeoWeb
Create a meteor chat app in 30 minutes
code-camp-meteor
Developing PHP Web Applications with the Raxan Framework
Hackathon - Building vaadin add on components
The web - What it has, what it lacks and where it must go - Istanbul
WebTest - Efficient Functional Web Testing with HtmlUnit and Beyond

What's hot (20)

PPTX
What is HTML 5?
PPTX
Razor into the Razor'verse
PPTX
Html web workers
PDF
Overview of React.JS - Internship Presentation - Week 5
PDF
HTML5 for PHP Developers - IPC
PPTX
Goodbye JavaScript Hello Blazor
PDF
Simple todo app with meteor
KEY
HTML5: what's new?
PDF
Polytechnic 1.0 Granada
PDF
Understanding progressive enhancement - yuiconf2010
PPTX
High Performance JavaScript (CapitolJS 2011)
PPT
Pragmatic Parallels: Java and JavaScript
PPTX
Blazor Full-Stack
PPTX
DODN2009 - Jump Start Silverlight
PPTX
eCommerce performance, what is it costing you and what can you do about it?
PDF
How to make Ajax work for you
PDF
Ditching jQuery Madison
PPT
Grails and Dojo
PDF
Don't make me wait! or Building High-Performance Web Applications
ODP
Passo a Passo para criar uma aplicação Móvel Híbrida
What is HTML 5?
Razor into the Razor'verse
Html web workers
Overview of React.JS - Internship Presentation - Week 5
HTML5 for PHP Developers - IPC
Goodbye JavaScript Hello Blazor
Simple todo app with meteor
HTML5: what's new?
Polytechnic 1.0 Granada
Understanding progressive enhancement - yuiconf2010
High Performance JavaScript (CapitolJS 2011)
Pragmatic Parallels: Java and JavaScript
Blazor Full-Stack
DODN2009 - Jump Start Silverlight
eCommerce performance, what is it costing you and what can you do about it?
How to make Ajax work for you
Ditching jQuery Madison
Grails and Dojo
Don't make me wait! or Building High-Performance Web Applications
Passo a Passo para criar uma aplicação Móvel Híbrida
Ad

Similar to Intro to WebSockets (in Java) (20)

PPTX
WebSockets in JEE 7
PDF
WebSocket Perspectives and Vision for the Future
PDF
Java API for WebSocket 1.0: Java EE 7 and GlassFish
PDF
Getting Started with WebSocket and Server-Sent Events using Java - Arun Gupta...
PDF
Getting Started with WebSockets and Server-Sent Events
PPTX
Training Webinar: Enterprise application performance with server push technol...
PDF
WebSockets - Realtime em Mundo Conectado
PDF
Getting Started with WebSocket and Server-Sent Events using Java by Arun Gupta
PPTX
Enhancing Mobile User Experience with WebSocket
PDF
Getting started with Websocket and Server-sent Events using Java - Arun Gupta
PPTX
Web Sockets are not Just for Web Browsers
PPT
A java servers
PDF
A java servers
PDF
Getting Started with WebSocket and Server-Sent Events in Java
KEY
The HTML5 WebSocket API
PPTX
Programming WebSockets with Glassfish and Grizzly
PPTX
Client server chat application
PDF
Building interactivity with websockets
PPTX
Fight empire-html5
PDF
WebSockets: The Current State of the Most Valuable HTML5 API for Java Developers
WebSockets in JEE 7
WebSocket Perspectives and Vision for the Future
Java API for WebSocket 1.0: Java EE 7 and GlassFish
Getting Started with WebSocket and Server-Sent Events using Java - Arun Gupta...
Getting Started with WebSockets and Server-Sent Events
Training Webinar: Enterprise application performance with server push technol...
WebSockets - Realtime em Mundo Conectado
Getting Started with WebSocket and Server-Sent Events using Java by Arun Gupta
Enhancing Mobile User Experience with WebSocket
Getting started with Websocket and Server-sent Events using Java - Arun Gupta
Web Sockets are not Just for Web Browsers
A java servers
A java servers
Getting Started with WebSocket and Server-Sent Events in Java
The HTML5 WebSocket API
Programming WebSockets with Glassfish and Grizzly
Client server chat application
Building interactivity with websockets
Fight empire-html5
WebSockets: The Current State of the Most Valuable HTML5 API for Java Developers
Ad

Recently uploaded (20)

PDF
Spectral efficient network and resource selection model in 5G networks
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PDF
Electronic commerce courselecture one. Pdf
PPTX
A Presentation on Artificial Intelligence
PDF
Reach Out and Touch Someone: Haptics and Empathic Computing
PDF
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
PDF
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
PPTX
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
PPTX
sap open course for s4hana steps from ECC to s4
PDF
Encapsulation_ Review paper, used for researhc scholars
PPTX
Digital-Transformation-Roadmap-for-Companies.pptx
PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
PPTX
Big Data Technologies - Introduction.pptx
PDF
NewMind AI Weekly Chronicles - August'25-Week II
PPT
“AI and Expert System Decision Support & Business Intelligence Systems”
PPTX
Programs and apps: productivity, graphics, security and other tools
PDF
Advanced methodologies resolving dimensionality complications for autism neur...
PDF
MIND Revenue Release Quarter 2 2025 Press Release
PDF
Unlocking AI with Model Context Protocol (MCP)
PPTX
MYSQL Presentation for SQL database connectivity
Spectral efficient network and resource selection model in 5G networks
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
Electronic commerce courselecture one. Pdf
A Presentation on Artificial Intelligence
Reach Out and Touch Someone: Haptics and Empathic Computing
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
sap open course for s4hana steps from ECC to s4
Encapsulation_ Review paper, used for researhc scholars
Digital-Transformation-Roadmap-for-Companies.pptx
Diabetes mellitus diagnosis method based random forest with bat algorithm
Big Data Technologies - Introduction.pptx
NewMind AI Weekly Chronicles - August'25-Week II
“AI and Expert System Decision Support & Business Intelligence Systems”
Programs and apps: productivity, graphics, security and other tools
Advanced methodologies resolving dimensionality complications for autism neur...
MIND Revenue Release Quarter 2 2025 Press Release
Unlocking AI with Model Context Protocol (MCP)
MYSQL Presentation for SQL database connectivity

Intro to WebSockets (in Java)

  • 1. {CJUG} WebSockets in Java Jonathan Freeman @freethejazz {Open Software Integrators} { www.osintegrators.com} {@osintegrators}
  • 2. WebSockets in Java Open Software Integrators ● Jonathan Freeman @freethejazz Founded January 2008 by Andrew C. Oliver ○ Durham, NC Revenue and staff has at least doubled every year since 2009. ● New office (2012) in Chicago, IL ○ We're hiring associate to senior level as well as UI Developers (JQuery, Javascript, HTML, CSS) ○ Up to 50% travel (probably less), salary + bonus, 401k, health, etc etc ○ Preferred: Java, Tomcat, JBoss, Hibernate, Spring, RDBMS, JQuery ○ Nice to have: Hadoop, Neo4j, MongoDB, Ruby a/o at least one Cloud platform {Open Software Integrators} { www.osintegrators.com} {@osintegrators}
  • 3. WebSockets in Java Overview Jonathan Freeman @freethejazz ● Gradients of client server communication ● Intro to WebSockets ● Implementing WebSockets {Open Software Integrators} { www.osintegrators.com} {@osintegrators}
  • 4. {WebSockets in Java} Client/Server Communication {Open Software Integrators} { www.osintegrators.com} {@osintegrators}
  • 5. WebSockets in Java Jonathan Freeman @freethejazz Basic Web Applications {Open Software Integrators} { www.osintegrators.com} {@osintegrators}
  • 6. WebSockets in Java Jonathan Freeman @freethejazz {Open Software Integrators} { www.osintegrators.com} {@osintegrators}
  • 7. WebSockets in Java Jonathan Freeman @freethejazz Pros ● ● ● Simple Client gets what it wants(and when) Minimal interaction between the server and the client For the server, this is a highly reactive model. Sits around waiting until it gets a request, then delivers back whatever is needed. Cons ● ● Server cannot initiate the communication, only the client new client request == new page load {Open Software Integrators} { www.osintegrators.com} {@osintegrators}
  • 8. WebSockets in Java Jonathan Freeman @freethejazz How do we add more interaction between the client and the server? {Open Software Integrators} { www.osintegrators.com} {@osintegrators}
  • 9. WebSockets in Java Jonathan Freeman @freethejazz Variations on the basic model ● AJAX ● Long-Polling New models ● SSE ● WebSockets {Open Software Integrators} { www.osintegrators.com} {@osintegrators}
  • 10. WebSockets in Java Jonathan Freeman @freethejazz AJAX {Open Software Integrators} { www.osintegrators.com} {@osintegrators}
  • 11. WebSockets in Java Jonathan Freeman @freethejazz {Open Software Integrators} { www.osintegrators.com} {@osintegrators}
  • 12. WebSockets in Java Jonathan Freeman @freethejazz Pros ● ● ● ● ● Simple Client gets what it wants(and when) Minimal interaction between the server and the client Piecemeal approach adds value to the client Client can update based on the response from the server without loading a new page. For the server, this is a still highly reactive model. Sits around waiting until it gets a request, then delivers back whatever is needed. Cons ● ● Server cannot initiate the communication New client request != new page load {Open Software Integrators} { www.osintegrators.com} {@osintegrators}
  • 13. WebSockets in Java Jonathan Freeman @freethejazz Long Polling {Open Software Integrators} { www.osintegrators.com} {@osintegrators}
  • 14. WebSockets in Java Jonathan Freeman @freethejazz {Open Software Integrators} { www.osintegrators.com} {@osintegrators}
  • 15. WebSockets in Java Jonathan Freeman @freethejazz Pros ● Emulating a more real-time communication model from server to client. Cons ● ● Dealing with more longer and repeated connections, so you’ll have to account for that It’s kind of a hack. {Open Software Integrators} { www.osintegrators.com} {@osintegrators}
  • 16. WebSockets in Java Jonathan Freeman @freethejazz Server-Sent Events {Open Software Integrators} { www.osintegrators.com} {@osintegrators}
  • 17. WebSockets in Java Jonathan Freeman @freethejazz {Open Software Integrators} { www.osintegrators.com} {@osintegrators}
  • 18. WebSockets in Java Jonathan Freeman @freethejazz Pros ● A real-time communication model from server to client Cons ● Communication is only one way {Open Software Integrators} { www.osintegrators.com} {@osintegrators}
  • 20. {WebSockets in Java} Intro to WebSockets {Open Software Integrators} { www.osintegrators.com} {@osintegrators}
  • 21. WebSockets in Java Jonathan Freeman @freethejazz {Open Software Integrators} { www.osintegrators.com} {@osintegrators}
  • 22. WebSockets in Java Jonathan Freeman @freethejazz Pros ● A real-time communication model Cons ● ● ● May be overkill for your particular application Spec still being defined Security vulnerabilities in previous implementation {Open Software Integrators} { www.osintegrators.com} {@osintegrators}
  • 24. WebSockets in Java Jonathan Freeman @freethejazz Why use WebSockets? {Open Software Integrators} { www.osintegrators.com} {@osintegrators}
  • 25. WebSockets in Java Jonathan Freeman @freethejazz ● ● ● ● Chat applications Instagram-like applications(social streams) Financial tickers Multiplayer games {Open Software Integrators} { www.osintegrators.com} {@osintegrators}
  • 26. {WebSockets in Java} Implementing WebSockets {Open Software Integrators} { www.osintegrators.com} {@osintegrators}
  • 27. WebSockets in Java Jonathan Freeman @freethejazz 1. Create an endpoint class (programmatic or annotated) 2. Override/annotate the lifecycle methods (depending on how you create the endpoint) 3. Add your business logic 4. Deploy! {Open Software Integrators} { www.osintegrators.com} {@osintegrators}
  • 28. WebSockets in Java Jonathan Freeman @freethejazz Creating the endpoint class public class MyWebSocketEndoint extends Endpoint { @Override public void onOpen(final Session session, EndpointConfig config) { session.addMessageHandler(new MessageHandler.Whole<String>() { @Override public void onMessage(String msg) { try { session.getBasicRemote().sendText(msg); } catch (IOException e) { ... } } }); } } {Open Software Integrators} { www.osintegrators.com} {@osintegrators}
  • 29. WebSockets in Java Jonathan Freeman @freethejazz MessageHandler methods to override: onMessage {Open Software Integrators} { www.osintegrators.com} {@osintegrators}
  • 30. WebSockets in Java Jonathan Freeman @freethejazz ServerEndpointConfig.Builder.create(MySocketEndpoint.class, "/mywebsocket").build(); {Open Software Integrators} { www.osintegrators.com} {@osintegrators}
  • 31. WebSockets in Java Jonathan Freeman @freethejazz Creating the endpoint class @ServerEndpoint("/mywebsocket") public class MyWebSocketEndpoint { @OnMessage public void onMessage(Session session, String message) { try { //to do some work } catch (IOException e) { ... } } } {Open Software Integrators} { www.osintegrators.com} {@osintegrators}
  • 32. WebSockets in Java Jonathan Freeman @freethejazz Possible Annotations: @OnOpen @OnMessage @OnError @OnClose {Open Software Integrators} { www.osintegrators.com} {@osintegrators}
  • 33. WebSockets in Java Jonathan Freeman @freethejazz Sending a response to a single client @ServerEndpoint("/mywebsocket") public class MyWebSocketEndpoint { @OnMessage public void onMessage(Session session, String message) { RemoteEndpoint remote = session.getBasicRemote(); try { remote.sendText(message); } catch (IOException e) { ... } } } {Open Software Integrators} { www.osintegrators.com} {@osintegrators}
  • 34. WebSockets in Java Jonathan Freeman @freethejazz Sending a response to all connected clients @ServerEndpoint("/mywebsocket") public class MyWebSocketEndpoint { @OnMessage public void onMessage(Session session, String message) { try { for (Session sess : session.getOpenSessions()) { if (sess.isOpen()) sess.getBasicRemote().sendText(message); } } catch (IOException e) { ... } } } {Open Software Integrators} { www.osintegrators.com} {@osintegrators}
  • 35. WebSockets in Java Jonathan Freeman @freethejazz In Spring 4... {Open Software Integrators} { www.osintegrators.com} {@osintegrators}
  • 36. WebSockets in Java Jonathan Freeman @freethejazz @Controller public class MyWebSocketController { @RequestMapping(value=”/mywebsocket”, method=POST) public void overHttp(String text) { // ... } @MessageMapping("/mywebsocket") public void overStomp(String text) { // ... } } http://blog.gopivotal.com/products/websocket-architecture-in-spring-4-0 http://assets.spring.io/wp/WebSocketBlogPost.html {Open Software Integrators} { www.osintegrators.com} {@osintegrators}
  • 37. WebSockets in Java Jonathan Freeman @freethejazz References: https://www.openshift.com/blogs/how-to-build-java-websocket-applications-using-the-jsr-356-api http://docs.oracle.com/javaee/7/tutorial/doc/websocket.htm {Open Software Integrators} { www.osintegrators.com} {@osintegrators}
  • 38. WebSockets in Java Jonathan Freeman @freethejazz Image Attribution: client-server communication diagrams: http://stackoverflow.com/questions/11077857/what-are-longpolling-websockets-server-sent-events-sse-and-comet {Open Software Integrators} { www.osintegrators.com} {@osintegrators}
  • 39. {WebSockets in Java} Thank You {Open Software Integrators} { www.osintegrators.com} {@osintegrators}