Skip to content

DOC-7228 Fix the Lettuce use-case dependency recipes and pin 7.9.0 - #4399

Open
andy-stark-redis wants to merge 1 commit into
mainfrom
DOC-7228-lettuce-jar-recipes
Open

andy-stark-redis wants to merge 1 commit into
mainfrom
DOC-7228-lettuce-jar-recipes

Conversation

@andy-stark-redis

@andy-stark-redis andy-stark-redis commented Oct 30, 2026 •

Copy link
Copy Markdown
Contributor

Jira: DOC-7228. Third PR for DOC-7228, after #4397 and #4398. Based on main, and file-disjoint from #4398 (which owns memory-layer and semantic-cache).

The nine remaining Lettuce use-case pages told readers to build the demos from hand-collected jars. Several of those recipes could never have worked, so this fixes them as well as moving them to 7.9.0.

What was wrong

  • leaderboard, rate-limiter, session-store, time-series-dashboard gave javac/java commands with only lettuce-core on the classpath. javac passes, then the server dies with NoClassDefFoundError: io/netty/channel/ChannelHandler. I reproduced this with session-store's own 6.7.1 recipe in a clean directory before changing anything.
  • prefetch-cache and streaming hand-listed ten jars (Lettuce 6.5.0, Netty 4.1.113, Reactor 3.6.6).
  • cache-aside, job-queue and pub-sub assumed a lib/ directory without saying how to fill it.

Changes

  • Lettuce 7.9.0 resolves to fifteen runtime jars: eight Netty 4.2.17 modules (Netty split its codec jars, so netty-codec is now netty-codec-base and netty-codec-dns), reactor-core 3.8.7, reactive-streams, jspecify, redis-authx-core and slf4j-api. Hand-listing those would drift again.
  • Every page now has the same step: a minimal pom.xml that depends on lettuce-core 7.9.0.RELEASE, and mvn dependency:copy-dependencies -DoutputDirectory=lib. javac and java then use -cp 'lib/*'. pub-sub already recommended Maven, and the others now match it.
  • The Maven and Gradle snippets on job-queue, leaderboard, rate-limiter, session-store and time-series-dashboard move from 6.7.1 to 7.9.0, and the leaderboard DemoServer.java comment that repeated the old jar command is updated.

Verification

For each of the nine pages I extracted the dependency block and the javac and java commands straight from the page, ran them in a fresh directory against Redis 8.10.2, then drove the server with requests that write to and read from Redis:

  • cache-aside: a read miss then hit (hits 1, hit rate 50%)
  • job-queue: three jobs enqueued and completed by two workers
  • leaderboard: ZSCORE alice 5, bob 9 in Redis
  • prefetch-cache: a prefetched record served as a hit
  • pub-sub: three published messages delivered
  • rate-limiter: 15 requests, 10 allowed, 5 denied
  • session-store: a login cookie that reads the session back and increments it
  • streaming: five entries produced
  • time-series-dashboard: a snapshot with sensor data

All nine passed, with no errors in any server log.

Not verified, and one finding

  • The source files were copied from this branch instead of curl-ed from main, because the curl URLs only serve these files after merge. The only source change is a comment in the leaderboard DemoServer.java.
  • Readers now need Maven installed for the dependency step. The Maven and Gradle snippets above it are unchanged in kind.
  • The older "Lettuce 6.1 or later" prerequisite floors on job-queue and pub-sub are unchanged and were not re-verified.
  • Streaming /state takes 6 to 10 seconds, because the consumer workers hold the shared connection in blocking XREADGROUP. A control run on Lettuce 6.5.0 took the same 10.4 s, so this is existing demo behavior and not a 7.9.0 regression. I left it alone.

Not squashing yet: /finalize waits for approval.

🤖 Generated with Claude Code


Note

Low Risk
Documentation-only changes plus a comment in one demo file; no runtime or security-sensitive application code.

Overview
Fixes broken or incomplete “run the demo” instructions on nine Java Lettuce use-case pages (cache-aside, job-queue, leaderboard, prefetch-cache, pub-sub, rate-limiter, session-store, streaming, time-series-dashboard).

Dependency setup: Each page now uses the same Maven recipe—a minimal pom.xml on lettuce-core 7.9.0.RELEASE and mvn dependency:copy-dependencies -DoutputDirectory=lib—instead of hand-downloaded jars or javac/java with only lettuce-core on the classpath (which caused runtime NoClassDefFoundError for Netty). Demo compile/run steps use -cp 'lib/*'.

Version bumps: Maven/Gradle snippets on job-queue, leaderboard, rate-limiter, session-store, and time-series-dashboard move from 6.7.1 to 7.9.0; prefetch-cache and streaming drop outdated hand-listed Netty/Reactor versions.

Code: Leaderboard DemoServer.java usage comments are updated to match the lib/* workflow.

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

Nine use-case pages told readers to build the demos from hand-collected jars. Four of them
(leaderboard, rate-limiter, session-store, time-series-dashboard) gave a javac and java
command with only lettuce-core on the classpath, which never worked: javac passes, then
the server dies with NoClassDefFoundError for io.netty.channel.ChannelHandler, reproduced
on the page's own 6.7.1 recipe in a clean directory. Prefetch-cache and streaming listed ten
jars at Netty 4.1.113, Reactor 3.6.6 and Lettuce 6.5.0, and cache-aside, job-queue and
pub-sub assumed a lib/ directory without saying how to fill it.

Lettuce 7.9.0 resolves to fifteen runtime jars: eight Netty 4.2.17 modules (the codec jars
were split, so netty-codec is now netty-codec-base and netty-codec-dns), reactor-core 3.8.7,
reactive-streams, jspecify, redis-authx-core and slf4j-api. Rather than hand-list those and
let them drift again, every page now has the same step: write a minimal pom.xml that depends
on lettuce-core 7.9.0.RELEASE and run mvn dependency:copy-dependencies into lib/, then
javac and java use -cp 'lib/*'. pub-sub already recommended Maven; the others now match it.
The Maven and Gradle snippets on job-queue, leaderboard, rate-limiter, session-store and
time-series-dashboard moved from 6.7.1 to 7.9.0, and the leaderboard DemoServer comment
that repeated the old jar command was updated.

I ran each page's dependency, javac and java commands literally, extracted from the page, in a
fresh directory against Redis 8.10.2, then drove each server with requests that write to and
read from Redis (cache read miss then hit, jobs enqueued and completed by workers, scores
landing in the sorted set, a prefetched record served as a hit, pub/sub messages delivered,
the token bucket allowing then denying, a login cookie that reads the session back, stream
entries produced, the time series snapshot). Every demo passed. Streaming's /state takes 6 to
10 seconds because the consumer workers hold the shared connection in blocking XREADGROUP; a
control run on Lettuce 6.5.0 took the same 10.4 seconds, so it is not a 7.9.0 regression.

Learned: a one-jar javac and java recipe compiles but cannot run, and Lettuce 7.9.0 needs fifteen runtime jars that dependency:copy-dependencies collects exactly
Constraint: these pages must run with -cp 'lib/*' from a lib/ filled by Maven, not a hand-written jar list, so the Netty and Reactor versions track whatever lettuce-core resolves
Directive: do not hand-list Netty or Reactor jar versions in these pages again; change the lettuce-core version in the pom.xml snippet and nothing else
Gaps: the commands were run with the source files copied from this branch instead of curl-ed from main, readers need Maven installed, and the older "Lettuce 6.1 or later" prerequisite floors were not re-verified
Ticket: DOC-7228
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@github-actions

github-actions Bot commented Oct 30, 2026 •

Copy link
Copy Markdown
Contributor

DOC-7228

@github-actions

github-actions Bot commented Oct 30, 2026 •

Copy link
Copy Markdown
Contributor

🧠 Redis Memory

Found 5 related items from repository history (5 new this commit):

Memory updated at 4e5d1a4

@andy-stark-redis
andy-stark-redis requested a review from a team October 30, 2026 16:49
@andy-stark-redis andy-stark-redis self-assigned this Oct 30, 2026
@andy-stark-redis andy-stark-redis added the clients Client library docs label Oct 30, 2026

@dwdougherty dwdougherty left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

clients Client library docs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants