RxJava 2 | Reactive Programming in Java
Learning Objectives
Working in a hands-on learning environment, guided by our expert team, attendees will learn to:
- Understand the basics of Reactive Programming
- Discuss the advantages and limitations of RxJava Observables
- Write a client application capable of handling Reactive events
- Develop unit tests to properly test Observable implementations (Using JUnit 5)
- Apply operators to event streams to filter, modify and combine the objects emitted by event publishers
- Select the appropriate type of Event Source (Single, Maybe, Completable, Observable and Flowable)
- Implement event sources using one of the many factory methods of the RxJava 2 API
- Use Subjects, acting as both event consumers and event source
- Use both Cold and Hot Observables
- Work with RxJava Scheduler instances to defines the thread pools on which event producers and consumers operate
- Properly divide the functionality over multiple threads
- Write test classes that deal with asynchronous RxJava implementations
- Deal with backpressure problems in reactive programming
- Solve the problem of with slow event consumers
- Implement alternatives to event caching
- Deal with exceptions in Reactive streams
- Retry registration to event streams in Exceptional situations
Audience & Pre-Requisites
This in an intermediate-level development course geared for experienced Java developers who wish to explore concurrent, asynchronous and reactive programming APIs and techniques in Java.
Take Before: Students should have practical skills equivalent to or should have received training in the following topic(s) as a pre-requisite:
- TT2100-J8: Introduction to Java 8 Programming for OO Experienced Developers
Take Instead: We offer other courses that provide different levels of knowledge or focus:
- TT3423: Functional and Reactive Programming using RxJava 2 – 3 days
Take After: Our core training courses provide students with a solid foundation for continued learning based on role, goals, or their areas of specialty. Our learning paths offer a wide variety of follow-on courses such as:
- Specialized or continued Java / JEE training: Spring, Advanced Java, Design Patterns & more.
- Agile, Java TDD / Test Driven Development and JUnit training
- Java / JEE Services, Microservices, REST training
- Java or JEE Web Application Security and secure coding training
Outline
Session: Introduction to RXJava2
Lesson: Introduction
- Introduce ReactiveX and RxJava 2
- The Observer and Iterator pattern and functional programming
- Introduce the RxJava 2 Building blocks
- Discuss hot and cold observables
- Registering operators
- Subscribing to an Observable
Lesson: Testing Event Sources (Introduction)
- Introduce the TestObserver and TestSubscriber
- Testing Observable implementations
- Introduce some commonly used assertions
Lesson: Operators
- Introduce RxJava 2 Operators
- Show the use of RxMarbles (marble diagrams)
- Explain some commonly used operators
- Callback operators
Lesson: Creating the event publisher
- Implementing the event source
- Introduce the different types of event publishers
- Convenience methods for creation of publishers
- Creating an event source using an Emitter
- Pre-defined observables
- The defer operator
- ConnectableObservable
Session: Working with RxJava2
Lesson: Subjects
- RxJava subjects
- Enable multicating using Subjects
- Introduce most commonly used Subject implementations
Lesson: RxJava Schedulers (Multithreading)
- Thread usage of Observable, Operator and Observer
- Using the subscribeOn method
- Introduce the Scheduler implementations
- Using the observeOn method
Lesson: Testing (multi-threaded) Event Sources
- Testing Asynchronous code
- Discuss strategies for testing event sources
- Waiting for source to complete (await methods)
- Use RxJava extension mechanism to Scheduler instances used during test
- The JUnit 5 @ExtendsWith and @RegisterExtension annotations
- Using the TestScheduler to advance time during test
Lesson: Backpressure
- Strategies for dealing with Backpressure
- Reactive Streams
- Flowable and Processor
- “reactive pull” backpressure
Lesson: Exception Handling
- Handling errors in onError
- Exception handling strategies
- Using onErrorReturn or onErrorNext operators
- Using the retry operators
- The Global Error Handler
Sorry! It looks like we haven’t updated our dates for the class you selected yet. There’s a quick way to find out. Contact us at 502.265.3057 or email info@training4it.com
Request a Date