1 Star 2 Fork 0

1024 / mw-rediscover

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README
Apache-2.0

rediscover

Language Springboot Redis Maven

目录

一、组件概述

  • 1.此组件支持springBoot2.2.*及以上版本
  • 2.如果项目侧要做acl缓存权限管理,请使用redis6.x并且按照下面集成步骤,升级redis到6.x,spring-data-redis到2.5.6,lettuce-core到6.1.5.RELEASE或者jedis到3.6.3
  • 3.此缓存组件,三大块功能,1).redis缓存基本功能 2).jetCache分布式缓存功能 3).redisson高级功能,包括分布式锁,限流器,分布式map等

二、组件优势

  • 1.集成简单 此组件包含三大功能,引入配置即可
  • 2.使用简单 此组件在开源组件上做封装,不改变原来开源组件的使用习惯,学习使用成本极低
  • 3.用户无感知 此组件对redis的操作,自动化定制redis的key前缀
  • 4.扩展性 不满意自动化的定制,用户实现接口可自己定制key前缀
  • 5.兼容性 兼容低版本springBoot,损失部分功能的同时兼容低版本redis
  • 6.灵活性 通过maven引入排除的方式,做到功能的可插拔

三、缓存组件说明

  • 1.组件通过aop拦截StringRedisSerializer的bean,因此在序列化key时,用此bean,实现定制化key的目的
 a.默认情况下,是获取yml配置文件中${spring.redis.username}:${spring.profiles.active}:${spring.application.name}作为key前缀,如果yml中未配置,默认会是default:dev:rediscover
 b.如果项目侧自定义redisTemplate对象,则序列化key时,则将StringRedisSerializer交于spring管理
 c.如果用户key以“global:"开头,则定制的key为${spring.redis.username}:${spring.profiles.active}:key,去掉项目名称,代表多个项目可以操作,获取此全局key的值,也需要加上global:
  • 2.在redis基本功能,如果项目侧需要自定义key前缀,实现接口NameSpaceKey即可
  • 3.在redisson功能中,如果项目侧需要自定义key前缀,实现NameMapper接口即可,如果用户未自定义key前缀,则与redis缓存基本功能key前缀一致,其他使用方法与原生一样,注意在用分布式锁时,配置前缀外,还需要加入~redisson_lock__channel*权限
  • 4.jetCache分布式缓存功能,通过yml配置,jetCache下keyPrefix完成前缀的定制,使用方法与原生一样,
a.本地缓存一致性用redis发布订阅完成,是否开启发布订阅缓存消息,配置tcl.rediscover.redis.cache.publish.enable默认false,渠道topic配置为tcl.rediscover.redis.cache.topic,默认值jetCacheSyncTopic
b.redis订阅消息不可靠,对于强一致性项目,建议用专业MQ实现,配置tcl.rediscover.redis.cache.publish.enable为false,发布消息类,继承AbstractCacheMessagePublisher即可完成,缓存变更后的消息发送
  • 5.redis连接类型通过redis下面的client-type: jedis配置,如果不配置,默认是lettuce
  • 6.tcl.rediscover.redis.serialize.type配置redis值序列化类型:jdk,fastjson,jackson,protostuff。默认jackson
  • 7.组件内日志打印皆是debug,如果需要调试,请开始debug日志

四、缓存组件集成步骤

redis6以下版本

  • 1 maven引入jar包(通过maven引入的方式实现三大功能板块的可插拔)
        <dependency>
             <groupId>com.tcl.rediscover</groupId>
             <artifactId>rediscover-spring-boot-starter</artifactId>
             <version>1.0-SNAPSHOT</version>
         </dependency>
    
    例如:如果只需要redis基本功能,则maven引入如下配置
          <dependency>
             <groupId>com.tcl.rediscover</groupId>
             <artifactId>rediscover-spring-boot-starter</artifactId>
             <version>1.0-SNAPSHOT</version>
             <exclusions>
                 <exclusion>
                     <groupId>com.alicp.jetcache</groupId>
                     <artifactId>jetcache-starter-redis-springdata</artifactId>
                 </exclusion>
                 <exclusion>
                     <groupId>org.redisson</groupId>
                     <artifactId>redisson-spring-boot-starter</artifactId>
                 </exclusion>
             </exclusions>
         </dependency>
  • 2 yml配置修改(主要是redis配置,对于已有的在原有基础上做修改)
    # 集群模式 jedis
    spring:
      redis:
        client-type: jedis
        timeout: 6000ms
        password: 123456
        cluster:
          max-redirects: 3  # 获取失败 最大重定向次数
          nodes:
            - 192.168.220.101:6380
            - 192.168.220.101:6381
            - 192.168.220.102:6380
            - 192.168.220.102:6381
            - 192.168.220.103:6380
            - 192.168.220.103:6381
        jedis:
          pool:
            max-active: 1000  #连接池最大连接数(使用负值表示没有限制)
            max-idle: 90 # 连接池中的最大空闲连接
            min-idle: 15 # 连接池中的最小空闲连接
            max-wait: -1 # 连接池最大阻塞等待时间(使用负值表示没有限制)
    
    # 集群模式lettuce
    spring:
     redis:
      client-type: lettuce
      timeout: 6000ms
      password: 123456
      cluster:
        max-redirects: 3  # 获取失败 最大重定向次数
        nodes:
          - 192.168.220.101:6380
          - 192.168.220.101:6381
          - 192.168.220.102:6380
          - 192.168.220.102:6381
          - 192.168.220.103:6380
          - 192.168.220.103:6381
      lettuce:
        pool:
          max-active: 1000  #连接池最大连接数(使用负值表示没有限制)
          max-idle: 90 # 连接池中的最大空闲连接
          min-idle: 15 # 连接池中的最小空闲连接
          max-wait: -1 # 连接池最大阻塞等待时间(使用负值表示没有限制)
    # 哨兵模式jedis
    spring:
      redis:
        client-type: jedis
        timeout: 6000ms
        password: 123456
        jedis:
          pool:
            max-active: 8
            max-wait: -1ms
            max-idle: 8
            min-idle: 0
        sentinel:
          master: mymaster
          password: 123456
          nodes: 192.168.220.101:26379, 192.168.220.102:26379, 192.168.220.103:26379
    # 哨兵模式lettuce
      spring:
        redis:
          client-type: lettuce
          timeout: 6000ms
          password: 123456
          lettuce:
            pool:
              max-active: 8
              max-wait: -1ms
              max-idle: 8
              min-idle: 0
         sentinel:
           master: mymaster
           password: 123456
           nodes: 192.168.220.101:26379, 192.168.220.102:26379, 192.168.220.103:26379
  • 3.如果需要使用jetCache缓存组件,则放开maven的exclusion,同时yml添加如下配置
jetcache:
 statIntervalMinutes: 15
 areaInCacheName: false
 local:
   default:
     type: caffeine
     keyConvertor: fastjson
     limit: 100
 remote:
   default:
     type: redis.springdata
     keyConvertor: fastjson
     keyPrefix: projectPrefix # 此处为项目定制key前缀
     valueEncoder: kryo
     valueDecoder: kryo
     poolConfig:
       minIdle: 5
       maxIdle: 20
       maxTotal: 50

redis6.x版本

  • 1 maven引入jar包(通过maven引入的方式实现三大功能板块的可插拔)

        <dependency>
             <groupId>com.tcl.rediscover</groupId>
             <artifactId>rediscover-spring-boot-starter</artifactId>
             <version>1.0-SNAPSHOT</version>
         </dependency>
          <dependency>
              <groupId>org.springframework.data</groupId>
              <artifactId>spring-data-redis</artifactId>
              <version>2.5.6</version>
          </dependency>
          <dependency>
              <groupId>io.lettuce</groupId>
              <artifactId>lettuce-core</artifactId>
              <version>6.1.5.RELEASE</version>
          </dependency>
          <dependency>
              <groupId>redis.clients</groupId>
              <artifactId>jedis</artifactId>
              <version>3.6.3</version>
          </dependency>
    
    例如:如果只需要redis基本功能,则maven引入如下配置
        <dependency>
           <groupId>com.tcl.rediscover</groupId>
           <artifactId>rediscover-spring-boot-starter</artifactId>
           <version>1.0-SNAPSHOT</version>
           <exclusions>
               <exclusion>
                   <groupId>com.alicp.jetcache</groupId>
                   <artifactId>jetcache-starter-redis-springdata</artifactId>
               </exclusion>
               <exclusion>
                   <groupId>org.redisson</groupId>
                   <artifactId>redisson-spring-boot-starter</artifactId>
               </exclusion>
           </exclusions>
       </dependency>
         <dependency>
              <groupId>org.springframework.data</groupId>
              <artifactId>spring-data-redis</artifactId>
              <version>2.5.6</version>
          </dependency>
          <dependency>
              <groupId>io.lettuce</groupId>
              <artifactId>lettuce-core</artifactId>
              <version>6.1.5.RELEASE</version>
          </dependency>
          <dependency>
              <groupId>redis.clients</groupId>
              <artifactId>jedis</artifactId>
              <version>3.6.3</version>
          </dependency>
  • 2 yml配置修改(主要是redis配置,对于已有的在原有基础上做修改)

    # 集群模式 jedis
    spring:
      redis:
        client-type: jedis
        timeout: 6000ms
        username: rediscover # 与低版本相比增加了用户隔离,如果redis未配置用户,默认配default
        password: 123456
        cluster:
          max-redirects: 3  # 获取失败 最大重定向次数
          nodes:
            - 192.168.220.101:6380
            - 192.168.220.101:6381
            - 192.168.220.102:6380
            - 192.168.220.102:6381
            - 192.168.220.103:6380
            - 192.168.220.103:6381
        jedis:
          pool:
            max-active: 1000  #连接池最大连接数(使用负值表示没有限制)
            max-idle: 90 # 连接池中的最大空闲连接
            min-idle: 15 # 连接池中的最小空闲连接
            max-wait: -1 # 连接池最大阻塞等待时间(使用负值表示没有限制)
    
    # 集群模式lettuce
    spring:
     redis:
      client-type: lettuce
      timeout: 6000ms
      username: rediscover # 与低版本相比增加了用户隔离,如果redis未配置用户,默认配default
      password: 123456
      cluster:
        max-redirects: 3  # 获取失败 最大重定向次数
        nodes:
          - 192.168.220.101:6380
          - 192.168.220.101:6381
          - 192.168.220.102:6380
          - 192.168.220.102:6381
          - 192.168.220.103:6380
          - 192.168.220.103:6381
      lettuce:
        pool:
          max-active: 1000  #连接池最大连接数(使用负值表示没有限制)
          max-idle: 90 # 连接池中的最大空闲连接
          min-idle: 15 # 连接池中的最小空闲连接
          max-wait: -1 # 连接池最大阻塞等待时间(使用负值表示没有限制)
    # 哨兵模式jedis
    spring:
      redis:
        client-type: jedis
        timeout: 6000ms
        username: rediscover # 与低版本相比增加了用户隔离,如果redis未配置用户,默认配default
        password: 123456
        jedis:
          pool:
            max-active: 8
            max-wait: -1ms
            max-idle: 8
            min-idle: 0
       sentinel:
         master: mymaster
         username: sentinelUser
         password: 123456
         nodes: 192.168.220.101:26379, 192.168.220.102:26379, 192.168.220.103:26379
    # 哨兵模式lettuce
      spring:
        redis:
          client-type: lettuce
          timeout: 6000ms
          username: rediscover # 与低版本相比增加了用户隔离,如果redis未配置用户,默认配default
          password: 123456
          lettuce:
            pool:
              max-active: 8
              max-wait: -1ms
              max-idle: 8
              min-idle: 0
         sentinel:
           master: mymaster
           username: sentinelUser
           password: 123456
           nodes: 192.168.220.101:26379, 192.168.220.102:26379, 192.168.220.103:26379
  • 3.如果需要使用jetCache缓存组件,则放开maven的exclusion,同时yml添加如下配置

jetcache:
 statIntervalMinutes: 15
 areaInCacheName: false
 local:
   default:
     type: caffeine
     keyConvertor: fastjson
     limit: 100
 remote:
   default:
     type: redis.springdata
     keyConvertor: fastjson
     keyPrefix: ${spring.redis.username}:${spring.profiles.active} # 此处为项目定制key前缀,默认为此配置
     valueEncoder: kryo
     valueDecoder: kryo
     poolConfig:
       minIdle: 5
       maxIdle: 20
       maxTotal: 50

五、redis acl用户权限功能

集群模式acl用户配置

所有节点配置相同

    1. redis.conf 配置
 aclfile /root/redis-6.2.6/conf/users.acl # 文件方式配置用户权限
 masteruser "default" #用default用户用作集群间的交互
 masterauth "123456"
    1. users.acl 配置 默认密码是123456
user default on #8d969eef6ecad3c29a3a629280e686cf0c3f5d5a86aff3ca12020c923adc6c92 ~* &* +@all
user rediscover on #8d969eef6ecad3c29a3a629280e686cf0c3f5d5a86aff3ca12020c923adc6c92 ~rediscover:uat* &* +@read +@write -@dangerous

哨兵模式

所有数据节点的配置

  • 1.redis.conf 配置
 aclfile /root/redis-6.2.6/conf/users.acl # 文件方式配置用户权限
 masteruser "default" #用default用户用作节点间的交互
 masterauth "123456"
    1. users.acl 配置 默认密码是123456
user default on #8d969eef6ecad3c29a3a629280e686cf0c3f5d5a86aff3ca12020c923adc6c92 ~* &* +@all
user rediscover on #8d969eef6ecad3c29a3a629280e686cf0c3f5d5a86aff3ca12020c923adc6c92 ~rediscover:uat* &* +@read +@write -@dangerous

所有哨兵节点配置相同

  • 1.sentinel.conf 配置
     sentinel auth-pass mymaster 123456
     sentinel auth-user mymaster default #用default用户进行数据节点间的交互
     aclfile "/root/redis-6.2.6/conf/sentinel-users.acl"
     sentinel sentinel-user default #用default用户进行哨兵节点间的交互
     sentinel sentinel-pass 123456
    
  • 2.sentinel-users.acl 配置
user default on #8d969eef6ecad3c29a3a629280e686cf0c3f5d5a86aff3ca12020c923adc6c92 ~* &* +@all
user sentinelUser on #8d969eef6ecad3c29a3a629280e686cf0c3f5d5a86aff3ca12020c923adc6c92 ~* &* +@connection

具体使用参考 ACL使用

六、项目侧使用

redis基本功能使用

  • 1.RedisUtils工具类,封装了常用方法,例如:RedisUtils.set("a","bba")
    如果工具类里面没有的,则
    RedisUtils.getRedisTemplate.opsForValue.set("aa","bba")
    或者
    @Autowired
    private RedisTemplate redisTemplate;
    redisTemplate.opsForValue.set("aa","bba")
    
  • 2.防抖功能
  @PostMapping("/submit")
  @MultiSubmit
  public String submit(@RequestBody User user) {
  }

redisson用法

  • 1.分布式锁
@Autowired
private RedissonClient redissonClient;
 
  RLock lock = redissonClient.getLock(key);
       try {
           lock.lock();
           //业务代码
           
       } catch (Exception e) {
           log.error("线程被打断",e);
       } finally {
           lock.unlock();
       } 
  • 2.限流器
  RRateLimiter rateLimiter = redissonClient.getRateLimiter(key);
   // 最大流速 = 每10秒钟产生1个令牌
   rateLimiter.trySetRate(RateType.OVERALL, 1, 10, RateIntervalUnit.SECONDS);
   //需要1个令牌
   if(rateLimiter.tryAcquire(1)) {
         return "访问成功";
    } else {
         return "系统繁忙,请稍后重试";
    }     
  • 3.分布式map单条数据淘汰
    RMapCache<Object, Object> mapCache = redissonClient.getMapCache("cities", new StringCodec("utf-8"));
      if(mapCache.size()<=0) {
          mapCache.put(1,"libai",10,TimeUnit.SECONDS);
          mapCache.put(2,"dufu",3, TimeUnit.SECONDS);
      }
      return mapCache.values().toString();

jetCache缓存用法

  • 1.基于注解的用法
  • 2.属性输入的用法
 启动类上加入 @EnableCreateCacheAnnotation
 
 @CreateCache(name = ":user:", expire = 3600, cacheType = CacheType.BOTH, localLimit = 50)
 private Cache<Long, User> userCache;
 

结果展示,显示如下****则集成成功

  .   ____          _            __ _ _
 /\\ / ___'_ __ _ _(_)_ __  __ _ \ \ \ \
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
 \\/  ___)| |_)| | | | | || (_| |  ) ) ) )
  '  |____| .__|_| |_|_| |_\__, | / / / /
 =========|_|==============|___/=/_/_/_/
 :: Spring Boot ::        (v2.3.3.RELEASE)

2021-11-30 11:08:10.258 [main] INFO  com.tcl.rediscover.redis.demo.Application - Starting Application on sz-00194633 with PID 16500 (E:\proboot\demo\target\classes started by liangxi.zeng in E:\proboot)
2021-11-30 11:08:10.263 [main] INFO  com.tcl.rediscover.redis.demo.Application - The following profiles are active: uat
2021-11-30 11:08:11.550 [main] INFO  o.s.d.r.config.RepositoryConfigurationDelegate - Multiple Spring Data modules found, entering strict repository configuration mode!
2021-11-30 11:08:11.554 [main] INFO  o.s.d.r.config.RepositoryConfigurationDelegate - Bootstrapping Spring Data Redis repositories in DEFAULT mode.
2021-11-30 11:08:11.594 [main] INFO  o.s.d.r.config.RepositoryConfigurationDelegate - Finished Spring Data repository scanning in 21ms. Found 0 Redis repository interfaces.
2021-11-30 11:08:12.623 [main] INFO  o.s.boot.web.embedded.tomcat.TomcatWebServer - Tomcat initialized with port(s): 9988 (http)
2021-11-30 11:08:12.633 [main] INFO  org.apache.coyote.http11.Http11NioProtocol - Initializing ProtocolHandler ["http-nio-9988"]
2021-11-30 11:08:13.069 [main] INFO  c.t.r.r.c.namespace.key.DefaultNameSpaceKeyHandler - ****redis加载默认DefaultNameSpaceKey权限key构造器****
2021-11-30 11:08:13.073 [main] INFO  c.t.r.redis.core.redisson.NameSpaceKeyNameMapper - ****redisson加载默认NameSpaceKeyNameMapper权限key构造器****
2021-11-30 11:08:13.321 [main] INFO  org.redisson.Version - Redisson 3.16.4
2021-11-30 11:08:15.387 [main] INFO  c.a.jetcache.autoconfigure.AbstractCacheAutoInit - init cache area default , type= redis.springdata
2021-11-30 11:08:15.422 [main] INFO  c.a.jetcache.autoconfigure.AbstractCacheAutoInit - init cache area default , type= caffeine
2021-11-30 11:08:15.429 [main] INFO  c.t.r.r.c.n.aop.AspectStringRedisKeySerializer - ****redis权限key拦截启动****
2021-11-30 11:08:15.660 [main] INFO  org.apache.coyote.http11.Http11NioProtocol - Starting ProtocolHandler ["http-nio-9988"]
2021-11-30 11:08:15.695 [main] INFO  o.s.boot.web.embedded.tomcat.TomcatWebServer - Tomcat started on port(s): 9988 (http) with context path ''
2021-11-30 11:08:16.200 [main] INFO  com.tcl.rediscover.redis.demo.Application - Started Application in 6.423 seconds (JVM running for 7.073)

七、FAQ

* 问题1:
  项目启动:
    ***************************
APPLICATION FAILED TO START
***************************

Description:

An attempt was made to call a method that does not exist. The attempt was made from the following location:

    com.tcl.digitization.proboot.redis.configuration.RedisConnectionConfiguration.getClusterConfiguration(RedisConnectionConfiguration.java:95)

The following method did not exist:

    org.springframework.data.redis.connection.RedisClusterConfiguration.setUsername(Ljava/lang/String;)V
	
	
问题分析:1.升级redis到6.x版本,支持acl用户权限控制,spring-data-redis到2.5.6,lettuce-core到6.1.5.RELEASE或者jedis到3.6.3
          2.去掉redis用户配置,低版本不支持此配置,redis不支持acl,namespace一样可以增加相应前缀
 * 问题 2:
       项目启动:`
          Caused by: org.redisson.client.RedisException: ERR AUTH <password> called without any password configured for the default user. Are you sure your configuration is correct?. channel: [id: 0xfe21eabd, L:/10.88.84.96:63933 - R:10.74.151.20/10.74.151.20:32185] command: (AUTH), params: (password masked)
	at org.redisson.client.handler.CommandDecoder.decode(CommandDecoder.java:370)
	at org.redisson.client.handler.CommandDecoder.decodeCommand(CommandDecoder.java:198)
	at org.redisson.client.handler.CommandDecoder.decode(CommandDecoder.java:137)
	at org.redisson.client.handler.CommandDecoder.decode(CommandDecoder.java:113)
	at io.netty.handler.codec.ByteToMessageDecoder.decodeRemovalReentryProtection(ByteToMessageDecoder.java:501)
	at io.netty.handler.codec.ReplayingDecoder.callDecode(ReplayingDecoder.java:366)
	at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:276)
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379)
	
	解决方案:redis配置中password错误,或者配置了password为空
 * 问题 3:
   @Cached的key、condition等表达式中使用参数名以后缓存没有生效
javac编译器需要指定-parameters参数以后才会把参数名信息写入到字节码中,然后才能被反射机制读取,默认情况下这个参数是没有指定的。

pom中的指定方式:

<plugins>
    <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-compiler-plugin</artifactId>
        <version>3.7.0</version>
        <configuration>
            <source>1.8</source>
            <target>1.8</target>
            <compilerArgument>-parameters</compilerArgument>
        </configuration>
    </plugin>
</plugins>
  * 问题 4:
   Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.
16:31:32.478 [restartedMain] ERROR o.s.b.SpringApplication - [reportFailure,837] - Application run failed
org.springframework.beans.factory.BeanDefinitionStoreException: Failed to process import candidates for configuration class [com.tcl.agp.server.web.ServerApplication]; nested exception is org.springframework.context.annotation.ConflictingBeanDefinitionException: Annotation-specified bean name 'redisUtils' for bean class [com.tcl.rediscover.redis.core.util.RedisUtils] conflicts with existing, non-compatible bean definition of same name and class [com.tcl.agp.server.common.utils.redis.RedisUtils]
	at org.springframework.context.annotation.ConfigurationClassParser.processImports(ConfigurationClassParser.java:609)
	at org.springframework.context.annotation.ConfigurationClassParser.access$800(ConfigurationClassParser.java:110)
	at org.springframework.context.annotation.ConfigurationClassParser$DeferredImportSelectorGroupingHandler.lambda$processGroupImports$1(ConfigurationClassParser.java:811)
	at java.util.ArrayList.forEach(ArrayList.java:1257)
	at org.springframework.boot.devtools.restart.RestartLauncher.run(RestartLauncher.java:49)
Caused by: org.springframework.context.annotation.ConflictingBeanDefinitionException: Annotation-specified bean name 'redisUtils' for bean class [com.tcl.rediscover.redis.core.util.RedisUtils] conflicts with existing, non-compatible bean definition of same name and class [com.tcl.agp.server.common.utils.redis.RedisUtils]
	at org.springframework.context.annotation.ClassPathBeanDefinitionScanner.checkCandidate(ClassPathBeanDefinitionScanner.java:349)
	at org.springframework.context.annotation.ClassPathBeanDefinitionScanner.doScan(ClassPathBeanDefinitionScanner.java:287)
	at org.springframework.context.annotation.ComponentScanAnnotationParser.parse(ComponentScanAnnotationParser.java:132)
	at org.springframework.context.annotation.ConfigurationClassParser.doProcessConfigurationClass(ConfigurationClassParser.java:295)
	at org.springframework.context.annotation.ConfigurationClassParser.processConfigurationClass(ConfigurationClassParser.java:249)
	at org.springframework.context.annotation.ConfigurationClassParser.processImports(ConfigurationClassParser.java:599)
	... 25 common frames omitted
	
	解决方案: 1.删除项目中的RedisUtils类,使用组件的工具类
	         2. @Component("redisUtilsCustomer")
                public class RedisUtils
                

八、支持与帮助

Apache License Version 2.0, January 2004 http://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 1. Definitions. "License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. "Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. "Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. "You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. "Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. "Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. "Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). "Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. "Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." "Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. 2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. 3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. 4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: (a) You must give any other recipients of the Work or Derivative Works a copy of this License; and (b) You must cause any modified files to carry prominent notices stating that You changed the files; and (c) You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and (d) If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. 5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. 6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. 7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. 8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. 9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. END OF TERMS AND CONDITIONS APPENDIX: How to apply the Apache License to your work. To apply the Apache License to your work, attach the following boilerplate notice, with the fields enclosed by brackets "[]" replaced with your own identifying information. (Don't include the brackets!) The text should be enclosed in the appropriate comment syntax for the file format. We also recommend that a file or class name and description of purpose be included on the same "printed page" as the copyright notice for easier identification within third-party archives. Copyright [yyyy] [name of copyright owner] Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

简介

redis缓存组件整合,完成redis缓存acl权限管理的基本操作,集成分布式锁,限流器,分布式缓存,分布式map等功能 展开 收起
Java
Apache-2.0
取消

发行版

暂无发行版

贡献者

全部

近期动态

加载更多
不能加载更多了
Java
1
https://gitee.com/zenglx/mw-rediscover.git
git@gitee.com:zenglx/mw-rediscover.git
zenglx
mw-rediscover
mw-rediscover
master

搜索帮助