Browse Source

redis限流

pull/2/head
马府强 2 years ago
parent
commit
0816d4e678
  1. BIN
      redis限流/target/classes/META-INF/org/apache/logging/log4j/core/config/plugins/Log4j2Plugins.dat
  2. 19
      redis限流/target/classes/application.properties
  3. BIN
      redis限流/target/classes/com/yomahub/tlog/example/feign/TLogFeignConsumerRunner.class
  4. BIN
      redis限流/target/classes/com/yomahub/tlog/example/feign/aop/RedisLimit.class
  5. BIN
      redis限流/target/classes/com/yomahub/tlog/example/feign/aop/RedisLimitAop.class
  6. BIN
      redis限流/target/classes/com/yomahub/tlog/example/feign/configuration/Log4j2Rule.class
  7. BIN
      redis限流/target/classes/com/yomahub/tlog/example/feign/configuration/RedisConfig.class
  8. BIN
      redis限流/target/classes/com/yomahub/tlog/example/feign/controller/LimitRedisController.class
  9. BIN
      redis限流/target/classes/com/yomahub/tlog/example/feign/exception/GlobalExceptionHandler.class
  10. BIN
      redis限流/target/classes/com/yomahub/tlog/example/feign/exception/RedisLimitException.class
  11. BIN
      redis限流/target/classes/com/yomahub/tlog/example/feign/vo/ResultInfo.class
  12. 16
      redis限流/target/classes/rateLimiter.lua

BIN
redis限流/target/classes/META-INF/org/apache/logging/log4j/core/config/plugins/Log4j2Plugins.dat

Binary file not shown.

19
redis限流/target/classes/application.properties

@ -1,19 +0,0 @@
spring.application.name=tlog-logback-feign-consumer
server.port=3111
#eureka.client.service-url.defaultZone=http://127.0.0.1:1111/eureka/
tlog.pattern=[$currIp][$spanId][$traceId]
#spring.cloud.nacos.discovery.server-addr=127.0.0.1:8848
http.connectTimeOutMillis=8000
http.readTimeOutMillis=8000
spring.task.execution.pool.core-size=5
spring.task.execution.pool.max-size=50
spring.task.execution.pool.queue-capacity=200
spring.task.execution.thread-name-prefix=woniugege-
spring.redis.host=192.168.56.10
spring.redis.password=123456
spring.redis.port=6379

BIN
redis限流/target/classes/com/yomahub/tlog/example/feign/TLogFeignConsumerRunner.class

Binary file not shown.

BIN
redis限流/target/classes/com/yomahub/tlog/example/feign/aop/RedisLimit.class

Binary file not shown.

BIN
redis限流/target/classes/com/yomahub/tlog/example/feign/aop/RedisLimitAop.class

Binary file not shown.

BIN
redis限流/target/classes/com/yomahub/tlog/example/feign/configuration/Log4j2Rule.class

Binary file not shown.

BIN
redis限流/target/classes/com/yomahub/tlog/example/feign/configuration/RedisConfig.class

Binary file not shown.

BIN
redis限流/target/classes/com/yomahub/tlog/example/feign/controller/LimitRedisController.class

Binary file not shown.

BIN
redis限流/target/classes/com/yomahub/tlog/example/feign/exception/GlobalExceptionHandler.class

Binary file not shown.

BIN
redis限流/target/classes/com/yomahub/tlog/example/feign/exception/RedisLimitException.class

Binary file not shown.

BIN
redis限流/target/classes/com/yomahub/tlog/example/feign/vo/ResultInfo.class

Binary file not shown.

16
redis限流/target/classes/rateLimiter.lua

@ -1,16 +0,0 @@
--获取KEY
local key = KEYS[1]
local limit = tonumber(ARGV[1])
local curentLimit = tonumber(redis.call('get', key) or "0")
if curentLimit + 1 > limit
then return 0
else
-- 自增长 1
redis.call('INCRBY', key, 1)
-- 设置过期时间
redis.call('EXPIRE', key, ARGV[2])
return curentLimit + 1
end
Loading…
Cancel
Save