Early reactive solutions in Spring

We have previously mentioned that there are a lot of patterns and programming techniques that are capable of becoming building blocks for the reactive system. For example, callbacks and CompletableFuture are commonly used to implement the message-driven architecture. We also mentioned reactive programming as a prominent candidate for such a role. Before we explore this in more detail, we need to look around and find other solutions that we have already been using for years.

In Chapter 1, Why Reactive Spring?, we saw that Spring 4.x introduced the ListenableFuture class, which extends the Java Future and makes it possible to leverage the asynchronous execution of operations such as HTTP requests. Unfortunately, only a handful of Spring 4.x components support the newer Java 8 CompletableFuture, which introduces some neat methods for asynchronous execution composition.

Nevertheless, Spring Framework provides other bits of infrastructure that will be very useful for building our reactive application. Let's look through some of these features now.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.144.114.85