Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feature: 对接蓝鲸消息通知中心 #2659 #2672

Merged
merged 18 commits into from
Dec 20, 2023

Conversation

jsonwan
Copy link
Collaborator

@jsonwan jsonwan commented Dec 15, 2023

No description provided.

@jsonwan jsonwan closed this Dec 18, 2023
@jsonwan jsonwan reopened this Dec 18, 2023
import java.util.concurrent.ThreadPoolExecutor;

/**
* 进程启动时立即执行一次无效主机清理
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

注释有问题

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

已修改

@@ -38,6 +38,12 @@ public class LocaleUtils {
public static final String LANG_ZH = "zh";
public static final String LANG_EN = "en";
public static final String LANG_EN_US = "en_US";

public static final String BK_LANG_ZH = "zh";
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

BK_LANG_XX 跟 LANG_XX 的区别是啥?这里放在一起容易混淆。

建议如果这两种类型的 LANG 是用在不同的地方,是否可以放到不同的类里边加以区分?或者加上注释

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

已抽取出单独的常量类

@@ -126,6 +127,21 @@ Default job logback configuration provided for import
</encoder>
</appender>

<!-- BK-NOTICE 日志 -->
<appender name="notice-appender" class="ch.qos.logback.core.rolling.RollingFileAppender">
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这个通知模块只有 job-manage 涉及,放在 job-manage 的 logback 配置下可能更合适?放在公共的配置,每个微服务下都会生成 notice.log

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

已修改

@wangyu096
Copy link
Collaborator

job-assemble 没有处理,比如配置

@wangyu096
Copy link
Collaborator

对接消息中心是否是强依赖?如果没有消息中心的话,服务是否能够正常运行?这点需要确认下

@jsonwan
Copy link
Collaborator Author

jsonwan commented Dec 19, 2023

对接消息中心是否是强依赖?如果没有消息中心的话,服务是否能够正常运行?这点需要确认下

非强依赖,已在jobv3环境验证,并补充了支持配置是否对接消息中心与自动探测消息中心可用性的机制。

@jsonwan
Copy link
Collaborator Author

jsonwan commented Dec 19, 2023

job-assemble 没有处理,比如配置

只新增了公共配置项,job-assemble也能引用到,没有单独微服务的配置,因此无需处理。

处理review意见,支持关闭消息通知中心对接,消除错误日志
支持自动探测消息通知中心状态用于决定是否自动对接
支持自动探测消息通知中心状态用于决定是否自动对接
@@ -37,6 +37,8 @@ public class BkApiGatewayProperties {

private GseApiGwConfig gse;

private GseApiGwConfig bkNotice;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

GseApiGwConfig 与 bkNotice 不匹配。可能需要改下 GseApiGwConfig 的类名,更加通用一些

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

已修改为ApiGwConfig

}
}
// 将注册结果写入DB中
int affectedNum = globalSettingDAO.upsertGlobalSetting(buildRegisterResult(registerSuccess));
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

多个实例一起执行可能有并发问题,导致注册结果被覆盖

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

可以改为注册成功才写入,也可以避免并发问题

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

已修改

@jsonwan jsonwan merged commit 342ba20 into TencentBlueKing:master Dec 20, 2023
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants