mirror of
https://gitee.com/mirrors/Spring-Cloud-Alibaba.git
synced 2021-06-26 13:25:11 +08:00
sentinel upgrade to 1.6.2, close #787
This commit is contained in:
@@ -22,6 +22,7 @@ package com.alibaba.cloud.sentinel.gateway;
|
||||
public interface ConfigConstants {
|
||||
|
||||
String APP_TYPE_ZUUL_GATEWAY = "12";
|
||||
String APP_TYPE_SCG_GATEWAY = "11";
|
||||
|
||||
String ZUUl_PREFIX = "spring.cloud.sentinel.zuul";
|
||||
|
||||
|
@@ -18,6 +18,7 @@ package com.alibaba.cloud.sentinel.gateway.scg;
|
||||
|
||||
import org.springframework.boot.context.properties.ConfigurationProperties;
|
||||
import org.springframework.boot.context.properties.NestedConfigurationProperty;
|
||||
import org.springframework.core.Ordered;
|
||||
|
||||
import com.alibaba.cloud.sentinel.gateway.ConfigConstants;
|
||||
import com.alibaba.cloud.sentinel.gateway.FallbackProperties;
|
||||
@@ -31,6 +32,8 @@ public class SentinelGatewayProperties {
|
||||
@NestedConfigurationProperty
|
||||
private FallbackProperties fallback;
|
||||
|
||||
private Integer order = Ordered.HIGHEST_PRECEDENCE;
|
||||
|
||||
public FallbackProperties getFallback() {
|
||||
return fallback;
|
||||
}
|
||||
@@ -40,4 +43,11 @@ public class SentinelGatewayProperties {
|
||||
return this;
|
||||
}
|
||||
|
||||
public Integer getOrder() {
|
||||
return order;
|
||||
}
|
||||
|
||||
public void setOrder(Integer order) {
|
||||
this.order = order;
|
||||
}
|
||||
}
|
||||
|
@@ -45,7 +45,6 @@ import org.springframework.web.server.ServerWebExchange;
|
||||
|
||||
import com.alibaba.cloud.sentinel.gateway.ConfigConstants;
|
||||
import com.alibaba.cloud.sentinel.gateway.FallbackProperties;
|
||||
import com.alibaba.csp.sentinel.adapter.gateway.common.SentinelGatewayConstants;
|
||||
import com.alibaba.csp.sentinel.adapter.gateway.sc.SentinelGatewayFilter;
|
||||
import com.alibaba.csp.sentinel.adapter.gateway.sc.callback.BlockRequestHandler;
|
||||
import com.alibaba.csp.sentinel.adapter.gateway.sc.callback.GatewayCallbackManager;
|
||||
@@ -94,7 +93,7 @@ public class SentinelSCGAutoConfiguration {
|
||||
|
||||
private void initAppType() {
|
||||
System.setProperty(SentinelConfig.APP_TYPE,
|
||||
String.valueOf(SentinelGatewayConstants.APP_TYPE_GATEWAY));
|
||||
String.valueOf(ConfigConstants.APP_TYPE_SCG_GATEWAY));
|
||||
}
|
||||
|
||||
private void initFallback() {
|
||||
@@ -149,8 +148,10 @@ public class SentinelSCGAutoConfiguration {
|
||||
@Order(-1)
|
||||
@ConditionalOnMissingBean
|
||||
public SentinelGatewayFilter sentinelGatewayFilter() {
|
||||
logger.info("[Sentinel SpringCloudGateway] register SentinelGatewayFilter");
|
||||
return new SentinelGatewayFilter();
|
||||
logger.info(
|
||||
"[Sentinel SpringCloudGateway] register SentinelGatewayFilter with order: {}",
|
||||
gatewayProperties.getOrder());
|
||||
return new SentinelGatewayFilter(gatewayProperties.getOrder());
|
||||
}
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user