11 End-to-end real-time reactive event processing

 

This chapter covers

  • Combining RxJava operators and Vert.x clients to support advanced processing
  • Using RxJava operators to perform content enrichment and aggregate data processing on top of event streams
  • Extending the Vert.x event bus to web applications to unify backend and frontend communication models
  • Managing state in a stream-processing setting

In this chapter we’ll explore advanced reactive stream processing, where application state is subject to live changes based on events. By performing transformations and aggregations on events, we will compute live statistics about what is happening in the larger 10k steps application. You will also see how event streams can impact real-time web applications by unifying Java and JavaScript code under the Vert.x event-bus umbrella.

This chapter starts by looking at advanced stream processing with RxJava operators and Vert.x clients. We’ll then discuss the topic of real-time web applications connected over the event bus, and we’ll finish with techniques for properly dealing with state (and especially initial state) in a context of continuous events.

11.1 Advanced stream data processing with Kafka and RxJava

11.1.1 Enriching daily device updates to generate user updates

11.1.2 Computing device-update ingestion throughput using time-window aggregates

11.1.3 Computing per-city trends using aggregation discriminants and time windows

11.2 Real-time reactive web applications

11.2.1 Forwarding Kafka records to the Vert.x event bus

11.2.2 Bridging the event bus and web applications

11.2.3 From Kafka to live web application updates

11.3 Streams and state

11.3.1 A stream of updates

11.3.2 Hydrating the ranking state

11.3.3 Periodically updating rankings from the updates stream

Summary