- Library: Jedis
- Library version : 3.4.0
- Runtime Version: JDK 12
- RS version: 6.0.8-32
- OSS Redis: 6.0.6
Simple | Sentinel | Cluster | |
---|---|---|---|
Y | Y | Y | |
TLS | Y | N/A | Y |
- N/A : Not Available
- N/C : Not researched or checked
- Simple fast library, documentation can be struggle see tests
- Does not support TLS with Sentinel. see PR
- A more comprehensive example from Julien is available in SA repo
- No auto-reconnect OOTB but using connection pooling gives you some of that. StackOverflow
- Pipelining with the Cluster API in Jedis is tedious and manual and application has to make sure all commands in pipeline are for the same slot
Install Java JDK
cd to jedis directory
./mvnw clean package
Password is optional for all samples
java -cp ./target/jedissample-1.0-SNAPSHOT-jar-with-dependencies.jar com.rl.sample.jedis.Simple host port password
java -cp ./target/jedissample-1.0-SNAPSHOT-jar-with-dependencies.jar com.rl.sample.jedis.Sentinel host port service password
java -cp ./target/jedissample-1.0-SNAPSHOT-jar-with-dependencies.jar com.rl.sample.jedis.Cluster host port password
java -cp ./target/jedissample-1.0-SNAPSHOT-jar-with-dependencies.jar \
-Djavax.net.ssl.keyStoreType=pkcs12 \
-Djavax.net.ssl.keyStore=../../testscripts/tls/db_cert.pfx \
-Djavax.net.ssl.keyStorePassword=${BUNDLE_PASSWORD} \
-Djavax.net.ssl.trustStoreType=jks \
-Djavax.net.ssl.trustStore=../../testscripts/tls/sample_ca_truststore.jks \
-Djavax.net.ssl.trustStorePassword=${BUNDLE_PASSWORD} \
-Djavax.net.debug=ssl \
com.rl.sample.jedis.SimpleTLS host port password
java -cp ./target/jedissample-1.0-SNAPSHOT-jar-with-dependencies.jar \
-Djavax.net.ssl.keyStoreType=pkcs12 \
-Djavax.net.ssl.keyStore=../../testscripts/tls/db_cert.pfx \
-Djavax.net.ssl.keyStorePassword=${BUNDLE_PASSWORD} \
-Djavax.net.ssl.trustStoreType=jks \
-Djavax.net.ssl.trustStore=../../testscripts/tls/sample_ca_truststore.jks \
-Djavax.net.ssl.trustStorePassword=${BUNDLE_PASSWORD} \
-Djavax.net.debug=ssl \
com.rl.sample.jedis.ClusterTLS host port password