Functional and Reactive Programming using RxJava 2

Functional and Reactive Programming using RxJava 2 is a comprehensive hands-on next-level Java training workshop geared for experienced developers who wish to explore concurrent, asynchronous and reactive programming APIs and techniques in Java. Throughout this three day course students will become familiar with Functional programming and processing data stream. They will use the Java Concurrency API to implement asynchronous processes, making use of the enhancements made to this API in Java 8. Students will then continue to develop both event produces and consumers using Java’s ReactiveX implementation (RxJava 2). RxJava 2 is a complete rewrite of the RxJava API in 2014. RxJava has always been one of the front-runners of reactive programming. RxJava 2 is a complete implementation of the Reactive Streams specification, providing an even better interoperability between reactive libraries.

Retail Price: $2,195.00

Next Date: Request Date

Course Days: 3


Request a Date

Request Custom Course


Learning Objectives

Working in a hands-on learning environment, guided by our expert team, attendees will learn to:

  • Learn what functional programming means and what it brings to the table
  • Learn how Lambda expressions and functional interfaces can greatly enhance other aspects of Java
  • Use Lambda expressions and method references in the Collection API
  • Use the Stream constructs to work with Collections and Collectors
  • Work with the basic Thread class and Runnable interfaces
  • Deal with thread synchronization
  • Utilize the Java Concurrency API to configure Thread pools
  • Discover the Callable interface
  • Implement different lock strategies
  • Optimize multi-threading using the CompletableFuture introduced in Java 8
  • 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:

  • TT3420: RxJava 2: Reactive Programming in Java

 

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

 

Follow On Courses: Our Java tracks include a wide variety of follow-on courses and learning paths for leveraging Java for next-level development, testing, security and more. Please see our Java Developer Training Suite & Learning Paths list of courses, or inquire for recommendations based on your specific role and goals.

 

 


Outline

Lesson: Introduction to Lambda Expressions

  • Functional vs OO Programming
  • Anonymous Inner classes
  • Lambda Expression Syntax
  • Functional Interfaces
  • Method references
  • Constructor references

Lesson: Java 8 Collection Updates

  • Introduce the ConcurrentHashMap
  • Lambda expressions and Collections
  • Lab: Functional Collection

Lesson: Streams

  • Processing Collections of data
  • The Stream interface
  • Reduction and Parallelism
  • Filtering collection data
  • Sorting Collection data
  • Map collection data
  • Find elements in Stream
  • Numeric Streams
  • Create infinite Streams
  • Sources for using Streams
  • Exercise: Working with Streams

 

Lesson: Collectors

  • Creating Collections from a Stream
  • Group elements in the Stream
  • Multi-level grouping of elements
  • Partitioning Streams
  • Lab: Collecting

 

Session: Multithreading and Concurrency

 

Lesson: Java 8 Concurrency Updates

  • The common thread pool
  • Atomic variables
  • LongAdder and LongAccumulator
  • CompletableFuture
  • Non-blocking asynchronous tasks
  • Lab: CompletableFuture

 

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
  • Lab: RxJava Introduction

 

Lesson: Testing Event Sources (Introduction)

  • Introduce the TestObserver and TestSubscriber
  • Testing Observable implementations
  • Introduce some commonly used assertions
  • Lab: Testing the Observable

 

Lesson: Operators

  • Introduce RxJava 2 Operators
  • Show the use of RxMarbles (marble diagrams)
  • Explain some commonly used operators
  • Callback operators
  • Lab: RxJava Operations

 

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
  • Lab: RxJava Observables

 

Session: Working with RxJava2

 

Lesson: Subjects

  • RxJava subjects
  • Enable multicasting using Subjects
  • Introduce most commonly used Subject implementations
  • Lab: RxJava Subjects

 

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
  • Lab: Testing Asynchronous Event sources

 

Lesson: Backpressure

  • Strategies for dealing with Backpressure
  • Reactive Streams
  • Flowable and Processor
  • “reactive pull” backpressure
  • Lab: RxJava Backpressure

 

Lesson: Exception Handling

  • Handling errors in onError
  • Exception handling strategies
  • Using onErrorReturn or onErrorNext operators
  • Using the retry operators
  • The Global Error Handler
  • Lab: Exception Handling


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