Repository navigation
DOC-7226 Move the job-queue Jedis use case to RedisClient - #4391
Merged
Merged
Conversation
Contributor
🧠 Redis MemoryFound 7 related items from repository history (2 new this commit):
Memory updated at f0fa1bd |
Contributor
Contributor
RedisJobQueue and DemoServer take a RedisClient instead of a JedisPool. The getResource() blocks are gone, the three pipelines are in try-with-resources, and DemoServer builds the client with RedisClient.builder() and a ConnectionPoolConfig (maxTotal 32, maxIdle 16, minIdle 2, as before). The page's snippets, Maven/Gradle version (5.0.1 -> 8.0.2), prerequisites, pool-sizing section and javac/java commands (now the six runtime jars) follow. Stacked on #4384 (DOC-7226-job-queue-blmove), which rewrites the claim() call and the connection-handling prose in these same files. This branch must be rebased onto main after #4384 merges; until then the diff against main also shows #4384's change. Three pipelines read their Response after the try block (claim, stats), so those Response variables are declared before it. sync() resolves them, so reading after close is fine. Verification: compiles with -Xlint:deprecation, zero warnings, against Jedis 8.0.2 (blmove from #4384 included). The baseline is #4384's code (JedisPool) run on the same jedis-8.0.2 jar, which still ships JedisPool, so only my change differs. The same 11-step scenario ran on both against redis:8.10 with --visibility-ms 1500 and gave byte-identical output: enqueue 20 and drain with 3 workers; hang_rate=1 so 4 jobs stay in processing; /reclaim moves them back and workers complete them (reclaimed_total=4); fail_rate=1 sends 3 jobs to failed after retries; 20 concurrent enqueues of 25 (500 jobs) all complete. The page's javac/java commands were extracted and run literally in a clean directory with the six jars. Constraint: stats() and claim() pipelines hold a pooled connection until closed; their Response objects stay valid after close Learned: a rename script that turns JedisPool into RedisClient also turns "new JedisPool(...)" into "new RedisClient(...)", which does not exist; grep for it after any bulk rename Learned: git grep with a "*" pathspec like content/.../*/java-jedis returned nothing silently; use a plain directory and filter the output, and run a control that must produce hits Ticket: DOC-7226 Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
andy-stark-redis
force-pushed
the
DOC-7226-jedis-pool-e
branch
from
October 30, 2026 13:37
01ec841 to
f0fa1bd
Compare
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.
Moves the job-queue
java-jedisuse case fromJedisPooltoRedisClient(Jedis 8.0.2).Stacked on #4384, which edits the same lines. The base is that PR's branch, so GitHub retargets this to
mainwhen #4384 merges; it may need a rebase then.Verified: 0 deprecation warnings; an 11-step scenario (drain, hang, reclaim, fail, 500 concurrent enqueues) gives byte-identical output to #4384's
JedisPoolcode on the same jar. Not run: Hugo build.Part of DOC-7226.
🤖 Generated with Claude Code
Note
Low Risk
Documentation and demo-only Java in the redis/docs repo; behavior was verified against the prior JedisPool implementation with no queue logic changes.
Overview
Migrates the java-jedis job-queue demo and docs from
JedisPool/ per-callgetResource()to Jedis 8’sRedisClient, without changing queue semantics (Lua scripts,BLMOVE, reclaim, etc.).DemoServer now builds a pooled client with
ConnectionPoolConfigandRedisClient.builder(), pings Redis on startup, and closesjedison shutdown instead ofjedisPool.RedisJobQueuetakes aRedisClient, calls Redis directly on that client, and usestry (Pipeline pipe = jedis.pipelined())instead of borrowing aJedisfrom the pool for each operation._index.mdupdates sample code, connection-pooling guidance, prerequisites, and compile/run classpath lines for Jedis 8.0.2 and its extra runtime jars.Reviewed by Cursor Bugbot for commit f0fa1bd. Bugbot is set up for automated code reviews on this repo. Configure here.