fixed NP after changing tenant profile

This commit is contained in:
YevhenBondarenko 2022-05-05 11:06:36 +02:00
parent 141dc735f3
commit acd7bd98d6
2 changed files with 5 additions and 2 deletions

View File

@ -50,6 +50,7 @@ public class DefaultTbTenantService implements TbTenantService {
TenantProfile oldTenantProfile = oldTenant != null ? tenantProfileService.findTenantProfileById(TenantId.SYS_TENANT_ID, oldTenant.getTenantProfileId()) : null;
TenantProfile newTenantProfile = tenantProfileService.findTenantProfileById(TenantId.SYS_TENANT_ID, savedTenant.getTenantProfileId());
//TODO: send notifications before queue update
tbQueueService.updateQueuesByTenants(Collections.singletonList(savedTenant.getTenantId()), newTenantProfile, oldTenantProfile);
return savedTenant;
}

View File

@ -155,6 +155,8 @@ public class HashPartitionService implements PartitionService {
myPartitions.remove(queueKey);
partitionTopicsMap.remove(queueKey);
partitionSizesMap.remove(queueKey);
//TODO: remove after merging tb entity services
removeTenant(tenantId);
}
@Override
@ -172,10 +174,10 @@ public class HashPartitionService implements PartitionService {
//TODO: replace if we can notify CheckPoint rule nodes about queue changes
if (queueRoutingInfo == null) {
log.warn("Queue was removed but still used in CheckPoint rule node. [{}][{}]", tenantId, entityId);
log.debug("Queue was removed but still used in CheckPoint rule node. [{}][{}]", tenantId, entityId);
queueKey = getMainQueueKey(serviceType, tenantId);
} else if (!queueRoutingInfo.getTenantId().equals(getIsolatedOrSystemTenantId(serviceType, tenantId))) {
log.warn("Tenant profile was changed but CheckPoint rule node still uses the queue from system level. [{}][{}]", tenantId, entityId);
log.debug("Tenant profile was changed but CheckPoint rule node still uses the queue from system level. [{}][{}]", tenantId, entityId);
queueKey = getMainQueueKey(serviceType, tenantId);
} else {
queueKey = new QueueKey(serviceType, queueRoutingInfo);