Rossen Stoyanchev

Rossen Stoyanchev

Senior Staff Engineer, Pivotal


Rossen is a senior staff engineer at Pivotal focusing on web development. He is a committer on the core Spring Framework team responsible for the development of Spring MVC. Prior to that Rossen spent several years teaching and consulting clients building enterprise Java applications in a broad range of areas. His background also includes work on trading and risk management software, an investment accounting system, e-commerce applications, directory services among others.




Presentations

Intro To WebSocket Applications with Spring Framework 4.0

Last year's Intro to WebSocket presentation was as much about introducing WebSocket -- including specs, browser availability, server support -- as it was about summarizing short and long term challenges surrounding its use and leaving many open questions. What a world of difference a year can make!

This update to last year's presentation, covers the new standard Java WebSocket API (JSR-356) including a discussion of positives and limitations, an update on the current status of WebSocket support across Servlet containers, and of course the Spring Framework 4.0 WebSocket support -- how to configure and use it and what additional benefits it provides. A central part of this is Spring's support for SockJS, the protocol for transparent WebSocket fallback options for use in applications that for example need to run in IE < 10.

This presentation is for you if you want a comprehensive introduction to WebSocket including standard Java EE 7 and Spring Framework 4.0 support. For a more practical take on how to actually build WebSocket-style applications that skips the introduction, please attend the next presentation Building WebSocket Browser Applications with Spring by Rossen Stoyanchev and Scott Andrews, or attend both presentations. They are intended to be complementary.

Session Detail

Building WebSocket Browser Applications with Spring

This is a higher level presentation on how to build browser-based, WebSocket-style applications. If you prefer a proper introduction to WebSocket including RFC specs, browser support, JSR 356, Spring support, and more, attend the previous presentation Intro To WebSocket Applications with Spring Framework 4.0 or attend both sessions. They are meant to be complementary.

So, you've written a "Hello world!" WebSocket application or perhaps even a chat sample. You're able to exchange messages even in pre-Servlet 3.1 containers and pre-IE 10 browsers (that don't yet support WebSocket) thanks to the SockJS protocol and Spring's support for it. However a message is a blank page that can have any content. Whatever message format you choose, proprietary or standard, both client and server need to understand it as well as distinguish different kinds of messages. You need support for the publish-subscribe pattern, central to messaging applications so you can broadcast messages to a single subscriber, to a subset, or to all subscribers. You need to incorporate security, validation, and so on. In short you need to build a real-world application.

If you're used to web applications (and Spring MVC annotated controllers) you are familiar with the foundation that HTTP provides including URLs (nouns), HTTP methods (verbs), headers, parameters, and others. Imagine building an application without HTTP, just a socket. WebSocket gives you this brand new, exciting capability -- full duplex, two-way communication -- yet you no longer have an application-level protocol. Can an entire application be built around a single Endpoint class processing all messages, assuming a single WebSocket connection between browser and server?

Thankfully the WebSocket protocol has a built-in sub-protocol (i.e. higher level protocol) mechanism. In this presentation we'll introduce STOMP, an HTTP inspired simple messaging protocol, and Spring's support for building WebSocket-style messaging applications with it. We'll discuss the new spring-messaging module. We'll show how to map controller methods to client messages through annotations. We'll show how to back your application with a simple in-memory STOMP broker, or a full-scale one (Rabbit, ActiveMQ, etc). How to broadcast to connected clients including broadcasts from stateless HTTP requests. We'll show how to build client-side code using existing libraries such as stomp.js and also cujoJS msgs.js.

Session Detail