Skip to content

Commit

Permalink
feat: Job 支持多租户 TencentBlueKing#3369
Browse files Browse the repository at this point in the history
  • Loading branch information
wangyu096 committed Jan 9, 2025
1 parent 67e66ac commit 8e77042
Showing 1 changed file with 25 additions and 22 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@
import lombok.extern.slf4j.Slf4j;
import org.slf4j.helpers.MessageFormatter;

import java.util.Collections;
import java.util.List;
import java.util.Set;

Expand Down Expand Up @@ -83,28 +84,30 @@ public CmsiApiClient(EsbProperties esbProperties,
}

public List<EsbNotifyChannelDTO> getNotifyChannelList() {
try {
HttpMetricUtil.setHttpMetricName(CommonMetricNames.ESB_CMSI_API_HTTP);
HttpMetricUtil.addTagForCurrentMetric(
Tag.of(EsbMetricTags.KEY_API_NAME, API_GET_NOTIFY_CHANNEL_LIST)
);
EsbResp<List<EsbNotifyChannelDTO>> esbResp = doRequest(
OpenApiRequestInfo.builder()
.method(HttpMethodEnum.GET)
.uri(API_GET_NOTIFY_CHANNEL_LIST)
.authorization(authorization)
.build(),
new TypeReference<EsbResp<List<EsbNotifyChannelDTO>>>() {
}
);
return esbResp.getData();
} catch (Exception e) {
String errorMsg = "Get " + API_GET_NOTIFY_CHANNEL_LIST + " error";
log.error(errorMsg, e);
throw new InternalCmsiException(errorMsg, e, ErrorCode.CMSI_MSG_CHANNEL_DATA_ERROR);
} finally {
HttpMetricUtil.clearHttpMetric();
}
// try {
// HttpMetricUtil.setHttpMetricName(CommonMetricNames.ESB_CMSI_API_HTTP);
// HttpMetricUtil.addTagForCurrentMetric(
// Tag.of(EsbMetricTags.KEY_API_NAME, API_GET_NOTIFY_CHANNEL_LIST)
// );
// EsbResp<List<EsbNotifyChannelDTO>> esbResp = doRequest(
// OpenApiRequestInfo.builder()
// .method(HttpMethodEnum.GET)
// .uri(API_GET_NOTIFY_CHANNEL_LIST)
// .authorization(authorization)
// .build(),
// new TypeReference<EsbResp<List<EsbNotifyChannelDTO>>>() {
// }
// );
// return esbResp.getData();
// } catch (Exception e) {
// String errorMsg = "Get " + API_GET_NOTIFY_CHANNEL_LIST + " error";
// log.error(errorMsg, e);
// throw new InternalCmsiException(errorMsg, e, ErrorCode.CMSI_MSG_CHANNEL_DATA_ERROR);
// } finally {
// HttpMetricUtil.clearHttpMetric();
// }
// 临时注释,保证多租户联调正常
return Collections.emptyList();
}

public void sendMsg(String msgType,
Expand Down

0 comments on commit 8e77042

Please sign in to comment.