-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
perf($api-gateway): pass rate limiter configuration dynamically
- Loading branch information
1 parent
45c528b
commit 0bd97b0
Showing
3 changed files
with
55 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
41 changes: 41 additions & 0 deletions
41
.../com/jmsoftware/maf/apigateway/universal/configuration/RedisRateLimiterConfiguration.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
package com.jmsoftware.maf.apigateway.universal.configuration; | ||
|
||
import lombok.Data; | ||
import org.springframework.boot.context.properties.ConfigurationProperties; | ||
import org.springframework.cloud.context.config.annotation.RefreshScope; | ||
import org.springframework.context.annotation.Configuration; | ||
import org.springframework.validation.annotation.Validated; | ||
|
||
import javax.validation.constraints.NotBlank; | ||
|
||
/** | ||
* <h1>RedisRateLimiterConfiguration</h1> | ||
* | ||
* @author Johnny Miller (锺俊), email: johnnysviva@outlook.com, date: 3/1/2021 9:59 AM | ||
*/ | ||
@Data | ||
@Validated | ||
@RefreshScope | ||
@Configuration | ||
@ConfigurationProperties(prefix = RedisRateLimiterConfiguration.PREFIX) | ||
public class RedisRateLimiterConfiguration { | ||
/** | ||
* The constant PREFIX. | ||
*/ | ||
public static final String PREFIX = "maf.configuration.redis-rate-limiter"; | ||
/** | ||
* The Replenish rate. | ||
*/ | ||
@NotBlank | ||
private String replenishRate; | ||
/** | ||
* The Burst capacity. | ||
*/ | ||
@NotBlank | ||
private String burstCapacity; | ||
/** | ||
* The Requested tokens. | ||
*/ | ||
@NotBlank | ||
private String requestedTokens; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters