You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@inlong.apache.org by "dockerzhang (via GitHub)" <gi...@apache.org> on 2023/03/20 03:27:39 UTC
[GitHub] [inlong] dockerzhang commented on a diff in pull request #7647: [INLONG-7646][Audit] Fix NPE when mq configuration is not registered
dockerzhang commented on code in PR #7647:
URL: https://github.com/apache/inlong/pull/7647#discussion_r1141587622
##########
inlong-audit/audit-store/src/main/java/org/apache/inlong/audit/service/AuditMsgConsumerServer.java:
##########
@@ -133,19 +135,23 @@ private List<InsertData> getInsertServiceList() {
private List<MQInfo> getClusterFromManager() {
Properties properties = new Properties();
+ List<MQInfo> mqConfig;
try (InputStream inputStream = getClass().getClassLoader().getResourceAsStream(DEFAULT_CONFIG_PROPERTIES)) {
properties.load(inputStream);
String managerHosts = properties.getProperty("manager.hosts");
String clusterTag = properties.getProperty("proxy.cluster.tag");
String[] hostList = StringUtils.split(managerHosts, ",");
for (String host : hostList) {
- List<MQInfo> mqConfig = getMQConfig(host, clusterTag);
- if (ObjectUtils.isNotEmpty(mqConfig)) {
- LOG.info("return mqConfig");
- return mqConfig;
+ while (true) {
+ mqConfig = getMQConfig(host, clusterTag);
+ if (ObjectUtils.isNotEmpty(mqConfig)) {
+ return mqConfig;
+ }
+ LOG.info("MQ config may not be registered yet, wait for 5s and try again");
+ Thread.sleep(INTERVAL_MS);
Review Comment:
it's not a common configuration, I think there is no need to add to configuration files.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@inlong.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org