Chapter 7. Testing and Troubleshooting
By now you should understand the basic principles of programming with reactive extensions. So far, we’ve mastered subscription, most commonly used operators, taking advantage of RxJava in existing applications, and writing entirely reactive software stacks. But to make the best of reactive programming, we must dive a little bit deeper. This chapter focuses on a few nontrivial but important aspects and principles, among them:
-
Declarative error handling, including retries (see “Error Handling”)
-
Virtual time and testing (see “Virtual Time”)
-
Monitoring and debugging of your
Observablestreams (see “Monitoring and Debugging”)
Understanding a library or framework is not enough to successfully deploy it to production. The aforementioned aspects are crucial if you want to build solid, stable, and resilient applications.
Error Handling
The Reactive Manifesto enumerates four traits that reactive systems should embrace. Such systems should be: responsive, resilient, elastic, and message driven. Let’s take a look at a couple of these:
- Responsive
-
The system responds in a timely manner if at all possible. […] responsiveness means that problems may be detected quickly and dealt with effectively. […] rapid and consistent response times, […] simplifies error handling.”
- Resilient
-
The system stays responsive in the face of failure. […] parts of the system can fail and recover without compromising the system as a whole. […] The ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access