Baike.dev
All toolsOnline toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
J

jedis

> 数据库
Open source

Redis Java client

12.3K stars0 likes2 views
WebsiteGitHub

About

Redis Java client

Jedis

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, 8.4, 8.6, 8.8 and 8.10.

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
>= 8.0 Version 7.2 to current 8, 11, 17, 21, 25

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:

xml
<dependency>
    <groupId>redis.clients</groupId>
    <artifactId>jedis</artifactId>
    <version>8.0.1</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:

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

You can instantiate a RedisClient like so:

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

Now you can send commands:

java
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:

java
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:

java
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.

To report a security vulnerability, please follow our Security Policy.

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

Issues· 128 open

View all issuesOpen on GitHub
  • #4755

    MultiDbClient never recovers after total outage: health check scheduler dies when failover has no candidate

    bugUpdated Sep 28, 2026
  • #4752

    JedisSentinelPool hands out connections to the demoted master after failover

    Updated Sep 26, 2026
  • #4710

    StreamEntryID cannot parse stream IDs in the upper half of the unsigned 64-bit range

    enhancementwaiting-for-feedbackUpdated Sep 25, 2026
  • #3839

    BUG/Connection Leak:cannot close SentinelListener connection in a JedisSentineled/JedisSentinelPool mode when executing method close

    bugUpdated Sep 23, 2026
  • #4685

    Cluster slot for String keys ignores byte-level hash tag under a DBCS default charset

    bugUpdated Sep 21, 2026
  • #4734

    CommandArguments causes unnecessary array copies for large commands

    Updated Sep 18, 2026
  • #4728

    Percent-encoded colon in URI username shifts the user/password split

    Updated Sep 17, 2026
  • #4705

    Jedis(URI, JedisClientConfig) drops SslOptions, widening TLS trust to JVM defaults

    waiting-for-triageUpdated Sep 14, 2026
  • #4722

    `UnifiedJedis.subscribe()` returns a still-subscribed connection to the pool when the subscribe loop exits abnormally

    Updated Sep 4, 2026
  • #4720

    Keyless commands throw NoSuchElementException on the cluster replica path

    Updated Aug 31, 2026

> Tags

Javajavajedisredisredis-client

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedSep 28, 2026
Category数据库
PricingOpen source

> Related tools

P
PostgreSQL
功能强大的开源关系型数据库
R
Redis
内存数据结构存储,常用作缓存与队列
M
MySQL
广泛使用的开源关系型数据库