0

How can i integrate redis with spring boot?

After add the below dependecy, what would be the code structure for simply saving user details list where user name is the key and User object is the value in redis server. Then fetch a user details with a given user name?

<dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-redis</artifactId>
            <version>1.2.7.RELEASE</version>
</dependency>
Harshana
  • 7,297
  • 25
  • 99
  • 173

2 Answers2

4

Take a look at this example ... https://github.com/spring-projects/spring-boot/tree/master/spring-boot-samples/spring-boot-sample-data-redis

dturanski
  • 1,723
  • 1
  • 13
  • 8
0

Check this answer which is similar but with slightly different question

spring-data-redis redisTemplate Exception

Community
  • 1
  • 1
Tony Murphy
  • 711
  • 9
  • 22