Skip to main content

Serverless Redisson

This tutorial shows how to use Upstash with Redisson client.

See code

1 Create a Maven Project

Create a maven project and copy the follwing dependency to your pom.xml


2 Create a Redis (Upstash) Database

Create a database as getting started

3 Code

Create your java file and replace Redis password and URL below. If you enabled TLS, the endpoint should start with rediss

public class Main {

public static void main(String[] args) {
Config config = new Config();
// use "rediss://" for SSL connection
RedissonClient redisson = Redisson.create(config);
RMap<String, String> map = redisson.getMap("map");
map.put("foo", "bar");