spring-boot-starter-current-limiting

Current limiting tool based on leak bucket algorithm and token bucket algorithm.

License

License

Categories

Categories

Spring Boot Container Microservices
GroupId

GroupId

cn.yueshutong
ArtifactId

ArtifactId

spring-boot-starter-current-limiting
Last Version

Last Version

0.1.1.RELEASE
Release Date

Release Date

Type

Type

jar
Description

Description

spring-boot-starter-current-limiting
Current limiting tool based on leak bucket algorithm and token bucket algorithm.
Project URL

Project URL

https://github.com/yueshutong/spring-boot-starter-current-limiting
Source Code Management

Source Code Management

https://github.com/yueshutong/spring-boot-starter-current-limiting.git

Download spring-boot-starter-current-limiting

How to add to project

<!-- https://jarcasting.com/artifacts/cn.yueshutong/spring-boot-starter-current-limiting/ -->
<dependency>
    <groupId>cn.yueshutong</groupId>
    <artifactId>spring-boot-starter-current-limiting</artifactId>
    <version>0.1.1.RELEASE</version>
</dependency>
// https://jarcasting.com/artifacts/cn.yueshutong/spring-boot-starter-current-limiting/
implementation 'cn.yueshutong:spring-boot-starter-current-limiting:0.1.1.RELEASE'
// https://jarcasting.com/artifacts/cn.yueshutong/spring-boot-starter-current-limiting/
implementation ("cn.yueshutong:spring-boot-starter-current-limiting:0.1.1.RELEASE")
'cn.yueshutong:spring-boot-starter-current-limiting:jar:0.1.1.RELEASE'
<dependency org="cn.yueshutong" name="spring-boot-starter-current-limiting" rev="0.1.1.RELEASE">
  <artifact name="spring-boot-starter-current-limiting" type="jar" />
</dependency>
@Grapes(
@Grab(group='cn.yueshutong', module='spring-boot-starter-current-limiting', version='0.1.1.RELEASE')
)
libraryDependencies += "cn.yueshutong" % "spring-boot-starter-current-limiting" % "0.1.1.RELEASE"
[cn.yueshutong/spring-boot-starter-current-limiting "0.1.1.RELEASE"]

Dependencies

compile (2)

Group / Artifact Type Version
org.springframework.boot : spring-boot-starter-aop jar 2.1.4.RELEASE
org.springframework.boot : spring-boot-configuration-processor jar 2.1.4.RELEASE

provided (2)

Group / Artifact Type Version
org.springframework.boot : spring-boot-starter-web jar 2.1.4.RELEASE
org.springframework.boot : spring-boot-starter-data-redis jar 2.1.4.RELEASE

Project Modules

There are no modules declared in this project.

💝 SnowJena

What

基于令牌桶算法实现的分布式无锁限流框架,支持动态配置规则,支持可视化监控,开箱即用。

Document

使用文档:中文|English

功能概要

限流 降级 授权 注解 监控
黑名单 白名单 控制台 分布式 高可用

设计模式

单例模式 观察者模式 工厂模式 建造者模式 MVC模式
全局配置 动态规则 生产限流器 限流规则 控制台

Quick Start

Maven

<dependency>
  <groupId>com.github.onblog</groupId>
  <artifactId>snowjena-core</artifactId>
  <version>4.0.0.RELEASE</version>
</dependency>

本地限流

public class AppTest {
    Logger logger = LoggerFactory.getLogger(getClass());

    /**
     * 本地限流
     */
    @Test
    public void test1() {
        // 1.配置规则
        RateLimiterRule rateLimiterRule = new RateLimiterRuleBuilder()
                .setLimit(1)
                .setPeriod(1)
                .setUnit(TimeUnit.SECONDS) //每秒令牌数为1
                .build();
        // 2.工厂模式生产限流器
        RateLimiter limiter = RateLimiterFactory.of(rateLimiterRule);
        // 3.使用
        while (true) {
            if (limiter.tryAcquire()) {
                logger.info("ok");
            }
        }
    }

}

About

Email:[email protected]

如果帮助到你了,请不吝赞赏!谢谢!

Versions

Version
0.1.1.RELEASE
0.1.0.RELEASE
0.0.9.RELEASE
0.0.8.RELEASE
0.0.7.RELEASE
0.0.6.RELEASE
0.0.5.RELEASE
0.0.3.RELEASE
0.0.2.SNAPSHOOT
0.0.2.RELEASE
0.0.1.RELEASE