Jedis - Redis(레디스) 자바 API

2023. 8. 1. 22:38Java

작성일 : 2018. 11. 19

JedisPoolConfig jedisPoolConfig = new JedisPoolConfig();
JedisPool pool = new JedisPool(jedisPoolConfig, "localhost");


Jedis jedis = pool.getResource();


Map<String, String> m_value = new HashMap<String, String>();
m_value.put("summary", "Moderate High");
m_value.put("status", "7444");
m_value.put("mesg_title", "error");
m_value.put("mesg_content", "exception");

jedis.hmset("R20181119333", m_value);//Map 으로 넣고


//가져올 땐 List<String> 으로 받는다
List<String> return = jedis.hmget("R20181119333", new String[] {"summary", "mesg_content"});
System.out.println(return);

-----

[Moderate High, exception]

Jedis 사용법이 잘 정리된 문서 : 

https://www.baeldung.com/jedis-java-redis-client-library