O'Reilly logo

Design Patterns and Best Practices in Java by Lucian-Paul Torje, Adrian Ianculescu, Kamalmeet Singh

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Example project

In the following example, we will show the usage of RxJava in the real-time processing of the temperature received from multiple sensors. The sensor data is provided (randomly generated) by a Spring Boot server. The server is configured to accept the sensor name as a configuration so that we may change it for each instance. We'll start five instances and display warnings on the client side if one of the sensors outputs more than 80 degrees Celsius.

Starting multiple sensors is easily done from bash with the following command:

The server-side code is simple, we have only one REST controller configured to output the sensor data ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required