Spring I/O: Designing for Distributed Systems with Reactor and Reactive Streams

As we move into a world where we serve millions of users who expect sub-second response times, we need new ways of building applications. This has led to the collection of proven practices under the Reactive Manifesto.

This specifies some core features of resilient apps, capable of scaling up and out:

  • Responsive: respond in a timely manner if at all possible
  • Resilient: the system is responsive even in the case of failure
  • Elastic: the system stays responsive under changes in workload, increasing or decreasing a service’s resources as needed
  • Message-driven: the system uses asynchronous message passing between components (including errors), enabling location transparency and loose coupling.

 

This was the subject of Stephane Maldini’s talk ‘Designing for Distributed Systems with Reactor and Reactive Streams’. Reactive Streams is ‘an initiative to provide a standard for asynchronous stream processing with non-blocking back pressure’. It is key to making sure that fast data sources don’t overwhelm the receiver, so that we at all times have a responsive application (even if that response is “I’m busy now, please call again later”).

There are a few implementations of Reactive Streams, one of them being Spring’s Reactor project. Other implementations include Akka Streams, Ratpack, MongoDB, Slick, RxJava, and Vert.x

Stephane showed an example class which used Akka Streams, Ratpack, Reactor and RxJava in the same stream, to demonstrate the interoperability of the different implementors:

 https://github.com/smaldini/ReactiveStreamsExamples/blob/master/src/main/java/org/reactivestreams/examples/Interop101.java

 

The main feature of Reactive Streams is the concept of ‘back pressure’: that the system pushes back to the sender if its request buffer is full, letting the sender try again later, or with some other receiver. This ensures that the pipeline isn’t flooded, and we have a better chance at getting a responsive system.

The was also a statement that the Spring Integration DSL will have support for Reactive Streams by just using .toReactiveStreamsPublisher() on defined IntegrationFlows, but I can’t find any code in the wild yet.

But if so: thumbsup!

UPDATE: Stephane pointed me to the pull request for SI DSL Reactive support, here: https://github.com/spring-projects/spring-integration-java-dsl/pull/31/files

Thanks!

Also, he will be in Stockholm for a free talk about this subject on at EMC office in Solna, Telegrafgatan 4, on June 17, for anyone else who wants to learn more.


A Holistic View on Developer Productivity

What does developer productivity mean, really? Is it churning out more code or less code? Is it to have less bugs in production or shipping code more often? Is it doing a lot of things or just one thing? Let’s think about this for a moment. I believe developer productivity is about getting more things […]


Improving the usability of Aftonbladet Video-clip pages

We have recently started the process of improving the usability of video-clip pages. In order to get an idea of where Aftonbladet stands compared to other world-class online video/news providers, we conducted an online test answered by 110 visitors of Aftonbladet TV. In this test we compared their perception of an Aftonbladet TV video-clip page […]


Schibsted’s 1st iOS Deployment Meet-up

Schibsted’s 1st iOS Deployment Meet-up Thursday, 28th of April 2016: getting to know each other, guests arrive Friday, 29th of April 2016: the meet-up date We here at Aftonbladet had been planning on having a meet-up with iOS developers across various Schibsted companies for many months. We had a range of topics in mind for […]


Hackday: The Future of Storytelling is social, engaging and rewarding

We gathered students, journalists, developers and designers to get together and conceptualize something new for the news industry. This was our first organized hack event – The Future of Storytelling Hack. The hack was a team-based, news-media-focused prototyping and experimentation event within storytelling over two days at Kungsbrohuset, Schibsted and Aftonbladets headquarter in Stockholm. A good story used to […]