Skip to content

Commit 5bd232f

Browse files
committed
Up version
1 parent 4085611 commit 5bd232f

11 files changed

Lines changed: 50 additions & 13 deletions

File tree

.ci/deploy.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#!/usr/bin/env bash
2+
3+
mvn -pl '!spring-cloud-zuul-ratelimit-coverage' clean deploy -Pdeploy-parent -fn

README.md

Lines changed: 37 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ Add the dependency on pom.xml
2525
<dependency>
2626
<groupId>com.marcosbarbero.cloud</groupId>
2727
<artifactId>spring-cloud-zuul-ratelimit</artifactId>
28-
<version>1.3.4.RELEASE</version>
28+
<version>1.4.0.RELEASE</version>
2929
</dependency>
3030
```
3131

@@ -137,9 +137,13 @@ Policy properties:
137137

138138
Further Customization
139139
---
140+
This section details how to add custom implementations
140141

141-
If your application needs to control the key strategy beyond the options offered by the type property then you can
142-
supply a custom `RateLimitKeyGenerator` implementation adding further qualifiers or something entirely different:
142+
### Key Generator
143+
144+
If the application needs to control the key strategy beyond the options offered by the type property then it can
145+
be done just by creating a custom `RateLimitKeyGenerator` implementation adding further qualifiers or something
146+
entirely different:
143147

144148
```java
145149
@Bean
@@ -153,6 +157,36 @@ supply a custom `RateLimitKeyGenerator` implementation adding further qualifiers
153157
}
154158
```
155159

160+
### Error Handling
161+
This framework uses some 3rd party applications to store and control the rate limit access, as it does not has control
162+
over those applications and they can fail once a while the framework itself handles the failure in the class
163+
`DefaultRateLimiterErrorHandler` just by adding some error logs.
164+
165+
If there is a need to handle the errors differently, it can be achieved just by defining a custom `RateLimiterErrorHandler`
166+
bean, e.g:
167+
168+
```java
169+
@Bean
170+
public RateLimiterErrorHandler rateLimitErrorHandler() {
171+
return new DefaultRateLimiterErrorHandler() {
172+
@Override
173+
public void handleSaveError(String key, Exception e) {
174+
// custom code
175+
}
176+
177+
@Override
178+
public void handleFetchError(String key, Exception e) {
179+
// custom code
180+
}
181+
182+
@Override
183+
public void handleError(String msg, Exception e) {
184+
// custom code
185+
}
186+
}
187+
}
188+
```
189+
156190
Contributing
157191
---
158192
Spring Cloud Zuul Rate Limit is released under the non-restrictive Apache 2.0 license, and follows a very

pom.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
]]>
2020
</description>
2121
<url>https://github.com/marcosbarbero/spring-cloud-zuul-ratelimit</url>
22-
<version>1.3.4.RELEASE</version>
22+
<version>1.4.0.RELEASE</version>
2323

2424
<licenses>
2525
<license>
@@ -34,7 +34,7 @@
3434
<maven.compiler.source>1.8</maven.compiler.source>
3535
<java.version>1.8</java.version>
3636
<nexus-staging-maven-plugin.version>1.6.3</nexus-staging-maven-plugin.version>
37-
<global.version>1.3.4.RELEASE</global.version>
37+
<global.version>1.4.0.RELEASE</global.version>
3838
<jacoco.version>0.7.9</jacoco.version>
3939
<jacoco.it.execution.data.file>
4040
${project.build.directory}/coverage-reports/jacoco.exec

spring-cloud-starter-zuul-ratelimit/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<parent>
66
<artifactId>spring-cloud-zuul-ratelimit-parent</artifactId>
77
<groupId>com.marcosbarbero.cloud</groupId>
8-
<version>1.3.4.RELEASE</version>
8+
<version>1.4.0.RELEASE</version>
99
<relativePath>..</relativePath>
1010
</parent>
1111
<modelVersion>4.0.0</modelVersion>

spring-cloud-zuul-ratelimit-core/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<parent>
77
<groupId>com.marcosbarbero.cloud</groupId>
88
<artifactId>spring-cloud-zuul-ratelimit-parent</artifactId>
9-
<version>1.3.4.RELEASE</version>
9+
<version>1.4.0.RELEASE</version>
1010
<relativePath>..</relativePath>
1111
</parent>
1212

spring-cloud-zuul-ratelimit-coverage/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<parent>
66
<artifactId>spring-cloud-zuul-ratelimit-parent</artifactId>
77
<groupId>com.marcosbarbero.cloud</groupId>
8-
<version>1.3.4.RELEASE</version>
8+
<version>1.4.0.RELEASE</version>
99
<relativePath>../pom.xml</relativePath>
1010
</parent>
1111

spring-cloud-zuul-ratelimit-dependencies/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
<groupId>com.marcosbarbero.cloud</groupId>
99
<artifactId>spring-cloud-zuul-ratelimit-dependencies</artifactId>
10-
<version>1.3.4.RELEASE</version>
10+
<version>1.4.0.RELEASE</version>
1111
<packaging>pom</packaging>
1212
<url>https://github.com/marcosbarbero/spring-cloud-zuul-ratelimit</url>
1313

spring-cloud-zuul-ratelimit-tests/consul/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<parent>
66
<artifactId>spring-cloud-zuul-ratelimit-parent</artifactId>
77
<groupId>com.marcosbarbero.cloud</groupId>
8-
<version>1.3.4.RELEASE</version>
8+
<version>1.4.0.RELEASE</version>
99
<relativePath>../../pom.xml</relativePath>
1010
</parent>
1111
<modelVersion>4.0.0</modelVersion>

spring-cloud-zuul-ratelimit-tests/inmemory/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<parent>
77
<artifactId>spring-cloud-zuul-ratelimit-parent</artifactId>
88
<groupId>com.marcosbarbero.cloud</groupId>
9-
<version>1.3.4.RELEASE</version>
9+
<version>1.4.0.RELEASE</version>
1010
<relativePath>../../pom.xml</relativePath>
1111
</parent>
1212

spring-cloud-zuul-ratelimit-tests/redis/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<parent>
66
<artifactId>spring-cloud-zuul-ratelimit-parent</artifactId>
77
<groupId>com.marcosbarbero.cloud</groupId>
8-
<version>1.3.4.RELEASE</version>
8+
<version>1.4.0.RELEASE</version>
99
<relativePath>../../pom.xml</relativePath>
1010
</parent>
1111

0 commit comments

Comments
 (0)