Unified thread pool id

pull/160/head
chen.ma 4 years ago
parent b0c16826de
commit 5038667c74

@ -49,7 +49,7 @@ public class HippoBaseSendMessageService implements HippoSendMessageService, Com
return; return;
} }
if (isSendAlarm(each.getThreadPoolId(), each.getPlatform(), typeEnum)) { if (isSendAlarm(each.getTpId(), each.getPlatform(), typeEnum)) {
alarmNotifyRequest.setNotifyTypeEnum(typeEnum); alarmNotifyRequest.setNotifyTypeEnum(typeEnum);
messageHandler.sendAlarmMessage(each, alarmNotifyRequest); messageHandler.sendAlarmMessage(each, alarmNotifyRequest);
} }

@ -26,7 +26,7 @@ public class NotifyConfigDTO {
/** /**
* 线id * 线id
*/ */
private String threadPoolId; private String tpId;
/** /**
* *

@ -58,7 +58,7 @@ public class CoreNotifyConfigBuilder implements NotifyConfigBuilder {
for (NotifyPlatformProperties platformProperties : notifyPlatforms) { for (NotifyPlatformProperties platformProperties : notifyPlatforms) {
NotifyConfigDTO notifyConfig = new NotifyConfigDTO(); NotifyConfigDTO notifyConfig = new NotifyConfigDTO();
notifyConfig.setPlatform(platformProperties.getPlatform()); notifyConfig.setPlatform(platformProperties.getPlatform());
notifyConfig.setThreadPoolId(threadPoolId); notifyConfig.setTpId(threadPoolId);
notifyConfig.setType("ALARM"); notifyConfig.setType("ALARM");
notifyConfig.setSecretKey(platformProperties.getSecretKey()); notifyConfig.setSecretKey(platformProperties.getSecretKey());
int interval = Optional.ofNullable(executor.getNotify()) int interval = Optional.ofNullable(executor.getNotify())
@ -76,7 +76,7 @@ public class CoreNotifyConfigBuilder implements NotifyConfigBuilder {
for (NotifyPlatformProperties platformProperties : notifyPlatforms) { for (NotifyPlatformProperties platformProperties : notifyPlatforms) {
NotifyConfigDTO notifyConfig = new NotifyConfigDTO(); NotifyConfigDTO notifyConfig = new NotifyConfigDTO();
notifyConfig.setPlatform(platformProperties.getPlatform()); notifyConfig.setPlatform(platformProperties.getPlatform());
notifyConfig.setThreadPoolId(threadPoolId); notifyConfig.setTpId(threadPoolId);
notifyConfig.setType("CONFIG"); notifyConfig.setType("CONFIG");
notifyConfig.setSecretKey(platformProperties.getSecretKey()); notifyConfig.setSecretKey(platformProperties.getSecretKey());
notifyConfig.setReceives(buildReceive(executor, platformProperties)); notifyConfig.setReceives(buildReceive(executor, platformProperties));
@ -87,7 +87,7 @@ public class CoreNotifyConfigBuilder implements NotifyConfigBuilder {
resultMap.forEach( resultMap.forEach(
(key, val) -> val.stream() (key, val) -> val.stream()
.filter(each -> StrUtil.equals("ALARM", each.getType())) .filter(each -> StrUtil.equals("ALARM", each.getType()))
.forEach(each -> alarmControlHandler.initCacheAndLock(each.getThreadPoolId(), each.getPlatform(), each.getInterval())) .forEach(each -> alarmControlHandler.initCacheAndLock(each.getTpId(), each.getPlatform(), each.getInterval()))
); );
return resultMap; return resultMap;

@ -68,7 +68,7 @@ public class ServerNotifyConfigBuilder implements NotifyConfigBuilder {
resultMap.forEach((key, val) -> resultMap.forEach((key, val) ->
val.stream().filter(each -> StrUtil.equals("ALARM", each.getType())) val.stream().filter(each -> StrUtil.equals("ALARM", each.getType()))
.forEach(each -> alarmControlHandler.initCacheAndLock(each.getThreadPoolId(), each.getPlatform(), each.getInterval())) .forEach(each -> alarmControlHandler.initCacheAndLock(each.getTpId(), each.getPlatform(), each.getInterval()))
); );
} }

Loading…
Cancel
Save