Skip to content

beifei1/limiter-spring-boot-starter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 

Repository files navigation

limiter-spring-boot-starter

使用springboot和redisson实现的web api放重放锁

处理模式

拒绝、排队

判断唯一请求标识

header、param

可自定义响应数据

使用方式

应用依赖redis

spring.redis.host = xxxx
spring.redis.port = xxx
spring.redis.password = xxx
spring.redis.database = 2

如果应用未配置redissonClient则会默认注入一个

  1. 引入stater
<dependency>
    <groupId>cn.fire.limiter</groupId>
    <artifactId>limiter-spring-boot-starter</artifactId>
</dependency>
  1. 在需要控制的控制器或类上加入注解,优先使用方法注解
@WebLimiter(expire = 2, timeunit = TimeUnit.SECONDS, handler = DefaultResponseHandler.class, unique = UniqueEnum.HEADER, access = AccessEnum.DENY)

About

使用springboot和redisson实现的web api放重放锁

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages