Advertisement
Guest User

Untitled

a guest
Aug 18th, 2019
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.67 KB | None | 0 0
  1. ....
  2.  
  3. MyData store(final MyData myData);
  4.  
  5. @CachePut(cacheNames = {"my-data"}, key = "#myData.id")
  6.  
  7. public MyData store(final MyData myData) {
  8.  
  9. log.debug("storing in redis"); // This is printed only once (but actual cache operation is happening twice
  10. return myData;
  11. }
  12.  
  13. redis:
  14.  
  15. timeout: 500
  16.  
  17. host: devserver
  18.  
  19. port: 26379
  20.  
  21. datasource:
  22.  
  23. url: jdbc:h2:mem:testdb;Mode=Oracle;DB_CLOSE_ON_EXIT=FALSE
  24.  
  25. platform: h2
  26.  
  27. redis:
  28.  
  29. cache:
  30.  
  31. my-data:
  32.  
  33. ttl: 15m
  34.  
  35. serializer:
  36.  
  37. type: >org.springframework.data.redis.serializer.Jackson2JsonRedisSerializer
  38.  
  39. handles: com.my.sample.model.MyData
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement