Repository navigation
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
Open
andy-stark-redis wants to merge 1 commit into
andy-stark-redis wants to merge 1 commit into
Conversation
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>
Contributor
Contributor
Contributor
🧠 Redis MemoryFound 5 related items from repository history (5 new this commit):
Memory updated at 4e5d1a4 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
javac/javacommands with onlylettuce-coreon the classpath.javacpasses, then the server dies withNoClassDefFoundError: io/netty/channel/ChannelHandler. I reproduced this with session-store's own 6.7.1 recipe in a clean directory before changing anything.lib/directory without saying how to fill it.Changes
netty-codecis nownetty-codec-baseandnetty-codec-dns),reactor-core3.8.7,reactive-streams,jspecify,redis-authx-coreandslf4j-api. Hand-listing those would drift again.pom.xmlthat depends onlettuce-core7.9.0.RELEASE, andmvn dependency:copy-dependencies -DoutputDirectory=lib.javacandjavathen use-cp 'lib/*'.pub-subalready recommended Maven, and the others now match it.DemoServer.javacomment that repeated the old jar command is updated.Verification
For each of the nine pages I extracted the dependency block and the
javacandjavacommands 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:hits1, hit rate 50%)ZSCOREalice 5, bob 9 in RedisAll nine passed, with no errors in any server log.
Not verified, and one finding
curl-ed frommain, because thecurlURLs only serve these files after merge. The only source change is a comment in the leaderboardDemoServer.java./statetakes 6 to 10 seconds, because the consumer workers hold the shared connection in blockingXREADGROUP. 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:
/finalizewaits 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.xmlonlettuce-core7.9.0.RELEASE andmvn dependency:copy-dependencies -DoutputDirectory=lib—instead of hand-downloaded jars orjavac/javawith onlylettuce-coreon the classpath (which caused runtimeNoClassDefFoundErrorfor 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.javausage comments are updated to match thelib/*workflow.Reviewed by Cursor Bugbot for commit 4e5d1a4. Bugbot is set up for automated code reviews on this repo. Configure here.