[OPENDJ-3654] The proxy should support end-to-end back-pressure Created: 18/Jan/17  Updated: 08/Nov/19  Resolved: 28/Aug/17

Status: Done
Project: OpenDJ
Component/s: core apis, proxy
Affects Version/s: 4.0.0
Fix Version/s: 5.5.0

Type: Improvement Priority: Major
Reporter: Matthew Swift Assignee: Yannick Lecaillez
Resolution: Fixed Votes: 0
Labels: None

Issue Links:
Depends
is required by OPENDJ-3504 LDAP bytesRead/Written and SNMP count... Done
is required by OPENDJ-4175 Rationalize Grizzly transports Done
Relates
relates to OPENDJ-2920 Investigate using asynchronous stream... Done
is related to OPENDJ-3868 Proxied persistent searches are not c... Done
Dev Assignee: Yannick Lecaillez

 Description   

It would be really nice if our client APIs could be reactive. Unfortunately, RxJava's Flowable is intended for homogeneous streams of objects which doesn't match very well to LDAP's stateful heterogeneous response streams. In particular, we want a Flowable whose completion notification includes the final LDAP Result, instead of the Result being included in the stream itself.

The goal of this issue is investigate whether we can implement our own reactive response streams in the style of Rx's Flowable without having to recreate the wheel. Clearly we don't want to duplicate all the functionality provided by Flowable as there's a lot of it - in effect we would be adding at least one addition type + related types to the existing Flowable, Maybe, Single, and Completable types. Can we provided a simple wrapper around Flowable that is sufficient for our needs? For example, here's two possible use cases:

Connection connection = ...;

connection.search(searchRequest)
          .subscribe(new SearchSubscriber() {
              @Override
              public void onSubscribe(final Subscription s) {
                  
              }

              @Override
              public void onSearchResultEntry(final SearchResultEntry entry) {

              }

              @Override
              public void onSearchResultReference(final SearchResultReference reference) {

              }

              @Override
              public void onIntermediateResponse(final IntermediateResponse im) {

              }

              @Override
              public void onError(final Throwable t) {

              }

              @Override
              public void onResult(Result result) {
                    
              }
          });

// Example of blocking usage:
List<SearchResultEntry> entries = connection.search(searchRequest)
                                            .toListOfSearchResultEntries()
                                            .blockingGet();


 Comments   
Comment by Jean-Noël Rouvignac [ 28/Aug/17 ]

Note that a new issue will be created concerning the API changes.

Comment by Matthew Swift [ 07/Nov/19 ]

Moved to closed state because the fixVersion has already been released.

Generated at Sun Nov 29 16:57:34 UTC 2020 using Jira 7.13.12#713012-sha1:6e07c38070d5191bbf7353952ed38f111754533a.