mirror of
https://gitee.com/mirrors/Spring-Cloud-Alibaba.git
synced 2021-06-26 13:25:11 +08:00
sentinel zuul refactor sync in 1.x
This commit is contained in:
@@ -310,6 +310,12 @@ public class SentinelProperties {
|
||||
*/
|
||||
private List<String> urlPatterns;
|
||||
|
||||
/**
|
||||
* Enable to instance
|
||||
* {@link com.alibaba.csp.sentinel.adapter.servlet.CommonFilter}.
|
||||
*/
|
||||
private boolean enabled = true;
|
||||
|
||||
public int getOrder() {
|
||||
return this.order;
|
||||
}
|
||||
@@ -325,7 +331,15 @@ public class SentinelProperties {
|
||||
public void setUrlPatterns(List<String> urlPatterns) {
|
||||
this.urlPatterns = urlPatterns;
|
||||
}
|
||||
}
|
||||
|
||||
public boolean isEnabled() {
|
||||
return enabled;
|
||||
}
|
||||
|
||||
public void setEnabled(boolean enabled) {
|
||||
this.enabled = enabled;
|
||||
}
|
||||
}
|
||||
|
||||
public static class Log {
|
||||
|
||||
|
@@ -49,7 +49,8 @@ public class SentinelWebAutoConfiguration {
|
||||
private SentinelProperties properties;
|
||||
|
||||
@Bean
|
||||
public FilterRegistrationBean servletRequestListener() {
|
||||
@ConditionalOnProperty(name = "spring.cloud.sentinel.filter.enabled", matchIfMissing = true)
|
||||
public FilterRegistrationBean sentinelFilter() {
|
||||
FilterRegistrationBean registration = new FilterRegistrationBean();
|
||||
|
||||
SentinelProperties.Filter filterConfig = properties.getFilter();
|
||||
|
@@ -39,6 +39,12 @@
|
||||
"defaultValue": "Integer.MIN_VALUE",
|
||||
"description": "sentinel filter chain order, will be set to FilterRegistrationBean."
|
||||
},
|
||||
{
|
||||
"name": "spring.cloud.sentinel.filter.enabled",
|
||||
"type": "java.lang.Boolean",
|
||||
"defaultValue": true,
|
||||
"description": "Enable to instance com.alibaba.csp.sentinel.adapter.servlet.CommonFilter."
|
||||
},
|
||||
{
|
||||
"name": "spring.cloud.sentinel.metric.charset",
|
||||
"type": "java.lang.String",
|
||||
|
Reference in New Issue
Block a user