MCPcopy Index your code
hub / github.com/redis/jedis

github.com/redis/jedis @v7.5.3

repository ↗ · DeepWiki ↗ · release v7.5.3 ↗ · + Follow
13,347 symbols 75,240 edges 930 files 1,986 documented · 15% 20 cross-repo links updated todayv7.5.3 · 2026-07-01★ 12,34369 open issues
README

Jedis

Release Maven Central Javadocs MIT licensed codecov Discord

What is Jedis?

Jedis is a Java client for Redis designed for performance and ease of use.

Are you looking for a high-level library to handle object mapping? See redis-om-spring!

How do I Redis?

Learn for free at Redis University

Try the Redis Cloud

Dive in developer tutorials

Join the Redis community

Work at Redis

Supported Redis versions

The most recent version of this library supports redis version 7.2, 7.4, 8.0, 8.2 and 8.4.

The table below highlights version compatibility of the most-recent library versions with Redis and JDK versions. Compatibility means communication features, and Redis command capabilities.

Jedis version Supported Redis versions JDK Compatibility
3.9+ 5.0 to 6.2 Family of releases 8, 11
>= 4.0 Version 5.0 to 7.2 Family of releases 8, 11, 17
>= 5.0 Version 6.0 to current 8, 11, 17, 21
>= 5.2 Version 7.2 to current 8, 11, 17, 21
>= 6.0 Version 7.2 to current 8, 11, 17, 21
>= 7.0 Version 7.2 to current 8, 11, 17, 21

Getting started

To get started with Jedis, first add it as a dependency in your Java project. If you're using Maven, that looks like this:

<dependency>
    <groupId>redis.clients</groupId>
    <artifactId>jedis</artifactId>
    <version>7.1.0</version>
</dependency>

To use the cutting-edge Jedis, check here.

Next, you'll need to connect to Redis. Consider installing a redis server with docker:

docker run -p 6379:6379 -it redis:latest

You can instantiate a RedisClient like so:

RedisClient jedis = RedisClient.builder().hostAndPort("localhost", 6379).build();

Now you can send commands:

jedis.sadd("planets", "Venus");

Connecting to a Redis cluster

Jedis lets you connect to Redis Clusters, supporting the Redis Cluster Specification. To do this, you'll need to connect using RedisClusterClient. See the example below:

Set<HostAndPort> jedisClusterNodes = new HashSet<HostAndPort>();
jedisClusterNodes.add(new HostAndPort("127.0.0.1", 7379));
jedisClusterNodes.add(new HostAndPort("127.0.0.1", 7380));
RedisClusterClient jedis = RedisClusterClient.builder().nodes(jedisClusterNodes).build();

Now you can use the RedisClusterClient instance and send commands like you would with a standard pooled connection:

jedis.sadd("planets", "Mars");

Support for Redis data types

Jedis includes support for all Redis data types and features such as JSON and VectorSets.

Failover

Jedis supports retry and failover for your Redis deployments. This is useful when:

  1. You have more than one Redis deployment. This might include two independent Redis servers or two or more Redis databases replicated across multiple active-active Redis Enterprise clusters.
  2. You want your application to connect to one deployment at a time and to fail over to the next available deployment if the first deployment becomes unavailable.

For the complete failover configuration options and examples, see the Jedis failover docs.

Token-Based Authentication

Jedis supports Token-Based authentication (TBA) starting with 5.3.0 GA release. This feature is complemented by an extension library that enhances the developer experience and provides most of the components required for TBA functionality.

Notably, the extension library includes built-in support for Microsoft EntraID, offering a seamless integration as part of the generic solution.

For more details and examples, please refer to the Advanced Usage documentation.

Documentation

The Jedis documentation site contains several useful articles for using Jedis.

You can also check the latest Jedis Javadocs.

Some specific use-case examples can be found in redis.clients.jedis.examples package of the test source codes.

Troubleshooting

If you run into trouble or have any questions, we're here to help!

Hit us up on the Redis Discord Server or Jedis GitHub Discussions.

Contributing

We'd love your contributions!

Bug reports are always welcome! You can open a bug report on GitHub.

You can also contribute documentation -- or anything to improve Jedis. Please see contribution guideline for more details.

License

Jedis is licensed under the MIT license.

Sponsorship

Redis Logo

Extension points exported contracts — how you extend this code

CommandFlagsRegistry (Interface)
Registry interface for command flags. Provides a mapping from Redis commands to their flags. This interface allows for d [6 …
src/main/java/redis/clients/jedis/CommandFlagsRegistry.java
ExecutedAction (Interface)
(no doc) [55 implementers]
src/test/java/redis/clients/jedis/scenario/FakeApp.java
StrategySupplier (Interface)
Functional interface for creating HealthCheckStrategy instances for specific Redis endpoints. This supplier [17 implementers]
src/main/java/redis/clients/jedis/MultiDbConfig.java
Node (Interface)
Created by mnunberg on 2/23/18. Base node interface [59 implementers]
src/main/java/redis/clients/jedis/search/querybuilder/Node.java
InitializationPolicy (Interface)
Interface for initialization policies. An initialization policy determines when a multi-database connection is ready [9 …
src/main/java/redis/clients/jedis/mcf/InitializationPolicy.java
JsonObjectMapper (Interface)
Represents the ability of serialize an object to JSON format string and deserialize it to the typed object. @see Default [6 …
src/main/java/redis/clients/jedis/json/JsonObjectMapper.java

Core symbols most depended-on inside this repo

get
called by 4623
src/main/java/redis/clients/jedis/csc/Cache.java
executeCommand
called by 2539
src/main/java/redis/clients/jedis/executors/CommandExecutor.java
contains
called by 1755
src/main/java/redis/clients/jedis/BuilderFactory.java
add
called by 1688
src/main/java/redis/clients/jedis/CommandArguments.java
put
called by 1601
src/main/java/redis/clients/jedis/util/JedisByteMap.java
zadd
called by 1350
src/main/java/redis/clients/jedis/commands/SortedSetCommands.java
set
called by 1130
src/main/java/redis/clients/jedis/csc/Cache.java
size
called by 1056
src/main/java/redis/clients/jedis/util/JedisByteMap.java

Shape

Method 12,259
Class 888
Interface 135
Enum 64
Function 1

Languages

Java100%
TypeScript1%

Modules by API surface

src/main/java/redis/clients/jedis/Jedis.java452 symbols
src/main/java/redis/clients/jedis/CommandObjects.java452 symbols
src/main/java/redis/clients/jedis/UnifiedJedis.java438 symbols
src/main/java/redis/clients/jedis/PipeliningBase.java400 symbols
src/test/java/redis/clients/jedis/mocked/unified/UnifiedJedisSortedSetCommandsTest.java155 symbols
src/test/java/redis/clients/jedis/mocked/pipeline/PipeliningBaseSortedSetCommandsTest.java155 symbols
src/test/java/redis/clients/jedis/mocked/pipeline/PipeliningBaseGenericCommandsTest.java97 symbols
src/test/java/redis/clients/jedis/mocked/unified/UnifiedJedisGenericCommandsTest.java96 symbols
src/main/java/redis/clients/jedis/MultiDbConfig.java79 symbols
src/main/java/redis/clients/jedis/SSLSocketWrapper.java75 symbols
src/test/java/redis/clients/jedis/mocked/unified/UnifiedJedisJsonCommandsTest.java70 symbols
src/test/java/redis/clients/jedis/mocked/unified/UnifiedJedisHashCommandsTest.java69 symbols

Dependencies from manifests, versioned

ch.qos.logback:logback-classic1.2.13 · 1×
com.fasterxml.jackson.datatype:jackson-datatype-jsr310
com.kohlschutter.junixsocket:junixsocket-core2.10.1 · 1×
eu.rekawek.toxiproxy:toxiproxy-java2.1.11 · 1×
io.github.resilience4j:resilience4j-all
io.github.resilience4j:resilience4j-circuitbreaker
io.github.resilience4j:resilience4j-retry
net.javacrumbs.json-unit:json-unit2.40.1 · 1×
org.apache.commons:commons-pool22.12.1 · 1×
org.apache.httpcomponents.client5:httpclient5-fluent5.6 · 1×

For agents

$ claude mcp add jedis \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact