-
Notifications
You must be signed in to change notification settings - Fork 178
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- 重大更新 1. Spring Boot 版本升级至 2.6.1 2. Spring Cloud 版本升级至 2021.0.0 3. 新增 Sentinel 自动降级处理机制。 - 其它更新 1. 解决 JetCache 2.6.0 在 Spring Boot 2.6.X 环境下,Bean 循环依赖问题。 2. 解决 Spring Cloud Alibaba Sentinel 2021.1 在 Spring Boot 2.6.X 环境下,Bean 循环依赖问题。 3. 解决 Spring Boot 2.6.X 环境下,由于代码方法变更,导致接口自动化扫描抛空错误问题。 4. 解决 Sentinel 与 Feign 冲突问题。 5. 解决 Spring Cloud OAuth2 由于无用代码的注入,导致的 Bean 循环依赖问题。
- Loading branch information
1 parent
fd2854e
commit 8164985
Showing
47 changed files
with
873 additions
and
86 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
97 changes: 97 additions & 0 deletions
97
...-cache/src/main/java/cn/herodotus/eurynome/cache/configuration/JetCacheConfiguration.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,97 @@ | ||
/* | ||
* Copyright (c) 2019-2021 Gengwei Zheng ([email protected]) | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed 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 specific language governing permissions and | ||
* limitations under the License. | ||
* | ||
* Project Name: eurynome-cloud | ||
* Module Name: eurynome-cloud-cache | ||
* File Name: JetCacheConfiguration.java | ||
* Author: gengwei.zheng | ||
* Date: 2021/12/04 13:38:04 | ||
*/ | ||
|
||
package cn.herodotus.eurynome.cache.configuration; | ||
|
||
import cn.herodotus.eurynome.cache.enhance.jetcache.JetCacheBuilder; | ||
import com.alicp.jetcache.anno.config.EnableCreateCacheAnnotation; | ||
import com.alicp.jetcache.anno.support.ConfigProvider; | ||
import com.alicp.jetcache.anno.support.GlobalCacheConfig; | ||
import com.alicp.jetcache.anno.support.SpringConfigProvider; | ||
import com.alicp.jetcache.autoconfigure.AutoConfigureBeans; | ||
import com.alicp.jetcache.autoconfigure.JetCacheProperties; | ||
import org.slf4j.Logger; | ||
import org.slf4j.LoggerFactory; | ||
import org.springframework.boot.autoconfigure.condition.ConditionalOnBean; | ||
import org.springframework.boot.context.properties.EnableConfigurationProperties; | ||
import org.springframework.context.annotation.Bean; | ||
import org.springframework.context.annotation.Configuration; | ||
|
||
import javax.annotation.PostConstruct; | ||
|
||
/** | ||
* <p>Description: JetCacheConfiguration </p> | ||
* | ||
* 新增JetCache配置,解决JetCache依赖循环问题 | ||
* | ||
* @author : gengwei.zheng | ||
* @date : 2021/12/4 13:38 | ||
*/ | ||
@Configuration | ||
@EnableConfigurationProperties(JetCacheProperties.class) | ||
@EnableCreateCacheAnnotation | ||
public class JetCacheConfiguration { | ||
|
||
private static final Logger log = LoggerFactory.getLogger(JetCacheConfiguration.class); | ||
|
||
@PostConstruct | ||
public void postConstruct() { | ||
log.debug("[Herodotus] |- Plugin [Herodotus JetCache] Auto Configure."); | ||
} | ||
|
||
@Bean | ||
public AutoConfigureBeans autoConfigureBeans() { | ||
AutoConfigureBeans autoConfigureBeans = new AutoConfigureBeans(); | ||
log.trace("[Herodotus] |- Bean [Auto Configure Beans] Auto Configure."); | ||
return autoConfigureBeans; | ||
} | ||
|
||
@Bean | ||
public GlobalCacheConfig globalCacheConfig(AutoConfigureBeans autoConfigureBeans, JetCacheProperties jetCacheProperties) { | ||
GlobalCacheConfig globalCacheConfig = new GlobalCacheConfig(); | ||
globalCacheConfig.setHiddenPackages(jetCacheProperties.getHiddenPackages()); | ||
globalCacheConfig.setStatIntervalMinutes(jetCacheProperties.getStatIntervalMinutes()); | ||
globalCacheConfig.setAreaInCacheName(jetCacheProperties.isAreaInCacheName()); | ||
globalCacheConfig.setPenetrationProtect(jetCacheProperties.isPenetrationProtect()); | ||
globalCacheConfig.setEnableMethodCache(jetCacheProperties.isEnableMethodCache()); | ||
globalCacheConfig.setLocalCacheBuilders(autoConfigureBeans.getLocalCacheBuilders()); | ||
globalCacheConfig.setRemoteCacheBuilders(autoConfigureBeans.getRemoteCacheBuilders()); | ||
log.trace("[Herodotus] |- Bean [Global Cache Config] Auto Configure."); | ||
return globalCacheConfig; | ||
} | ||
|
||
@Bean | ||
@ConditionalOnBean(GlobalCacheConfig.class) | ||
public ConfigProvider configProvider() { | ||
SpringConfigProvider springConfigProvider = new SpringConfigProvider(); | ||
log.trace("[Herodotus] |- Bean [Spring Config Provider] Auto Configure."); | ||
return springConfigProvider; | ||
} | ||
|
||
@Bean | ||
@ConditionalOnBean(SpringConfigProvider.class) | ||
public JetCacheBuilder jetCacheBuilder(SpringConfigProvider springConfigProvider) { | ||
JetCacheBuilder jetCacheBuilder = new JetCacheBuilder(springConfigProvider); | ||
log.trace("[Herodotus] |- Bean [Jet Cache Builder] Auto Configure."); | ||
return jetCacheBuilder; | ||
} | ||
} |
60 changes: 60 additions & 0 deletions
60
...cloud-cache/src/main/java/com/alicp/jetcache/autoconfigure/JetCacheAutoConfiguration.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
/* | ||
* Copyright (c) 2019-2021 Gengwei Zheng ([email protected]) | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed 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 specific language governing permissions and | ||
* limitations under the License. | ||
* | ||
* Project Name: eurynome-cloud | ||
* Module Name: eurynome-cloud-cache | ||
* File Name: JetCacheAutoConfiguration.java | ||
* Author: gengwei.zheng | ||
* Date: 2021/12/04 13:40:04 | ||
*/ | ||
|
||
package com.alicp.jetcache.autoconfigure; | ||
|
||
import com.alicp.jetcache.anno.support.GlobalCacheConfig; | ||
import org.slf4j.Logger; | ||
import org.slf4j.LoggerFactory; | ||
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; | ||
import org.springframework.context.annotation.Configuration; | ||
import org.springframework.context.annotation.Import; | ||
|
||
import javax.annotation.PostConstruct; | ||
|
||
/** | ||
* <p>Description: 重新定义JetCacheAutoConfiguration </p> | ||
* | ||
* 解决JetCacheAutoConfiguration依赖循环问题 | ||
* | ||
* @author : gengwei.zheng | ||
* @date : 2021/12/4 13:40 | ||
*/ | ||
@Configuration | ||
@ConditionalOnClass(GlobalCacheConfig.class) | ||
@Import({RedisAutoConfiguration.class, | ||
CaffeineAutoConfiguration.class, | ||
MockRemoteCacheAutoConfiguration.class, | ||
LinkedHashMapAutoConfiguration.class, | ||
RedisLettuceAutoConfiguration.class, | ||
RedisSpringDataAutoConfiguration.class}) | ||
public class JetCacheAutoConfiguration { | ||
|
||
public static final String GLOBAL_CACHE_CONFIG_NAME = "globalCacheConfig"; | ||
|
||
private static final Logger log = LoggerFactory.getLogger(JetCacheAutoConfiguration.class); | ||
|
||
@PostConstruct | ||
public void postConstruct() { | ||
log.info("[Herodotus] |- Component [Custom JetCache] Auto Configure."); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.