Merge pull request #72 from lepdou/upgrade_polaris_version

upgrade polaris version to 1.3.0
pull/73/head
Haotian Zhang 3 years ago committed by GitHub
commit e57bd14ccf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -11,4 +11,8 @@
- [feat:optimize project structure and checkstyle](https://github.com/Tencent/spring-cloud-tencent/pull/56) - [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: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: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 * 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 * CONDITIONS OF ANY KIND, either express or implied. See the License for the
* specific language governing permissions and limitations under the License. * specific language governing permissions and limitations under the License.
*
*/ */
package com.tencent.cloud.polaris.ratelimit.constant; package com.tencent.cloud.polaris.ratelimit.constant;
@ -34,7 +35,7 @@ public final class RateLimitConstant {
/** /**
* Info of rate limit. * 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() { private RateLimitConstant() {
} }

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

@ -63,7 +63,7 @@
<properties> <properties>
<revision>1.2.0-Hoxton.SR9-SNAPSHOT</revision> <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> <powermock.version>2.0.0</powermock.version>
<!-- Maven Plugin Versions --> <!-- Maven Plugin Versions -->

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

Loading…
Cancel
Save