Skip to content

[reactor-optional] Prepare public APIs for optional Reactor support - #3915

Merged
a-TODO-rov merged 4 commits into
mainfrom
feature/reactor-optional-7x
Sep 16, 2026
Merged

a-TODO-rov merged 4 commits into
mainfrom
feature/reactor-optional-7x

Conversation

@a-TODO-rov

@a-TODO-rov a-TODO-rov commented Sep 15, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Prepare Lettuce 7.8 for optional Reactor support by introducing Reactor-independent command access, event subscriptions, and asynchronous trace-context resolution. Existing Reactor-based entry points remain source-compatible but are deprecated for removal in Lettuce 8.0.

Key Decisions & Assumptions

  • Add cached connection.commands(factory) accessors across standalone, cluster, Pub/Sub, Sentinel, master/replica, multi-database, and pooled connections. Default interface methods preserve compatibility with third-party connection implementations.
  • Keep factories as shared singletons so repeated access returns the same command API without per-call allocation.
  • Introduce callback-based EventBus subscriptions and map-based trace-context lookup while retaining Reactor adapters during the 7.x transition.

Behavioral / Conceptual Changes

  • Reactive command interfaces now expose factory() methods; connection.reactive() is deprecated in favor of connection.commands(...).
  • EventBus.subscribe(...) returns a closeable Subscription; EventBus.get() is deprecated.
  • Reactor context helpers move to AbstractRedisReactiveCommands.ReactorTraceContext, and tracing implementations can resolve context from asynchronous carriers.

Testing

Adds unit coverage for factory singleton behavior, command caching, connection variants, and EventBus subscriptions, plus integration coverage for pooled connections and asynchronous/reactive tracing. Verified with formatting and 116 focused Javadoc, Kotlin, aggregate-interface, and sync/reactive consistency tests.

Notes

No deprecated API is removed in 7.8; removals are scheduled for Lettuce 8.0.


Note

Medium Risk
Broad public API surface (connections, EventBus, tracing) with deprecations but backward-compatible defaults; tracing context resolution changes could affect distributed tracing in reactive/async paths.

Overview
Prepares Lettuce 7.8 for optional Project Reactor by adding Reactor-free entry points while keeping existing APIs working until 8.0.

Command APIs: Connections gain cached commands(CommandsFactory) (backed by a per-connection Store and static factory() helpers on reactive command interfaces). connection.reactive() is deprecated in favor of connection.commands(RedisReactiveCommands.factory()) across standalone, cluster, Pub/Sub, Sentinel, multi-DB failover, master/replica wrappers, and pooled proxies.

Events: EventBus adds callback subscribe(Consumer) / subscribe(Class, Consumer) returning a closeable Subscription; EventBus.get() (Flux<Event>) is deprecated, with docs updated (including failover examples).

Tracing: Reactive command tracing reads context via ReactorTraceContext and TraceContextProvider.getTraceContextAsync(Map) (Brave/Micrometer updated); older Tracing.* Reactor context helpers are deprecated.

Reviewed by Cursor Bugbot for commit 4adcd02. Bugbot is set up for automated code reviews on this repo. Configure here.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 15, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-09-16T12:09:16.251576Z 4adcd02 New commits
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@a-TODO-rov
a-TODO-rov added this pull request to stack #3916 September 15, 2026 13:26

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: d976320a1d

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit d976320. Configure here.

@a-TODO-rov
a-TODO-rov force-pushed the feature/reactor-optional-7x branch from d976320 to 4adcd02 Compare September 16, 2026 12:02
@a-TODO-rov
a-TODO-rov removed this pull request from stack #3916 September 16, 2026 12:03
@a-TODO-rov
a-TODO-rov merged commit f50f667 into main Sep 16, 2026
15 of 16 checks passed
@a-TODO-rov
a-TODO-rov deleted the feature/reactor-optional-7x branch September 16, 2026 12:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant