Subremes Codes

Java Magazine: Reactive Programming

By Java Magazine Editor Andrew Binstock

Reactive programming is a term that means slightly different things to different people. Central to the concept, though, is a model of computing that is alerted to certain kinds of events, can process or ignore those events, and works with the event source to manage the number of events to be processed.

In practice, this model rests on several technologies: a message-passing framework, a subscription-based notification system, and an asynchronous execution of the event-driven tasks. The benefit is a loosely coupled implementation that is scalable and tends to isolate failures. The scalability here refers to the ability to scale horizontally quickly, and it anticipates handling the number of events associated with big data—millions to billions of incoming events. This aspect, in particular, is what makes the reactive model different from its familiar forebear, the event loop in GUI development.

In this issue, we provide an overview of reactive development (page 16) and then do a deep dive into RxJava (page 32), one of the leading libraries for developing reactive applications on the JVM. We follow that up by looking at the reactive capabilities built into the most recent release of Spring 5.0 (page 61). Finally, we examine a slightly different model for developing CRUD applications, called Command Query Responsibility Segregation, or CQRS (page 69), which while not reactive per se implements an approach that overlaps with reactive programming.

It might seem that reactive programming is a design that would lead naturally to microservice implementation. And indeed it is.

Статья полностью:Java Magazine: Reactive Programming