2023 update sentinel (#3777)

pull/3784/head
Robert Lu 7 months ago committed by GitHub
parent d835a8a3a6
commit 1af2a95bfb
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -19,7 +19,7 @@
<properties>
<revision>2023.0.1.0</revision>
<sentinel.version>1.8.6</sentinel.version>
<sentinel.version>1.8.8</sentinel.version>
<nacos.client.version>2.3.2</nacos.client.version>
<seata.version>2.0.0</seata.version>
<spring.context.support.version>1.0.11</spring.context.support.version>
@ -167,7 +167,7 @@
<dependency>
<groupId>com.alibaba.csp</groupId>
<artifactId>sentinel-spring-webmvc-6x-adapter</artifactId>
<artifactId>sentinel-spring-webmvc-v6x-adapter</artifactId>
<version>${sentinel.version}</version>
</dependency>

@ -109,7 +109,7 @@
<dependency>
<groupId>com.alibaba.csp</groupId>
<artifactId>sentinel-spring-webmvc-6x-adapter</artifactId>
<artifactId>sentinel-spring-webmvc-v6x-adapter</artifactId>
</dependency>
<dependency>

@ -18,12 +18,12 @@ package com.alibaba.cloud.sentinel;
import java.util.Optional;
import com.alibaba.csp.sentinel.adapter.spring.webmvc.SentinelWebInterceptor;
import com.alibaba.csp.sentinel.adapter.spring.webmvc.callback.BlockExceptionHandler;
import com.alibaba.csp.sentinel.adapter.spring.webmvc.callback.DefaultBlockExceptionHandler;
import com.alibaba.csp.sentinel.adapter.spring.webmvc.callback.RequestOriginParser;
import com.alibaba.csp.sentinel.adapter.spring.webmvc.callback.UrlCleaner;
import com.alibaba.csp.sentinel.adapter.spring.webmvc.config.SentinelWebMvcConfig;
import com.alibaba.csp.sentinel.adapter.spring.webmvc_v6x.SentinelWebInterceptor;
import com.alibaba.csp.sentinel.adapter.spring.webmvc_v6x.callback.BlockExceptionHandler;
import com.alibaba.csp.sentinel.adapter.spring.webmvc_v6x.callback.DefaultBlockExceptionHandler;
import com.alibaba.csp.sentinel.adapter.spring.webmvc_v6x.callback.RequestOriginParser;
import com.alibaba.csp.sentinel.adapter.spring.webmvc_v6x.config.SentinelWebMvcConfig;
import com.alibaba.csp.sentinel.adapter.web.common.UrlCleaner;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@ -86,8 +86,10 @@ public class SentinelWebAutoConfiguration implements WebMvcConfigurer {
}
else {
if (StringUtils.hasText(properties.getBlockPage())) {
sentinelWebMvcConfig.setBlockExceptionHandler(((request, response,
e) -> response.sendRedirect(properties.getBlockPage())));
sentinelWebMvcConfig.setBlockExceptionHandler(
(request, response, resourceName, e) ->
response.sendRedirect(properties.getBlockPage())
);
}
else {
sentinelWebMvcConfig

@ -18,7 +18,7 @@ package com.alibaba.cloud.sentinel;
import java.util.Optional;
import com.alibaba.csp.sentinel.adapter.spring.webmvc.SentinelWebInterceptor;
import com.alibaba.csp.sentinel.adapter.spring.webmvc_v6x.SentinelWebInterceptor;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

@ -17,11 +17,11 @@
package com.alibaba.cloud.sentinel;
import com.alibaba.cloud.sentinel.custom.SentinelAutoConfiguration;
import com.alibaba.csp.sentinel.adapter.spring.webmvc.callback.BlockExceptionHandler;
import com.alibaba.csp.sentinel.adapter.spring.webmvc.callback.DefaultBlockExceptionHandler;
import com.alibaba.csp.sentinel.adapter.spring.webmvc.callback.RequestOriginParser;
import com.alibaba.csp.sentinel.adapter.spring.webmvc.callback.UrlCleaner;
import com.alibaba.csp.sentinel.adapter.spring.webmvc.config.SentinelWebMvcConfig;
import com.alibaba.csp.sentinel.adapter.spring.webmvc_v6x.callback.BlockExceptionHandler;
import com.alibaba.csp.sentinel.adapter.spring.webmvc_v6x.callback.DefaultBlockExceptionHandler;
import com.alibaba.csp.sentinel.adapter.spring.webmvc_v6x.callback.RequestOriginParser;
import com.alibaba.csp.sentinel.adapter.spring.webmvc_v6x.config.SentinelWebMvcConfig;
import com.alibaba.csp.sentinel.adapter.web.common.UrlCleaner;
import jakarta.servlet.http.HttpServletRequest;
import org.junit.Test;
import org.junit.runner.RunWith;

Loading…
Cancel
Save