【问题标题】:what is the better way to implement auditing in redis cache (using redis as persistant storage) in spring boot?在spring boot中实现redis缓存(使用redis作为持久存储)审计的更好方法是什么?
【发布时间】:2020-10-28 13:11:45
【问题描述】:

审核类

public class Audit {
    private Long createdDateTime;
    private Long updatedDateTime;
    private String createdBy;
    private String updatedBy;
}

实体

public class User extends Audit {
  

}

有没有办法在 spring redis 中监听 Entity update/create 事件?

【问题讨论】:

  • 据我了解,redis是你唯一的坚持?那么使用休眠环境有什么问题呢?

标签: java spring-boot redis redisson datapersistance


【解决方案1】:

到目前为止,更新/创建事件只能在 spring-data-jpa 中捕获。为什么不使用 spring-data-jpa 作为永久存储,因为它有更多的内置功能和 redis 作为缓存存储?

【讨论】:

  • 使用 redisson 代替 Jedis(spring data)
猜你喜欢
  • 2014-12-14
  • 2017-11-22
  • 2022-08-20
  • 2021-07-04
  • 2020-02-16
  • 2011-01-27
  • 2018-12-16
  • 1970-01-01
  • 2022-01-17
相关资源
最近更新 更多