1. upgrade polaris-java version to 1.3.0

2. fix ratelimit desc when deny request
3. fix circuit break example bug
pull/72/head
lepdou 3 years ago
parent a1f2526949
commit e747a2a711

@ -11,4 +11,8 @@
- [feat:optimize project structure and checkstyle](https://github.com/Tencent/spring-cloud-tencent/pull/56)
- [feat:divide storage and transfer of metadata.](https://github.com/Tencent/spring-cloud-tencent/pull/63)
- [feat:support polaris config center.](https://github.com/Tencent/spring-cloud-tencent/pull/69)
- [feat:optimize metadata module.](https://github.com/Tencent/spring-cloud-tencent/pull/70)
- [feat: optimize pom dependency and demo](https://github.com/Tencent/spring-cloud-tencent/pull/71)
- [feat:upgrade polaris version to 1.3.0.](https://github.com/Tencent/spring-cloud-tencent/pull/72)

@ -13,6 +13,7 @@
* under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
* CONDITIONS OF ANY KIND, either express or implied. See the License for the
* specific language governing permissions and limitations under the License.
*
*/
package com.tencent.cloud.polaris.ratelimit.constant;
@ -34,7 +35,7 @@ public final class RateLimitConstant {
/**
* Info of rate limit.
*/
public static String QUOTA_LIMITED_INFO = "request blocked by polaris, reason is ";
public static String QUOTA_LIMITED_INFO = "The request is deny by rate limit because the throttling threshold is reached";
private RateLimitConstant() {
}

@ -13,6 +13,7 @@
* under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
* CONDITIONS OF ANY KIND, either express or implied. See the License for the
* specific language governing permissions and limitations under the License.
*
*/
package com.tencent.cloud.polaris.ratelimit.filter;
@ -76,8 +77,7 @@ public class QuotaCheckServletFilter extends OncePerRequestFilter {
localNamespace, localService, 1, labels, null);
if (quotaResponse.getCode() == QuotaResultCode.QuotaResultLimited) {
response.setStatus(TOO_MANY_REQUESTS.value());
response.getWriter().write(
RateLimitConstant.QUOTA_LIMITED_INFO + quotaResponse.getInfo());
response.getWriter().write(RateLimitConstant.QUOTA_LIMITED_INFO);
}
else {
filterChain.doFilter(request, response);

@ -63,7 +63,7 @@
<properties>
<revision>1.2.0-Hoxton.SR9-SNAPSHOT</revision>
<polaris.version>1.3.0-SNAPSHOT</polaris.version>
<polaris.version>1.3.0</polaris.version>
<powermock.version>2.0.0</powermock.version>
<!-- Maven Plugin Versions -->

@ -13,12 +13,14 @@
* under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
* CONDITIONS OF ANY KIND, either express or implied. See the License for the
* specific language governing permissions and limitations under the License.
*
*/
package com.tencent.cloud.polaris.circuitbreaker.example;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.loadbalancer.LoadBalanced;
import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.context.annotation.Bean;
import org.springframework.web.client.RestTemplate;
@ -37,6 +39,7 @@ public class ServiceA {
}
@Bean
@LoadBalanced
public RestTemplate restTemplate() {
return new RestTemplate();
}

Loading…
Cancel
Save