Uploaded image for project: 'Spring Data Redis'
  1. Spring Data Redis
  2. DATAREDIS-712

Reuse of reactive types for multiple subscriptions

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Minor
    • Resolution: Complete
    • Affects Version/s: 2.0 GA (Kay)
    • Fix Version/s: None
    • Component/s: Core
    • Labels:

      Description

      Currently, command execution allows only a single subscription from a Flux/Mono:

      Mono<Long> foo = redisOperations.delete("foo");
      foo.subscribe(); // completes normally
      foo.subscribe(); // fails because of closed connection
      

      Template API calls assemble publishers that pre-allocate connections and operate on that particular connection. Once the first subscription terminates, the collection is returned and no longer usable for subsequent subscriptions.

      Publishers without a subscription stay with the allocated connection which causes a resource leak because the associated connection is never released.

      On a different note: Connections are allocated through a synchronous API which may incur blocking.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                mp911de Mark Paluch
                Reporter:
                mp911de Mark Paluch
                Last updater:
                Mark Paluch
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: