Skip to content

Commit a2916d0

Browse files
committed
ApiBoot RateLimiter 添加默认的Config Centre
1 parent 001a7e9 commit a2916d0

File tree

1 file changed

+43
-0
lines changed
  • api-boot-project/api-boot-plugins/api-boot-plugin-rate-limiter/src/main/java/org/minbox/framework/api/boot/plugin/rate/limiter/centre/support

1 file changed

+43
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
/*
2+
* Copyright [2019] [恒宇少年 - 于起宇]
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*
16+
*/
17+
18+
package org.minbox.framework.api.boot.plugin.rate.limiter.centre.support;
19+
20+
import org.minbox.framework.api.boot.common.exception.ApiBootException;
21+
22+
/**
23+
* default rate limiter config centre
24+
*
25+
* @author:恒宇少年 - 于起宇
26+
* <p>
27+
* DateTime:2019-05-07 15:51
28+
* Blog:http://blog.yuqiyu.com
29+
* WebSite:http://www.jianshu.com/u/092df3f77bca
30+
* Gitee:https://gitee.com/hengboy
31+
* GitHub:https://github.com/hengboy
32+
*/
33+
public class DefaultRateLimiterConfigCentre extends AbstractRateLimiterConfigCentre {
34+
@Override
35+
public Long getQps(String configKey) throws ApiBootException {
36+
return DEFAULT_QPS;
37+
}
38+
39+
@Override
40+
public void setQps(String configKey, Long QPS) throws ApiBootException {
41+
//...
42+
}
43+
}

0 commit comments

Comments
 (0)