Skip to content

Commit

Permalink
Sentinel module support JakartaEE
Browse files Browse the repository at this point in the history
  • Loading branch information
ruansheng8 committed Dec 14, 2022
1 parent cb74bc3 commit be4fa58
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 17 deletions.
4 changes: 2 additions & 2 deletions spring-cloud-alibaba-dependencies/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

<properties>
<revision>2022.0.0.0-SNAPSHOT</revision>
<sentinel.version>1.8.5</sentinel.version>
<sentinel.version>1.8.6</sentinel.version>
<seata.version>1.5.2</seata.version>
<nacos.client.version>2.0.4</nacos.client.version>
<spring.context.support.version>1.0.11</spring.context.support.version>
Expand Down Expand Up @@ -150,7 +150,7 @@

<dependency>
<groupId>com.alibaba.csp</groupId>
<artifactId>sentinel-spring-webmvc-adapter</artifactId>
<artifactId>sentinel-spring-webmvc-6x-adapter</artifactId>
<version>${sentinel.version}</version>
</dependency>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@

<dependency>
<groupId>com.alibaba.csp</groupId>
<artifactId>sentinel-spring-webmvc-adapter</artifactId>
<artifactId>sentinel-spring-webmvc-6x-adapter</artifactId>
</dependency>

<dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,9 +86,8 @@ public SentinelWebMvcConfig sentinelWebMvcConfig() {
}
else {
if (StringUtils.hasText(properties.getBlockPage())) {
// todo spring boot 3.0 upgrade: not support jakarta servlet
// sentinelWebMvcConfig.setBlockExceptionHandler(((request, response,
// e) -> response.sendRedirect(properties.getBlockPage())));
sentinelWebMvcConfig.setBlockExceptionHandler(((request, response,
e) -> response.sendRedirect(properties.getBlockPage())));
}
else {
sentinelWebMvcConfig
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,16 +101,15 @@ public String clean(String s) {
};
}

// todo spring boot 3.0 upgrade: not support jakarta servlet
// @Bean
// public RequestOriginParser requestOriginParser() {
// return new RequestOriginParser() {
// @Override
// public String parseOrigin(HttpServletRequest httpServletRequest) {
// return httpServletRequest.getRemoteAddr();
// }
// };
// }
@Bean
public RequestOriginParser requestOriginParser() {
return new RequestOriginParser() {
@Override
public String parseOrigin(HttpServletRequest httpServletRequest) {
return httpServletRequest.getRemoteAddr();
}
};
}

@Bean
public BlockExceptionHandler blockExceptionHandler() {
Expand Down
2 changes: 1 addition & 1 deletion spring-cloud-alibaba-tests/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<module>nacos-tests</module>
<!-- todo spring boot 3.0 upgrade: wait to support jdk17 and spring cloud stream -->
<!-- <module>rocketmq-tests</module> -->
<!-- <module>sentinel-tests</module> -->
<module>sentinel-tests</module>
</modules>

<properties>
Expand Down

0 comments on commit be4fa58

Please sign in to comment.