Reactive Streams

Last updated
Reactive Streams
Initial release15 May 2015;7 years ago (2015-05-15)
Stable release
1.0.3 / 23 August 2019;3 years ago (2019-08-23)
Repository github.com/reactive-streams/reactive-streams-jvm
Written inJava (Scala, Groovy, Kotlin), .NET
Website reactive-streams.org

Reactive Streams is an initiative to provide a standard for asynchronous stream processing with non-blocking back pressure. [1]

Contents

Origin

Reactive Streams started as an initiative in late 2013 between engineers at Netflix, Pivotal and Lightbend. Some of the earliest discussions began in 2013 between the Play and Akka teams at Lightbend. [2] [3] Lightbend is one of the main contributors of Reactive Streams. [4] Other contributors include Red Hat, Oracle, Twitter and spray.io. [5]

Goals

The main goal of Reactive Streams is to govern the exchange of stream data across an asynchronous boundary  like passing elements on to another thread or thread-pool   while ensuring that the receiving side is not forced to buffer arbitrary amounts of data. In other words, back pressure is an integral part of this model in order to allow the queues which mediate between threads to be bounded.

The intention of the specification is to allow the creation of many conforming implementations, which by virtue of abiding by the rules will be able to interoperate smoothly, preserving the mentioned benefits and characteristics across the whole processing graph of a stream application. A freely-available Technology Compatibility Kit [6] was developed alongside the specification that allows implementors of the specification to verify if they covered all rules and requirements, including checks for potential race conditions.

The scope of Reactive Streams is a minimal set of interfaces, methods and protocols that describe the necessary operations and entities to achieve the asynchronous streams of data with non-blocking back pressure. End-user DSLs or protocol binding APIs have purposefully been left out of the scope to encourage and enable different implementations that potentially use different programming languages to stay as true as possible to the idioms of their platform.

Inclusion in Java standard

The specification developed with the intent of future inclusion in the official Java standard library, if proven successful and adopted by enough libraries and vendors.

Reactive Streams were proposed to become part of Java 9 by Doug Lea, leader of JSR 166 [7] as a new Flow class [8] that would include the interfaces currently provided by Reactive Streams. [4] [9] After a successful 1.0 release of Reactive Streams and growing adoption, the proposal was accepted and Reactive Streams was included in JDK9 via the JEP-266. [9]

Adoption

On April 30, 2015 version 1.0.0 of Reactive Streams for the JVM was released, [4] [5] [10] including Java API, [11] a textual specification, [12] a TCK and implementation examples. It comes with a multitude of compliant implementations verified by the TCK for 1.0.0, listed in alphabetical order: [10]

Other implementations include Cassandra, [22] Elasticsearch, [23] Apache Kafka, [24] Parallel Universe Quasar, [25] Play Framework, [26] Armeria. [27]

Spring 5 is announced to be built upon Reactive Streams compatible Reactor Core. [28]

Amazon announced that its Amazon Web Services SDK would support Reactive Streams to provide streaming capabilities in its client libraries in version 2.0. [29]

Reactive Streams 1.0.1 is released on August 9, 2017, including various improvements in specification preciseness, TCK improvements and other clarifications. The specification as well as interfaces remained fully backwards compatible with the 1.0.0 version, however aimed to streamline the adoption for future implementors as well as align with some additional requirements set by the OpenJDK. [30]

Ports and influences

Related Research Articles

<span class="mw-page-title-main">Java (programming language)</span> Object-oriented programming language

Java is a high-level, class-based, object-oriented programming language that is designed to have as few implementation dependencies as possible. It is a general-purpose programming language intended to let programmers write once, run anywhere (WORA), meaning that compiled Java code can run on all platforms that support Java without the need to recompile. Java applications are typically compiled to bytecode that can run on any Java virtual machine (JVM) regardless of the underlying computer architecture. The syntax of Java is similar to C and C++, but has fewer low-level facilities than either of them. The Java runtime provides dynamic capabilities that are typically not available in traditional compiled languages. As of 2019, Java was one of the most popular programming languages in use according to GitHub, particularly for client–server web applications, with a reported 9 million developers.

<span class="mw-page-title-main">Java virtual machine</span> Java Virtual machine

A Java virtual machine (JVM) is a virtual machine that enables a computer to run Java programs as well as programs written in other languages that are also compiled to Java bytecode. The JVM is detailed by a specification that formally describes what is required in a JVM implementation. Having a specification ensures interoperability of Java programs across different implementations so that program authors using the Java Development Kit (JDK) need not worry about idiosyncrasies of the underlying hardware platform.

Jakarta Enterprise Beans is one of several Java APIs for modular construction of enterprise software. EJB is a server-side software component that encapsulates business logic of an application. An EJB web container provides a runtime environment for web related software components, including computer security, Java servlet lifecycle management, transaction processing, and other web services. The EJB specification is a subset of the Java EE specification.

Java Platform, Standard Edition is a computing platform for development and deployment of portable code for desktop and server environments. Java SE was formerly known as Java 2 Platform, Standard Edition (J2SE).

In computing, the Java API for XML Processing, or JAXP, one of the Java XML Application programming interfaces, provides the capability of validating and parsing XML documents. It has three basic parsing interfaces:

In software design, the Java Native Interface (JNI) is a foreign function interface programming framework that enables Java code running in a Java virtual machine (JVM) to call and be called by native applications and libraries written in other languages such as C, C++ and assembly.

Apache Harmony is a retired open source, free Java implementation, developed by the Apache Software Foundation. It was announced in early May 2005 and on October 25, 2006, the board of directors voted to make Apache Harmony a top-level project. The Harmony project achieved 99% completeness for J2SE 5.0, and 97% for Java SE 6. The Android operating system has historically been a major user of Harmony, although since Android Nougat it increasingly relies on OpenJDK libraries.

JamVM is an open-source Java Virtual Machine (JVM) developed to be extremely small compared with other virtual machines (VMs) while conforming to the Java virtual machine specification version 2.

A Technology Compatibility Kit (TCK) is a suite of tests that at least nominally checks a particular alleged implementation of a Java Specification Request (JSR) for compliance. It is one of the three required pieces for a ratified JSR in the Java Community Process, which are:

<span class="mw-page-title-main">Java (software platform)</span> Set of computer software and specifications

Java is a set of computer software and specifications developed by James Gosling at Sun Microsystems, which was later acquired by the Oracle Corporation, that provides a system for developing application software and deploying it in a cross-platform computing environment. Java is used in a wide variety of computing platforms from embedded devices and mobile phones to enterprise servers and supercomputers. Java applets, which are less common than standalone Java applications, were commonly run in secure, sandboxed environments to provide many features of native applications through being embedded in HTML pages.

The Java language has undergone several changes since JDK 1.0 as well as numerous additions of classes and packages to the standard library. Since J2SE 1.4, the evolution of the Java language has been governed by the Java Community Process (JCP), which uses Java Specification Requests (JSRs) to propose and specify additions and changes to the Java platform. The language is specified by the Java Language Specification (JLS); changes to the JLS are managed under JSR 901. In September 2017, Mark Reinhold, chief Architect of the Java Platform, proposed to change the release train to "one feature release every six months" rather than the then-current two-year schedule. This proposal took effect for all following versions, and is still the current release schedule.

OpenJDK is a free and open-source implementation of the Java Platform, Standard Edition. It is the result of an effort Sun Microsystems began in 2006. The implementation is licensed under the GPL-2.0-only with a linking exception. Were it not for the GPL linking exception, components that linked to the Java class library would be subject to the terms of the GPL license. OpenJDK is the official reference implementation of Java SE since version 7.

The Java Class Library (JCL) is a set of dynamically loadable libraries that Java Virtual Machine (JVM) languages can call at run time. Because the Java Platform is not dependent on a specific operating system, applications cannot rely on any of the platform-native libraries. Instead, the Java Platform provides a comprehensive set of standard class libraries, containing the functions common to modern operating systems.

The Java Development Kit (JDK) is a distribution of Java Technology by Oracle Corporation. It implements the Java Language Specification (JLS) and the Java Virtual Machine Specification (JVMS) and provides the Standard Edition (SE) of the Java Application Programming Interface (API). It is derivative of the community driven OpenJDK which Oracle stewards. It provides software for working with Java applications. Examples of included software are the virtual machine, a compiler, performance monitoring tools, a debugger, and other utilities that Oracle considers useful for a Java programmer.

Server-Sent Events (SSE) is a server push technology enabling a client to receive automatic updates from a server via an HTTP connection, and describes how servers can initiate data transmission towards clients once an initial client connection has been established. They are commonly used to send message updates or continuous data streams to a browser client and designed to enhance native, cross-browser streaming through a JavaScript API called EventSource, through which a client requests a particular URL in order to receive an event stream. The EventSource API is standardized as part of HTML5 by the WHATWG. The media type for SSE is text/event-stream.

<span class="mw-page-title-main">Play Framework</span> Open-source web framework written in Scala

Play Framework is an open-source web application framework which follows the model–view–controller (MVC) architectural pattern. It is written in Scala and usable from other programming languages that are compiled to JVM bytecode, e.g. Java. It aims to optimize developer productivity by using convention over configuration, hot code reloading and display of errors in the browser.

Nashorn is a JavaScript engine developed in the Java programming language originally by Oracle and later by the OpenJDK Community. It relies on the support for dynamically typed languages on the Java Platform Nashorn has been included with Java 8 through JDK 14.

<span class="mw-page-title-main">Akka (toolkit)</span> Open-source runtime

Akka is a source-available toolkit and runtime simplifying the construction of concurrent and distributed applications on the JVM. Akka supports multiple programming models for concurrency, but it emphasizes actor-based concurrency, with inspiration drawn from Erlang.

Lightbend, formerly known as Typesafe, is a company founded by Martin Odersky, the creator of the Scala programming language, Jonas Bonér, the creator of the Akka middleware, and Paul Phillips in 2011.

References

  1. reactive-streams.org
  2. A Journey into Reactive Streams
  3. Reactive Streams 1.0.0 interview
  4. 1 2 3 Reactive Streams Releases First Stable Version for JVM
  5. 1 2 Reactive Streams 1.0.0 – a new standard in reactive data processing
  6. "Reactive Streams TCK". GitHub .
  7. "jdk9 Candidate classes Flow and SubmissionPublisher". Archived from the original on 2015-01-20. Retrieved 2015-12-23.
  8. "java.util.concurrent.Flow". Archived from the original on 2016-02-03. Retrieved 2015-12-23.
  9. 1 2 JEP 266: More Concurrency Updates
  10. 1 2 Reactive Streams 1.0.0 is here!
  11. Java API
  12. Reactive Streams for the JVM specification
  13. InfoQ: Reactive Streams with Akka Streams
  14. "Design Principles behind Akka Streams". Archived from the original on 2016-01-12. Retrieved 2015-12-23.
  15. MongoDB Reactive Streams Java Driver
  16. Ratpack: The Reactive Streams API
  17. Reactor 2.0.0.RC1 with native Reactive Streams support now available!
  18. Advanced RxJava: The Reactive-Streams API (part 1)
  19. Slick 3: Reactive Streams for Asynchronous Database Access in Scala
  20. Slick 3.0.0
  21. Vert.x Reactive Streams Integration
  22. Accessing Cassandra in a Reactive Way
  23. elastic4s — Non blocking, type safe DSL and Scala client for Elasticsearch
  24. Reactive Streams for Apache Kafka
  25. "Quasar and Reactive Streams". Archived from the original on 2015-10-04. Retrieved 2015-12-24.
  26. Play Framework — Reactive Streams integration (experimental)
  27. Armeria - Completely asynchronous and reactive
  28. Reactive Spring
  29. "AWS SDK for Java 2.0 developer preview announcement".
  30. "Reactive Streams 1.0.1 Release Announcement".
  31. "Reactive Streams .NET". GitHub .
  32. "Elixir blog: Announcing GenStage".