diff --git a/kraken-java-sdk/kraken-java-sdk-controller/src/main/java/com/consoleconnect/kraken/operator/controller/handler/ClientHeartbeatEventHandler.java b/kraken-java-sdk/kraken-java-sdk-controller/src/main/java/com/consoleconnect/kraken/operator/controller/handler/ClientHeartbeatEventHandler.java index bc70239d..2c3c7368 100644 --- a/kraken-java-sdk/kraken-java-sdk-controller/src/main/java/com/consoleconnect/kraken/operator/controller/handler/ClientHeartbeatEventHandler.java +++ b/kraken-java-sdk/kraken-java-sdk-controller/src/main/java/com/consoleconnect/kraken/operator/controller/handler/ClientHeartbeatEventHandler.java @@ -1,6 +1,7 @@ package com.consoleconnect.kraken.operator.controller.handler; import com.consoleconnect.kraken.operator.controller.entity.EnvironmentEntity; +import com.consoleconnect.kraken.operator.controller.model.SystemInfo; import com.consoleconnect.kraken.operator.controller.repo.EnvironmentRepository; import com.consoleconnect.kraken.operator.controller.service.SystemInfoService; import com.consoleconnect.kraken.operator.core.client.ClientEvent; @@ -11,6 +12,7 @@ import com.consoleconnect.kraken.operator.core.enums.EnvNameEnum; import com.consoleconnect.kraken.operator.core.model.HttpResponse; import com.consoleconnect.kraken.operator.core.repo.EnvironmentClientRepository; +import com.consoleconnect.kraken.operator.core.service.EventSinkService; import com.consoleconnect.kraken.operator.core.toolkit.JsonToolkit; import com.fasterxml.jackson.core.type.TypeReference; import java.util.List; @@ -18,6 +20,7 @@ import java.util.UUID; import lombok.AllArgsConstructor; import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang3.StringUtils; import org.springframework.http.HttpStatus; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; @@ -33,6 +36,7 @@ public class ClientHeartbeatEventHandler extends ClientEventHandler { private final EnvironmentRepository environmentRepository; private final SystemInfoService systemInfoService; + private final EventSinkService eventSinkService; @Override public ClientEventTypeEnum getEventType() { @@ -75,7 +79,7 @@ public HttpResponse onEvent(String envId, String userId, ClientEvent event environmentClientEntity.setUpdatedAt(instance.getUpdatedAt()); environmentClientEntity.setUpdatedBy(userId); environmentClientRepository.save(environmentClientEntity); - updateAppVersion(envId, instance.getAppVersion()); + updateAppVersion(envId, instance); } return HttpResponse.ok(null); } @@ -89,17 +93,32 @@ public Optional queryEnvName(String envId) { return Optional.empty(); } - private void updateAppVersion(String envId, String appVersion) { + private void updateAppVersion(String envId, ClientInstanceHeartbeat heartbeat) { + SystemInfo systemInfo = systemInfoService.find(); environmentRepository .findById(UUID.fromString(envId)) .ifPresent( env -> { - if (EnvNameEnum.STAGE.name().equalsIgnoreCase(env.getName())) { - systemInfoService.updateAppVersion(null, appVersion, null); + if (EnvNameEnum.STAGE.name().equalsIgnoreCase(env.getName()) + && !StringUtils.equalsIgnoreCase( + heartbeat.getAppVersion(), systemInfo.getStageAppVersion())) { + reportKrakenVersionUpgrade(EnvNameEnum.STAGE, heartbeat); + systemInfoService.updateAppVersion(null, heartbeat.getAppVersion(), null); } - if (EnvNameEnum.PRODUCTION.name().equalsIgnoreCase(env.getName())) { - systemInfoService.updateAppVersion(null, null, appVersion); + + if (EnvNameEnum.PRODUCTION.name().equalsIgnoreCase(env.getName()) + && !StringUtils.equalsIgnoreCase( + heartbeat.getAppVersion(), systemInfo.getProductionAppVersion())) { + reportKrakenVersionUpgrade(EnvNameEnum.PRODUCTION, heartbeat); + systemInfoService.updateAppVersion(null, null, heartbeat.getAppVersion()); } }); } + + private void reportKrakenVersionUpgrade(EnvNameEnum envName, ClientInstanceHeartbeat heartbeat) { + eventSinkService.reportKrakenVersionUpgradeResult( + envName, + heartbeat.getAppVersion(), + Optional.ofNullable(heartbeat.getStartUpAt()).orElse(heartbeat.getUpdatedAt())); + } } diff --git a/kraken-java-sdk/kraken-java-sdk-controller/src/main/java/com/consoleconnect/kraken/operator/controller/service/SystemInfoService.java b/kraken-java-sdk/kraken-java-sdk-controller/src/main/java/com/consoleconnect/kraken/operator/controller/service/SystemInfoService.java index 1e9e3f27..535a1c5e 100644 --- a/kraken-java-sdk/kraken-java-sdk-controller/src/main/java/com/consoleconnect/kraken/operator/controller/service/SystemInfoService.java +++ b/kraken-java-sdk/kraken-java-sdk-controller/src/main/java/com/consoleconnect/kraken/operator/controller/service/SystemInfoService.java @@ -13,7 +13,6 @@ import com.consoleconnect.kraken.operator.core.enums.AssetKindEnum; import com.consoleconnect.kraken.operator.core.enums.EnvNameEnum; import com.consoleconnect.kraken.operator.core.event.PlatformSettingCompletedEvent; -import com.consoleconnect.kraken.operator.core.exception.KrakenException; import com.consoleconnect.kraken.operator.core.model.Metadata; import com.consoleconnect.kraken.operator.core.repo.SystemInfoRepository; import com.consoleconnect.kraken.operator.core.repo.UnifiedAssetRepository; @@ -275,6 +274,6 @@ public SystemInfo find() { t.setProductName(mgmtProperty.getProductName()); return t; }) - .orElseThrow(() -> KrakenException.notFound("System info not found")); + .orElse(new SystemInfo()); } } diff --git a/kraken-java-sdk/kraken-java-sdk-controller/src/main/java/com/consoleconnect/kraken/operator/controller/service/TemplateIngestService.java b/kraken-java-sdk/kraken-java-sdk-controller/src/main/java/com/consoleconnect/kraken/operator/controller/service/TemplateIngestService.java index de802735..ca746bfe 100644 --- a/kraken-java-sdk/kraken-java-sdk-controller/src/main/java/com/consoleconnect/kraken/operator/controller/service/TemplateIngestService.java +++ b/kraken-java-sdk/kraken-java-sdk-controller/src/main/java/com/consoleconnect/kraken/operator/controller/service/TemplateIngestService.java @@ -8,6 +8,7 @@ import com.consoleconnect.kraken.operator.core.dto.Tuple2; import com.consoleconnect.kraken.operator.core.dto.UnifiedAssetDto; import com.consoleconnect.kraken.operator.core.enums.AssetKindEnum; +import com.consoleconnect.kraken.operator.core.enums.EnvNameEnum; import com.consoleconnect.kraken.operator.core.enums.UpgradeResultEventEnum; import com.consoleconnect.kraken.operator.core.enums.UpgradeSourceEnum; import com.consoleconnect.kraken.operator.core.event.PlatformSettingCompletedEvent; @@ -18,9 +19,11 @@ import com.consoleconnect.kraken.operator.core.toolkit.Paging; import java.time.ZonedDateTime; import java.util.*; -import lombok.AllArgsConstructor; +import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.apache.commons.collections4.CollectionUtils; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Value; import org.springframework.boot.context.event.ApplicationReadyEvent; import org.springframework.context.ApplicationEventPublisher; import org.springframework.context.event.EventListener; @@ -30,7 +33,7 @@ @Service @Slf4j -@AllArgsConstructor +@RequiredArgsConstructor public class TemplateIngestService { private final DataIngestionJob dataIngestionJob; private final ApplicationEventPublisher eventPublisher; @@ -42,8 +45,13 @@ public class TemplateIngestService { private final EventSinkService eventSinkService; private final SystemInfoService systemInfoService; + @Value("${spring.build.version}") + private String buildVersion; + @EventListener(ApplicationReadyEvent.class) public void onApplicationReady(Object event) { + // trigger report kraken version upgrade + reportKrakenVersionUpgrade(); userService.initSystemUpgradeUser(); log.info("Platform Boot Up Event Received, event class:{}", event.getClass()); Paging assetDtoPaging = @@ -107,4 +115,16 @@ private void reportFirstInstallation() { reportEvent.setInstalledAt(ZonedDateTime.now()); }); } + + private void reportKrakenVersionUpgrade() { + SystemInfo systemInfo = systemInfoService.find(); + if (!StringUtils.equalsIgnoreCase(buildVersion, systemInfo.getControlAppVersion())) { + log.info( + "Kraken version upgrade report: old version {},current version {}", + systemInfo.getControlAppVersion(), + buildVersion); + eventSinkService.reportKrakenVersionUpgradeResult( + EnvNameEnum.CONTROL_PLANE, buildVersion, ZonedDateTime.now()); + } + } } diff --git a/kraken-java-sdk/kraken-java-sdk-core/src/main/java/com/consoleconnect/kraken/operator/core/client/ClientEventTypeEnum.java b/kraken-java-sdk/kraken-java-sdk-core/src/main/java/com/consoleconnect/kraken/operator/core/client/ClientEventTypeEnum.java index 67c58ce1..ca1e9a41 100644 --- a/kraken-java-sdk/kraken-java-sdk-core/src/main/java/com/consoleconnect/kraken/operator/core/client/ClientEventTypeEnum.java +++ b/kraken-java-sdk/kraken-java-sdk-core/src/main/java/com/consoleconnect/kraken/operator/core/client/ClientEventTypeEnum.java @@ -7,5 +7,6 @@ public enum ClientEventTypeEnum { CLIENT_SERVER_API, CLIENT_TEMPLATE_UPGRADE_RESULT, CLIENT_SYSTEM_INFO, - CLIENT_MAPPER_VERSION + CLIENT_MAPPER_VERSION, + CLIENT_APP_VERSION_UPGRADE_RESULT } diff --git a/kraken-java-sdk/kraken-java-sdk-core/src/main/java/com/consoleconnect/kraken/operator/core/client/ClientInstanceHeartbeat.java b/kraken-java-sdk/kraken-java-sdk-core/src/main/java/com/consoleconnect/kraken/operator/core/client/ClientInstanceHeartbeat.java index 31845665..8b4feacb 100644 --- a/kraken-java-sdk/kraken-java-sdk-core/src/main/java/com/consoleconnect/kraken/operator/core/client/ClientInstanceHeartbeat.java +++ b/kraken-java-sdk/kraken-java-sdk-core/src/main/java/com/consoleconnect/kraken/operator/core/client/ClientInstanceHeartbeat.java @@ -10,4 +10,5 @@ public class ClientInstanceHeartbeat { private String role; private String appVersion; private ZonedDateTime updatedAt; + private ZonedDateTime startUpAt; } diff --git a/kraken-java-sdk/kraken-java-sdk-core/src/main/java/com/consoleconnect/kraken/operator/core/enums/MgmtEventType.java b/kraken-java-sdk/kraken-java-sdk-core/src/main/java/com/consoleconnect/kraken/operator/core/enums/MgmtEventType.java index 9e6a6f22..846c4560 100644 --- a/kraken-java-sdk/kraken-java-sdk-core/src/main/java/com/consoleconnect/kraken/operator/core/enums/MgmtEventType.java +++ b/kraken-java-sdk/kraken-java-sdk-core/src/main/java/com/consoleconnect/kraken/operator/core/enums/MgmtEventType.java @@ -4,5 +4,6 @@ public enum MgmtEventType { RESET, CLIENT_HEART_BEAT, CLIENT_SYSTEM_INFO, - TEMPLATE_UPGRADE_RESULT; + TEMPLATE_UPGRADE_RESULT, + CLIENT_APP_VERSION_UPGRADE_RESULT; } diff --git a/kraken-java-sdk/kraken-java-sdk-core/src/main/java/com/consoleconnect/kraken/operator/core/event/AppVersionUpgradeResultEvent.java b/kraken-java-sdk/kraken-java-sdk-core/src/main/java/com/consoleconnect/kraken/operator/core/event/AppVersionUpgradeResultEvent.java new file mode 100644 index 00000000..68f2deb4 --- /dev/null +++ b/kraken-java-sdk/kraken-java-sdk-core/src/main/java/com/consoleconnect/kraken/operator/core/event/AppVersionUpgradeResultEvent.java @@ -0,0 +1,12 @@ +package com.consoleconnect.kraken.operator.core.event; + +import com.consoleconnect.kraken.operator.core.enums.EnvNameEnum; +import java.time.ZonedDateTime; +import lombok.Data; + +@Data +public class AppVersionUpgradeResultEvent { + private String appVersion; + EnvNameEnum envName; + private ZonedDateTime upgradeAt; +} diff --git a/kraken-java-sdk/kraken-java-sdk-core/src/main/java/com/consoleconnect/kraken/operator/core/service/EventSinkService.java b/kraken-java-sdk/kraken-java-sdk-core/src/main/java/com/consoleconnect/kraken/operator/core/service/EventSinkService.java index efb40795..80f03834 100644 --- a/kraken-java-sdk/kraken-java-sdk-core/src/main/java/com/consoleconnect/kraken/operator/core/service/EventSinkService.java +++ b/kraken-java-sdk/kraken-java-sdk-core/src/main/java/com/consoleconnect/kraken/operator/core/service/EventSinkService.java @@ -1,13 +1,18 @@ package com.consoleconnect.kraken.operator.core.service; +import static com.consoleconnect.kraken.operator.core.enums.MgmtEventType.CLIENT_APP_VERSION_UPGRADE_RESULT; + import com.consoleconnect.kraken.operator.core.dto.UnifiedAssetDto; import com.consoleconnect.kraken.operator.core.entity.MgmtEventEntity; +import com.consoleconnect.kraken.operator.core.enums.EnvNameEnum; import com.consoleconnect.kraken.operator.core.enums.EventStatusType; import com.consoleconnect.kraken.operator.core.enums.MgmtEventType; import com.consoleconnect.kraken.operator.core.enums.UpgradeResultEventEnum; +import com.consoleconnect.kraken.operator.core.event.AppVersionUpgradeResultEvent; import com.consoleconnect.kraken.operator.core.event.TemplateUpgradeResultEvent; import com.consoleconnect.kraken.operator.core.repo.MgmtEventRepository; import com.consoleconnect.kraken.operator.core.toolkit.JsonToolkit; +import java.time.ZonedDateTime; import java.util.List; import java.util.function.Consumer; import lombok.AllArgsConstructor; @@ -51,4 +56,17 @@ public void reportTemplateUpgradeResult( mgmtEventEntity.setStatus(EventStatusType.WAIT_TO_SEND.name()); eventRepository.save(mgmtEventEntity); } + + public void reportKrakenVersionUpgradeResult( + EnvNameEnum envName, String appVersion, ZonedDateTime upgradeAt) { + MgmtEventEntity mgmtEventEntity = new MgmtEventEntity(); + mgmtEventEntity.setEventType(CLIENT_APP_VERSION_UPGRADE_RESULT.name()); + AppVersionUpgradeResultEvent appVersionUpgradeResultEvent = new AppVersionUpgradeResultEvent(); + mgmtEventEntity.setPayload(appVersionUpgradeResultEvent); + appVersionUpgradeResultEvent.setUpgradeAt(upgradeAt); + appVersionUpgradeResultEvent.setAppVersion(appVersion); + appVersionUpgradeResultEvent.setEnvName(envName); + mgmtEventEntity.setStatus(EventStatusType.WAIT_TO_SEND.name()); + eventRepository.save(mgmtEventEntity); + } } diff --git a/kraken-java-sdk/kraken-java-sdk-core/src/test/java/com/consoleconnect/kraken/operator/core/service/EventSinkServiceTest.java b/kraken-java-sdk/kraken-java-sdk-core/src/test/java/com/consoleconnect/kraken/operator/core/service/EventSinkServiceTest.java index 1ea27906..e32c17dc 100644 --- a/kraken-java-sdk/kraken-java-sdk-core/src/test/java/com/consoleconnect/kraken/operator/core/service/EventSinkServiceTest.java +++ b/kraken-java-sdk/kraken-java-sdk-core/src/test/java/com/consoleconnect/kraken/operator/core/service/EventSinkServiceTest.java @@ -57,6 +57,21 @@ void givenTemplateUpgradeResult_whenReportTemplateUpgradeResult_thenOk() throws EventStatusType.WAIT_TO_SEND, PageRequest.of(0, 10)); MatcherAssert.assertThat(mgmtEventEntities, Matchers.hasSize(Matchers.greaterThanOrEqualTo(1))); - mgmtEventEntities.forEach(event -> mgmtEventRepository.delete(event)); + mgmtEventRepository.deleteAll(mgmtEventEntities); + } + + @Test + @Order(2) + void givenAppStartUp_whenReportKrakenVersion_thenOk() { + eventSinkService.reportKrakenVersionUpgradeResult( + EnvNameEnum.CONTROL_PLANE, "1.0.0", ZonedDateTime.now()); + List krakenVersionEntities = + eventSinkService.findByPage( + List.of(MgmtEventType.CLIENT_APP_VERSION_UPGRADE_RESULT), + EventStatusType.WAIT_TO_SEND, + PageRequest.of(0, 10)); + MatcherAssert.assertThat( + krakenVersionEntities, Matchers.hasSize(Matchers.greaterThanOrEqualTo(1))); + mgmtEventRepository.deleteAll(krakenVersionEntities); } } diff --git a/kraken-java-sdk/kraken-java-sdk-data/src/main/java/com/consoleconnect/kraken/operator/data/entity/InstanceHeartbeatEntity.java b/kraken-java-sdk/kraken-java-sdk-data/src/main/java/com/consoleconnect/kraken/operator/data/entity/InstanceHeartbeatEntity.java index 75282182..d94ae636 100644 --- a/kraken-java-sdk/kraken-java-sdk-data/src/main/java/com/consoleconnect/kraken/operator/data/entity/InstanceHeartbeatEntity.java +++ b/kraken-java-sdk/kraken-java-sdk-data/src/main/java/com/consoleconnect/kraken/operator/data/entity/InstanceHeartbeatEntity.java @@ -2,6 +2,7 @@ import com.consoleconnect.kraken.operator.core.entity.AbstractEntity; import jakarta.persistence.*; +import java.time.ZonedDateTime; import lombok.Getter; import lombok.Setter; @@ -24,4 +25,7 @@ public class InstanceHeartbeatEntity extends AbstractEntity { @Column(name = "app_version", nullable = true) private String appVersion; + + @Column(name = "start_up_at", nullable = true, unique = false) + private ZonedDateTime startUpAt; } diff --git a/kraken-java-sdk/kraken-java-sdk-gateway/src/main/java/com/consoleconnect/kraken/operator/gateway/service/HeartBeatService.java b/kraken-java-sdk/kraken-java-sdk-gateway/src/main/java/com/consoleconnect/kraken/operator/gateway/service/HeartBeatService.java index abb14611..d30c4e11 100644 --- a/kraken-java-sdk/kraken-java-sdk-gateway/src/main/java/com/consoleconnect/kraken/operator/gateway/service/HeartBeatService.java +++ b/kraken-java-sdk/kraken-java-sdk-gateway/src/main/java/com/consoleconnect/kraken/operator/gateway/service/HeartBeatService.java @@ -8,6 +8,8 @@ import java.time.ZonedDateTime; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Value; +import org.springframework.boot.context.event.ApplicationReadyEvent; +import org.springframework.context.event.EventListener; import org.springframework.scheduling.annotation.Scheduled; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; @@ -31,6 +33,11 @@ public HeartBeatService(final HeartbeatRepository heartbeatRepository) { @Scheduled(cron = "${app.cron-job.push-heartbeat:-}") @Transactional public void heartBeat() { + InstanceHeartbeatEntity entity = builInstanceHeartbeatEntity(); + heartbeatRepository.save(entity); + } + + private InstanceHeartbeatEntity builInstanceHeartbeatEntity() { ZonedDateTime now = DateTime.nowInUTC(); log.debug("Heartbeat at {}", now); InstanceHeartbeatEntity entity = @@ -47,6 +54,14 @@ public void heartBeat() { }); entity.setAppVersion(buildVersion); entity.setUpdatedAt(now); - heartbeatRepository.save(entity); + return entity; + } + + @EventListener(classes = ApplicationReadyEvent.class) + public void onPlatformBootUp(Object event) { + log.info("Application started up, report start up event"); + InstanceHeartbeatEntity instanceHeartbeatEntity = builInstanceHeartbeatEntity(); + instanceHeartbeatEntity.setStartUpAt(ZonedDateTime.now()); + heartbeatRepository.save(instanceHeartbeatEntity); } } diff --git a/kraken-java-sdk/kraken-java-sdk-sync/src/main/java/com/consoleconnect/kraken/operator/sync/model/SyncProperty.java b/kraken-java-sdk/kraken-java-sdk-sync/src/main/java/com/consoleconnect/kraken/operator/sync/model/SyncProperty.java index e5c8da3d..b447b861 100644 --- a/kraken-java-sdk/kraken-java-sdk-sync/src/main/java/com/consoleconnect/kraken/operator/sync/model/SyncProperty.java +++ b/kraken-java-sdk/kraken-java-sdk-sync/src/main/java/com/consoleconnect/kraken/operator/sync/model/SyncProperty.java @@ -9,6 +9,7 @@ public class SyncProperty { private MgmtPlane mgmtPlane = new MgmtPlane(); private List acceptAssetKinds = List.of(); private boolean assetConfigOverwriteFlag = false; + private long synDelaySeconds = 60; @Data public static class ControlPlane { diff --git a/kraken-java-sdk/kraken-java-sdk-sync/src/main/java/com/consoleconnect/kraken/operator/sync/service/PushHeartbeatService.java b/kraken-java-sdk/kraken-java-sdk-sync/src/main/java/com/consoleconnect/kraken/operator/sync/service/PushHeartbeatService.java index f5de7460..35a98525 100644 --- a/kraken-java-sdk/kraken-java-sdk-sync/src/main/java/com/consoleconnect/kraken/operator/sync/service/PushHeartbeatService.java +++ b/kraken-java-sdk/kraken-java-sdk-sync/src/main/java/com/consoleconnect/kraken/operator/sync/service/PushHeartbeatService.java @@ -50,6 +50,7 @@ public void runIt() { heartbeat.setRole(entity.getRole()); heartbeat.setAppVersion(entity.getAppVersion()); heartbeat.setUpdatedAt(entity.getUpdatedAt()); + heartbeat.setStartUpAt(entity.getStartUpAt()); return heartbeat; }) .toList(); diff --git a/kraken-java-sdk/kraken-java-sdk-sync/src/main/java/com/consoleconnect/kraken/operator/sync/service/PushLogService.java b/kraken-java-sdk/kraken-java-sdk-sync/src/main/java/com/consoleconnect/kraken/operator/sync/service/PushLogService.java index 3e8c12ef..088843e4 100644 --- a/kraken-java-sdk/kraken-java-sdk-sync/src/main/java/com/consoleconnect/kraken/operator/sync/service/PushLogService.java +++ b/kraken-java-sdk/kraken-java-sdk-sync/src/main/java/com/consoleconnect/kraken/operator/sync/service/PushLogService.java @@ -36,7 +36,8 @@ public PushLogService( @Scheduled(cron = "${app.cron-job.push-log:-}") public void runIt() { - ZonedDateTime createdAt = ZonedDateTime.now().minusSeconds(10); + ZonedDateTime createdAt = + ZonedDateTime.now().minusSeconds(getAppProperty().getSynDelaySeconds()); List logEntities = apiActivityLogRepository .findAllBySyncStatusAndCreatedAtBefore( diff --git a/kraken-java-sdk/kraken-java-sdk-sync/src/main/java/com/consoleconnect/kraken/operator/sync/service/PushMgmtEventService.java b/kraken-java-sdk/kraken-java-sdk-sync/src/main/java/com/consoleconnect/kraken/operator/sync/service/PushMgmtEventService.java index 9caefa83..be201f47 100644 --- a/kraken-java-sdk/kraken-java-sdk-sync/src/main/java/com/consoleconnect/kraken/operator/sync/service/PushMgmtEventService.java +++ b/kraken-java-sdk/kraken-java-sdk-sync/src/main/java/com/consoleconnect/kraken/operator/sync/service/PushMgmtEventService.java @@ -35,13 +35,14 @@ public class PushMgmtEventService extends KrakenServerConnector { TYPE_MAPPING.put( MgmtEventType.TEMPLATE_UPGRADE_RESULT, ClientEventTypeEnum.CLIENT_TEMPLATE_UPGRADE_RESULT); TYPE_MAPPING.put(MgmtEventType.CLIENT_HEART_BEAT, ClientEventTypeEnum.CLIENT_HEARTBEAT); + TYPE_MAPPING.put( + MgmtEventType.CLIENT_APP_VERSION_UPGRADE_RESULT, + ClientEventTypeEnum.CLIENT_APP_VERSION_UPGRADE_RESULT); + TYPE_MAPPING.put(MgmtEventType.CLIENT_SYSTEM_INFO, ClientEventTypeEnum.CLIENT_SYSTEM_INFO); } protected static final List QUERY_EVENT_TYPES = - List.of( - MgmtEventType.TEMPLATE_UPGRADE_RESULT, - MgmtEventType.CLIENT_HEART_BEAT, - MgmtEventType.CLIENT_SYSTEM_INFO); + TYPE_MAPPING.keySet().stream().toList(); public PushMgmtEventService( SyncProperty appProperty, WebClient webClient, EventSinkService eventSinkService) {