Dear Apache Pulsar community members,

I have developed a Reactive Streams adapter for the Apache Pulsar Java
Client. It uses Project Reactor as the Reactive Streams implementation.

The repository is here: https://github.com/lhotari/reactive-pulsar
and library is available in Maven Central:
https://search.maven.org/search?q=g:com.github.lhotari%20a:reactive-pulsar*

I would like to contribute this library to the Apache Pulsar project.
I would suggest that the library is committed to a separate repository, for
example https://github.com/apache/pulsar-reactive .

# Motivation

There's a need to "go reactive from end-to-end" when building modern
reactive applications with platforms such as Spring Reactive.

There are ways to adapt the Apache Pulsar Java client async API calls to
Reactive Streams with a few lines of code. However, a lot will be missing
and achieving the complete solution will require much more effort.

The primary goal of this library is to provide a Reactive Streams adapter
that wraps the Apache Pulsar Java client with Reactive APIs
for sending, reading and consuming messages.
The secondary goal is to provide a Spring Boot starter for easily adopting
the power of Apache Pulsar for Spring Boot applications.

It is currently out of scope for this library to build a reactive client
all the way from the binary protocol handling.
This library builds upon the existing Apache Pulsar Java client and uses
the async API for operations.

# Features

- Simple and intuitive reactive APIs for sending, reading and consuming
messages.
- Non-blocking backpressure support for the provided reactive APIs
- Pulsar client resource lifecycle management that integrates with the
Reactive programming model
- Additional producer caching that caches producers.
  - Useful for API backends since the Pulsar client producer resource can
be shared and cached across multiple REST calls.
- Support for in-order parallel (concurrent) processing at the application
level
  - I/O intensive message processing can leverage Project Reactor's
capabilities to efficiently
    handle thousands of simultaneous I/O calls to external REST APIs and
resources that have Reactive clients/drivers.
  - In-order parallel processing support can retain key-order at the level
of a single consumer.

I'm presenting the library and it's features tomorrow on September 2nd in
the SpringOne virtual conference, which is free to attend.
The session details and schedule are at
https://springone.io/2021/sessions/reactive-applications-with-apache-pulsar-and-spring-boot
.

# Licenses

The Reactive Pulsar Adapter library is under the Apache Licence Version 2.0
. The main dependencies are reactor-core
(https://github.com/reactor/reactor-core) and jctools-core (
https://github.com/JCTools/JCTools) which are also
ASL 2.0 licensed.
There's also a dependency to Caffeine (https://github.com/ben-manes/caffeine)
and the Spring Boot Starter
depends on Spring Boot and Spring Framework. These are all ASL 2.0 licensed
libraries.
The additional Spring integration testing support library depends on
Testcontainers, which is also ASL 2.0 licensed.


I'm looking forward to the discussion about this.


Best regards,

Lari Hotari

Reply via email to