To block or not to block - Reactive programming on the JVM


When you step into a bus, tram or metro in Amsterdam, you are quite literally stepping into our software. Every device in the vehicle, from the smallest stop button to the biggest outside display, is connected internally through a microservice platform called GIVA - the Generic Information Vehicle Architecture.

GIVA services are Java processes, communicating over an internal network using HTTP and UDP. In our case, where responsiveness and efficient use of constrained hardware is crucial, the use of blocking I/O and the traditional Servlet thread-per-request model has significant drawbacks. Services in the vehicle should never be blocked, but always be available to deal with external events and the ever-changing circumstances in a moving vehicle. GIVA therefore uses asynchronous programming and non-blocking I/O in a _reactive_ programming model, based on the Vert.X framework.

Apart from GIVA, we have also used reactive designs to develop TapCheck (running on Ktor and Kotlin coroutines), which is the backoffice for thousands of concurrent barcode check-in/check-out devices in Dutch public transport. And in the payment domain, we are currently building a payment terminal gateway (using Spring Reactive, R2DBC and Kotlin) that connects many payment terminals in shops across Europe to the underlying payment networks.

In this talk I will explain the basics of reactive programming on the JVM, how we used these concepts to develop these platforms, and our experiences with using the available libraries and frameworks.

Form ID:5936