Posts by Richard Rijnberk

A introduction to websockets.

Posted on by  
Richard Rijnberk

To make a long story short websockets allow us to create a pipeline between a web client and a server. Which is great because we can push and pull all kind of data through it. This in turn allows us to create highly responsive web applications that may update information over multiple sessions. Sound awesome doesn’t it. There’s just one catch, and you can probably guess what it is. That’s right, it’s not universally accepted by all browser or containers. Worse yet, most browsers that are currently in use have very poor to no support for it yet. And the same can be said for quite the percentage of web containers out there. Luckily we can use SocksJS. This library actually checks if it is possible to set up a websocket. And, when this is not the case, sets up a default fallback. This means that if a websocket connection cannot be created the SocksJS implementation will fall back to long pulling. Giving us the same behavior as before only at a higher performance cost. The SocksJS api is the same as the one for websockets. This allows us to change from a websockets implementation to a SocksJS implementation with minimal changes. So if you want to create a highly responsive webapp which updates as soon as new information arrives SocksJS is the way to go.

Continue reading →

Day two of the SpringOne 2GX in Washington.

Posted on by  
Richard Rijnberk

It was a full day starting with breakfast and 5 one and a half hour long presentations followed by dinner and a keynote delivered by Adrian Colyer, CTO of SpringSource. The keynote was on how application architecture has evolved over the last 10 years towards what it has become today. We started out with a static frontend client that communicated with a service layer, which in turn persisted to a database. Nowadays we have rich clients, multiple services in our service tier that in turn connect to services, websockets and/or other data sources. He proceeded to show his application, slowly scaling it up from one isolated environment into a cloud solution and from there into a multi cloud solution using brokers for each cloud region. From this he explained the use of auto scaling workers in a message queue and the advantages this mechanism has in relation to bandwith, throughput and latency. During his presentation he used scriptIt, which is a new browser based javascript editor that was released recently. He was enthusiastic about it due to its ability to follow declarations and support for auto completion. Another tool he was adamant about was a REST service console that allows reading and the exercise of calls that alter the state of the service. It is a great tool for seeing what goes on under the hood. For the code featured in this keynote see: github

Continue reading →

Keynote SpringOne 2GX

Posted on by  
Richard Rijnberk

Juergen Hoeller Hoeller begint zijn presentatie met de originele driehoek van spring. Zijn verhaal beschrijft vervolgens de transitie die het framework heeft gemaakt sinds dat model naar een annotation framework. Hij legt de nadruk vooral ook bij de beschrijvende namen van de annotaties, en hoe ze zorgvuldig zijn gekozen om de code leesbaarder te maken. Hierbij gaat hij dieper in op een aantalannotaties zoals stereotypes, injections en ook parameter annotaties. Hierbij geeft hij aan het gevoel te hebben dat de kracht van deze annotaties nog steeds wel onderschat wordt. Hoeller verteld hierna hoe er in de laatste tijd is gewerkt aan de WebApplicationInitialiser om xml configuraties zoals de web.xml iets van het verleden te maken. Hij gaat vervolgens in op de @configuration annotation en de manier waarop in deze configuratie classes gescanned kan worden op het classpath om filters en beans te injecten in de app. Dit soort Java based configuratie zorgt er voor dat xml configuraties zoals de persistance XML niet meer nodig zijn.

Continue reading →

shadow-left