Skip to content

Commit

Permalink
⬆️ v2.5.4.60
Browse files Browse the repository at this point in the history
1. Spring Boot 版本升级至 2.5.4
2. Skywalking 版本升级至 8.7.0
3. 微服务日志输出至日志中心格式。
4. 增加Swagger注入条件注解,优化日志中心相关配置采用统一常量控制
5. 增加自定义Property"助手"数据统一自动编译生成配置,无须额外设置,在IDE中编辑配置属性时可自动弹出提示
6. 修复Kafka配置不生效问题。
7. 解决单体版自动启动Kafka问题。
8. 暂时关闭单体版Swagger,规避Swagger会自动启动Kafka问题。
  • Loading branch information
herodotus-ecosystem committed Aug 20, 2021
1 parent 1fd013e commit 6e64651
Show file tree
Hide file tree
Showing 17 changed files with 97 additions and 16 deletions.
7 changes: 7 additions & 0 deletions dependencies/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@
<!--Spring Boot Dependencies中没有的Maven Plugin-->
<docker-maven-plugin.version>0.36.1</docker-maven-plugin.version>
<git-commit-id-maven-plugin.version>5.0.0</git-commit-id-maven-plugin.version>
<mapstruct-processor.version>1.4.2.Final</mapstruct-processor.version>

<!--Spring Boot Dependencies中没有的工具包-->
<commons-collections4.version>4.4</commons-collections4.version>
Expand Down Expand Up @@ -300,6 +301,12 @@
<artifactId>knife4j-spring-ui</artifactId>
<version>${knife4j.version}</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.mapstruct/mapstruct-processor -->
<dependency>
<groupId>org.mapstruct</groupId>
<artifactId>mapstruct-processor</artifactId>
<version>${mapstruct-processor.version}</version>
</dependency>


<!-- https://mvnrepository.com/artifact/p6spy/p6spy -->
Expand Down
Binary file modified documents/readme/logo.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,6 @@
@Retention(RetentionPolicy.RUNTIME)
@Target({ElementType.TYPE, ElementType.METHOD})
@Documented
@ConditionalOnProperty(value = PropertyConstants.ITEM_PLATFORM_KAFKA_ENABLED)
@ConditionalOnProperty(value = PropertyConstants.ITEM_MANAGEMENT_KAFKA_ENABLED)
public @interface ConditionalOnKafkaEnabled {
}
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@

package cn.herodotus.eurynome.assistant.annotation;

import cn.herodotus.eurynome.common.constant.magic.PropertyConstants;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;

import java.lang.annotation.*;
Expand All @@ -35,6 +36,6 @@
@Retention(RetentionPolicy.RUNTIME)
@Target({ElementType.TYPE, ElementType.METHOD})
@Documented
@ConditionalOnProperty(name = "herodotus.platform.management.log-center.server-addr")
@ConditionalOnProperty(name = PropertyConstants.ITEM_MANAGEMENT_LOG_CENTER_ENABLED)
public @interface ConditionalOnLogCenterEnabled {
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
/*
* 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-assistant
* File Name: ConditionalOnSwaggerEnabled.java
* Author: gengwei.zheng
* Date: 2021/08/20 11:36:20
*/

package cn.herodotus.eurynome.assistant.annotation;

import cn.herodotus.eurynome.common.constant.magic.PropertyConstants;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;

import java.lang.annotation.*;

/**
* <p>Description: Swagger条件开启主机 </p>
*
* @author : gengwei.zheng
* @date : 2021/8/20 11:36
*/
@Retention(RetentionPolicy.RUNTIME)
@Target({ElementType.TYPE, ElementType.METHOD})
@Documented
@ConditionalOnProperty(value = PropertyConstants.ITEM_PLATFORM_SWAGGER_ENABLED, havingValue = "true", matchIfMissing = true)
public @interface ConditionalOnSwaggerEnabled {
}
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,11 @@ public class PropertyConstants {
public static final String PROPERTY_PREFIX_CACHE = PROPERTY_PREFIX_PLATFORM + ".cache";
public static final String PROPERTY_PREFIX_REST = PROPERTY_PREFIX_PLATFORM + ".rest";
public static final String PROPERTY_PREFIX_SECURITY = PROPERTY_PREFIX_PLATFORM + ".security";
public static final String PROPERTY_PREFIX_SWAGGER = PROPERTY_PREFIX_PLATFORM + ".swagger";

public static final String PROPERTY_PREFIX_MANAGEMENT_NACOS = PROPERTY_PREFIX_MANAGEMENT + ".nacos";
public static final String PROPERTY_PREFIX_MANAGEMENT_QUEUE = PROPERTY_PREFIX_MANAGEMENT + ".queue";
public static final String PROPERTY_PREFIX_MANAGEMENT_LOG_CENTER = PROPERTY_PREFIX_MANAGEMENT + ".log-center";
public static final String PROPERTY_PREFIX_MANAGEMENT_SERVICE = PROPERTY_PREFIX_MANAGEMENT + ".service";

public static final String PROPERTY_PREFIX_SOCIAL_JUSTAUTH = PROPERTY_PREFIX_SOCIAL + ".justauth";
Expand All @@ -59,13 +61,16 @@ public class PropertyConstants {
public static final String PROPERTY_PREFIX_AUDIT_BAIDU = PROPERTY_PREFIX_AUDIT + ".baidu";
public static final String PROPERTY_PREFIX_AUDIT_TIANYAN = PROPERTY_PREFIX_AUDIT + ".tianyan";


public static final String ITEM_SPRING_APPLICATION_NAME = "spring.application.name";
public static final String ITEM_SPRING_JPA_HIBERNATE_DDL_AUTO = "spring.jpa.hibernate.ddl-auto";

public static final String ITEM_PLATFORM_DATA_ACCESS_STRATEGY = PROPERTY_PREFIX_PLATFORM + ".data-access-strategy";
public static final String ITEM_PLATFORM_ARCHITECTURE = PROPERTY_PREFIX_PLATFORM + ".architecture";
public static final String ITEM_PLATFORM_KAFKA_ENABLED = PROPERTY_PREFIX_MANAGEMENT_QUEUE + ".kafka.enabled";
public static final String ITEM_PLATFORM_SWAGGER_ENABLED = PROPERTY_PREFIX_SWAGGER + ".enabled";

public static final String ITEM_MANAGEMENT_KAFKA_ENABLED = PROPERTY_PREFIX_MANAGEMENT_QUEUE + ".kafka.enabled";
public static final String ITEM_MANAGEMENT_LOG_CENTER_ENABLED = PROPERTY_PREFIX_MANAGEMENT_LOG_CENTER + ".server-addr";

public static final String ANNOTATION_APPLICATION_NAME = "${" + ITEM_SPRING_APPLICATION_NAME + "}";
public static final String ANNOTATION_DEBEZIUM_ENABLED = "${herodotus.platform.debezium.enabled}";
}
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,14 @@

import cn.herodotus.eurynome.data.cache.layer.HerodotusCacheManager;
import cn.herodotus.eurynome.data.properties.CacheProperties;
import cn.herodotus.eurynome.data.properties.QueueProperties;
import cn.hutool.extra.spring.SpringUtil;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.AutoConfigureAfter;
import org.springframework.boot.autoconfigure.data.jpa.JpaRepositoriesAutoConfiguration;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.cache.caffeine.CaffeineCacheManager;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
Expand Down Expand Up @@ -67,7 +69,12 @@
@Configuration(proxyBeanMethods = false)
@EnableJpaAuditing
@AutoConfigureAfter(JpaRepositoriesAutoConfiguration.class)
@Import({SpringUtil.class, CaffeineConfiguration.class, KafkaConfiguration.class})
@EnableConfigurationProperties({QueueProperties.class})
@Import({
SpringUtil.class,
CaffeineConfiguration.class,
KafkaConfiguration.class
})
public class DataConfiguration {

private static final Logger log = LoggerFactory.getLogger(DataConfiguration.class);
Expand Down
2 changes: 1 addition & 1 deletion packages/eurynome-cloud-kernel/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
<dependencies>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>eurynome-cloud-common</artifactId>
<artifactId>eurynome-cloud-assistant</artifactId>
</dependency>

<dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@
import ch.qos.logback.classic.Logger;
import ch.qos.logback.classic.LoggerContext;
import ch.qos.logback.classic.spi.ILoggingEvent;
import cn.herodotus.eurynome.assistant.annotation.ConditionalOnLogCenterEnabled;
import cn.herodotus.eurynome.common.constant.magic.PropertyConstants;
import cn.herodotus.eurynome.kernel.logback.LogstashPattern;
import cn.herodotus.eurynome.kernel.properties.ManagementProperties;
import com.alibaba.fastjson.JSON;
Expand All @@ -39,7 +41,6 @@
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.boot.logging.LogLevel;
import org.springframework.context.annotation.Configuration;
Expand All @@ -63,10 +64,10 @@
@EnableConfigurationProperties({
ManagementProperties.class
})
@ConditionalOnProperty(name = "herodotus.platform.management.log-center.server-addr")
@ConditionalOnLogCenterEnabled
public class LogstashConfiguration {

@Value("${spring.application.name}")
@Value(PropertyConstants.ANNOTATION_APPLICATION_NAME)
private String serviceName;

@Autowired
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@

package cn.herodotus.eurynome.rest.configuration;

import cn.herodotus.eurynome.assistant.annotation.ConditionalOnSwaggerEnabled;
import cn.herodotus.eurynome.common.constant.magic.SecurityConstants;
import cn.herodotus.eurynome.common.constant.enums.Architecture;
import cn.herodotus.eurynome.rest.properties.PlatformProperties;
Expand Down Expand Up @@ -56,7 +57,7 @@
*/
@Slf4j
@Configuration
@ConditionalOnProperty(value = "herodotus.platform.swagger.enabled", havingValue = "true", matchIfMissing = true)
@ConditionalOnSwaggerEnabled
@AutoConfigureAfter(ServiceConfiguration.class)
@EnableSwagger2
public class SwaggerConfiguration {
Expand Down
18 changes: 18 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,24 @@
<source>${java.version}</source>
<target>${java.version}</target>
<encoding>${project.build.sourceEncoding}</encoding>
<showWarnings>true</showWarnings>
<annotationProcessorPaths>
<path>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>${lombok.version}</version>
</path>
<path>
<groupId>org.mapstruct</groupId>
<artifactId>mapstruct-processor</artifactId>
<version>${mapstruct-processor.version}</version>
</path>
<path>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-configuration-processor</artifactId>
<version>${spring-boot-dependencies.version}</version>
</path>
</annotationProcessorPaths>
</configuration>
</plugin>
<plugin>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public ActIdGroupProcessor(ActIdGroupService actIdGroupService) {
this.actIdGroupService = actIdGroupService;
}

@KafkaListener(topics = {"herodotus.public.sys_department"}, groupId = "herodotus.debezium")
@KafkaListener(topics = {"herodotus.public.sys_department"}, groupId = "herodotus.debezium", containerFactory = "concurrentKafkaListenerContainerFactory")
public void received(String body) {
log.info("[Eurynome] |- Recived Debezium event message from [sys_department], content is : [{}]", body);
this.execute(body);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public ActIdMembershipProcessor(ActIdMembershipService actIdMembershipService) {
this.actIdMembershipService = actIdMembershipService;
}

@KafkaListener(topics = {"herodotus.public.sys_employee_department"}, groupId = "herodotus.debezium")
@KafkaListener(topics = {"herodotus.public.sys_employee_department"}, groupId = "herodotus.debezium", containerFactory = "concurrentKafkaListenerContainerFactory")
public void received(String body) {
log.info("[Eurynome] |- Recived Debezium event message from [sys_employee_department], content is : [{}]", body);
this.execute(body);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public ActIdTenantMemberProcessor(ActIdTenantMemberService actIdTenantMemberServ
this.actIdTenantMemberService = actIdTenantMemberService;
}

@KafkaListener(topics = {"herodotus.public.sys_ownership"}, groupId = "herodotus.debezium")
@KafkaListener(topics = {"herodotus.public.sys_ownership"}, groupId = "herodotus.debezium", containerFactory = "concurrentKafkaListenerContainerFactory")
public void received(String body) {
log.info("[Eurynome] |- Recived Debezium event message from [sys_ownership], content is : [{}]", body);
this.execute(body);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public ActIdTenantProcessor(ActIdTenantService actIdTenantService) {
this.actIdTenantService = actIdTenantService;
}

@KafkaListener(topics = {"herodotus.public.sys_department"}, groupId = "herodotus.debezium")
@KafkaListener(topics = {"herodotus.public.sys_department"}, groupId = "herodotus.debezium", containerFactory = "concurrentKafkaListenerContainerFactory")
public void received(String body) {
log.info("[Eurynome] |- Recived Debezium event message from [sys_department], content is : [{}]", body);
this.execute(body);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public ActIdUserProcessor(ActIdUserService actIdUserService) {
this.actIdUserService = actIdUserService;
}

@KafkaListener(topics = {"herodotus.public.sys_employee"}, groupId = "herodotus.debezium")
@KafkaListener(topics = {"herodotus.public.sys_employee"}, groupId = "herodotus.debezium", containerFactory = "concurrentKafkaListenerContainerFactory")
public void received(String body) {
log.info("[Eurynome] |- Recived Debezium event message from [sys_employee], content is : [{}]", body);
this.execute(body);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ public class SysSecurityAttribute extends BaseSysEntity {
@ApiModelProperty(value = "元数据ID")
@Id
@GeneratedValue(generator = "metadata-uuid")
@GenericGenerator(name = "metadata-uuid", strategy = "cn.herodotus.cloud.upms.api.generator.SysSecurityAttributeUUIDGenerator")
@GenericGenerator(name = "metadata-uuid", strategy = "cn.herodotus.eurynome.upms.api.generator.SysSecurityAttributeUUIDGenerator")
@Column(name = "attribute_id", length = 64)
private String attributeId;

Expand Down

0 comments on commit 6e64651

Please sign in to comment.