Separation of Reactive and Non-Reactive Code

One of the most important distinctions to keep in mind when working with Project Reactor or any other reactive streams implementation is the difference between assembly-time vs. subscription-time in code execution. 

Regardless of your level of experience with reactive programming, odds are you’ve already encountered the famous:

Reactive Microservices – 1

Prologue

The term reactive is ubiquitous. Everything from architecture to frameworks, to the general concepts, seems to refer to this term. Quite obviously, reactive has assumed many meanings and definitions and can be understood under a certain context. This article aims to dive deep into what being reactive means and to explore the various contexts where this idea is used. In particular, the article aims to explore the relationship between microservices and reactive and attempt to define what reactive microservices are.

Reactive Systems — Introduction

The operating environment of enterprises today has complexity as a norm. Cloud Computing, Multiple device types (desktops, mobile devices, wearables, Sensors, Gaming Consoles, Smart Homes), near-zero downtime, low latency & petabytes of data processing are few characteristics that have led to a world of services where the experience and expectations of a consumer have changed. In addition, the number of users has increased manifold and these users are always connected.

BlockHound: How it Works

One of the talks in my current portfolio is Migrating from Imperative to Reactive. The talk is based on a demo migrating from Spring WebMVC to Spring WebFlux in a step-by-step approach. One of the steps involves installing BlockHound: it allows to check whether a blocking call occurs in a thread it shouldn't happen and throws an exception at runtime when it happens.

I've presented this talk several times in the previous week, both in its Java version and its Kotlin one. One such presentation was at Javaday Istanbul. After the talk, one of the questions I received was, "How does BlockHound work?" I admit that at the time, I couldn't remember. After the surprise had passed, but too late, I remembered it involved a Java agent. But I wanted to go down the rabbit hole.

WebFlux: Reactive Programming With Spring, Part 3

This is the third part of my blog series on reactive programming, which will give an introduction to WebFlux — Spring’s reactive web framework.

1. An Introduction to Spring Webflux

The original web framework for Spring — Spring Web MVC — was built for the Servlet API and Servlet containers.

HTTP for Inter-Service Communication?

After the evolution of distributed systems, microservices-based applications attracted the interest of nearly every organization wanting to grow with time and survive the market competition. Microservices allows us to scale and manage systems easily. Development time reduced due to distributed effort among many teams and time-to-market new features reduced significantly.

Due to distributed nature, communication among different components is over the network. And there are so many factors that can affect communication, either it can be security, added latency, or abrupt termination of ongoing communication, leading to increased infrastructure cost. Hence either we can fix the network, which exists with numerous problems or we can architect our system to be resilient and reliable over time.

MuleSoft (Event-Based Process) With Enhanced Execution Engine

To opt benefits of asynchronous processes, MuleSoft has introduced thread management which has no dependency on the configuration. It works based on available resources on platforms.

MuleSoft follows and recommends an asynchronous process hence came with an event-based approach along with an asynchronous approach. It allows the application to be more responsive by not waiting for long processes like your I/O processes to finish.

Leaning Towards Reactive Architecture

Why Reactive Architecture?

Reactive Architecture aims to provide software that remains responsive in all situations. Reactive Systems build user confidence by ensuring that the application is available whenever the users need it in all conditions.

What Is the Goal of Reactive Architecture?

  • Be responsive to interactions with its users
  • Handle failure and remain available during outages
  • Strive under varying load conditions
  • Be able to send, receive, and route messages in varying network conditions

What Is Reactive Manifesto?

The Reactive Manifesto is a document that was authored by Jonas Boner, Dave Farley, Roland Kuhn and Martin Thompson. The Manifesto was created in response to companies trying to cope with changes in the software landscape. Multiple groups or companies independently developed similar patterns for solving similar solutions. So aspects of a Reactive Systems were previously individually recognized by these groups. So the Manifesto attempts to bring all of these common ideas into a single unified set of principles, known as Reactive Principles.

Creating Daemon Thread in Java

In this tutorial, you will learn how to create Daemon Thread in Java.

What is Daemon Thread in Java?

The Java runtime environment takes advantage of a special type of thread for background tasks. It’s called a daemon thread, where the daemon is pronounced “demon.” These support threads manage behind-the-screen tasks like garbage collection.

Developing Reactive REST APIs With Quarkus

This article describes how to implement reactive REST APIs in Java with Quarkus rather than using synchronous endpoints. In order to do this, the Java classes CompletableFuture and CompletionStage are needed. The article explains how to use these classes and how to chain asynchronous method invocations including exception handling and timeouts.

Why Use Reactive REST APIs?

The first question you probably ask is, why should you change old habits and not use imperative code? After all implementing asynchronous code is rather unusual for some Java developers and requires a new thinking.

Spring Webflux Multipart File Upload and Reading Each Line Without Saving It

I’ve been working on Spring Webflux for a while. And in my experience, uploading and reading files in this framework is quite a hassle.

Today I am going to talk about uploading a file using Spring Webflux. And the most amazing part is that I am not going to save the file, but I will read it. I will also be checking whether all the data of the file match my RegEx criteria or not using powerful Java stream API.

Introduction to Reactive Programming

Reactive programming is about dealing with data streams and the propagation of change.

Reactive systems are applications whose architectural approach make them responsive, resilient, elastic and message-driven.

Understanding the Reactive Thread Model: Part 1

Reactive or non-blocking processing is in high demand, but before adopting it, one should deeply understand its thread model. For thread model two things are very important to know: thread communication and execution flow. In this blog, I will try to explain both of these topics in-depth.

What Is Reactive Programming?

There are lots of definitions on the web; the Wiki definition is a bit theoretical and generic. From a threading perspective, my version is "Reactive Programming is the processing of the asynchronous event stream, on which you can observe.”                                                                    

How Reactive Thread Works (Part 2)

In Part 1, we covered a reactive web and a simple blocking and non-blocking call. In this part, we will be covering, in-depth, the thread execution and business flow.

3) Non Blocking Call With Thread Execution

The diagram looks complex, but what we are doing is starting a new thread from the request thread and then calling the reactive function. Again, creating the new thread from the previous thread to do some console printing. What we want to test or achieve here is that both reactive sum() function and console printing happens in parallel. Execution of sum() is not blocking the start and print of the new thread.

Tutorial: Reactive Spring Boot, Part 7: Subscribing Multiple Consumers

Learn more about subscribing to multiple consumers in this seventh installment on building a Reactive Spring Boot application.

This is the seventh part of our tutorial showing how to build a Reactive application using Spring Boot, Kotlin, Java, and JavaFX. The original inspiration was a 70-minute live demo.

This tutorial is a series of steps during which we will build a full Spring Boot application featuring a Kotlin back-end, a Java client, and a JavaFX user interface.

This Week in Spring: OAuth Security, Reactive Applications, and More

Check out all the latest happenings this week in Spring!

Hi, Spring fans! Welcome to another of This Week in Spring. We’ve got a lot to cover, so let’s get to it!