Browse Source

Non-isolated tenant is not managed even if assignedTenantProfiles contains his profile

pull/10157/head
ViacheslavKlimov 3 years ago
parent
commit
91d6cf6dee
  1. 26
      common/queue/src/main/java/org/thingsboard/server/queue/discovery/HashPartitionService.java

26
common/queue/src/main/java/org/thingsboard/server/queue/discovery/HashPartitionService.java

@ -223,23 +223,33 @@ public class HashPartitionService implements PartitionService {
return true;
}
boolean isManaged;
Set<UUID> assignedTenantProfiles = serviceInfoProvider.getAssignedTenantProfiles();
if (assignedTenantProfiles.isEmpty()) { // if this is regular rule engine
if (tenantId.isSysTenantId()) {
return true;
}
TenantRoutingInfo routingInfo = getRoutingInfo(tenantId);
if (routingInfo.isIsolated()) {
return CollectionsUtil.isEmpty(responsibleServices.get(routingInfo.getProfileId()));
isManaged = true;
} else {
return true;
TenantRoutingInfo routingInfo = getRoutingInfo(tenantId);
if (routingInfo.isIsolated()) {
isManaged = CollectionsUtil.isEmpty(responsibleServices.get(routingInfo.getProfileId()));
} else {
isManaged = true;
}
}
} else {
if (tenantId.isSysTenantId()) {
return false;
isManaged = false;
} else {
TenantRoutingInfo routingInfo = getRoutingInfo(tenantId);
if (routingInfo.isIsolated()) {
isManaged = assignedTenantProfiles.contains(routingInfo.getProfileId().getId());
} else {
isManaged = false;
}
}
return assignedTenantProfiles.contains(getRoutingInfo(tenantId).getProfileId().getId());
}
log.trace("[{}] Tenant {} managed by this service", tenantId, isManaged ? "is" : "is not");
return isManaged;
}
@Override

Loading…
Cancel
Save