From 2c8b938540b2f2fdaa16d60de82f96859e69e371 Mon Sep 17 00:00:00 2001 From: Andrii Shvaika Date: Thu, 4 Aug 2022 15:22:24 +0300 Subject: [PATCH] Tenant Routing Info performance optimization --- .../service/queue/DefaultTenantRoutingInfoService.java | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/application/src/main/java/org/thingsboard/server/service/queue/DefaultTenantRoutingInfoService.java b/application/src/main/java/org/thingsboard/server/service/queue/DefaultTenantRoutingInfoService.java index 1ab9686d6f..be9dadfd42 100644 --- a/application/src/main/java/org/thingsboard/server/service/queue/DefaultTenantRoutingInfoService.java +++ b/application/src/main/java/org/thingsboard/server/service/queue/DefaultTenantRoutingInfoService.java @@ -42,9 +42,8 @@ public class DefaultTenantRoutingInfoService implements TenantRoutingInfoService @Override public TenantRoutingInfo getRoutingInfo(TenantId tenantId) { - Tenant tenant = tenantService.findTenantById(tenantId); - if (tenant != null) { - TenantProfile tenantProfile = tenantProfileCache.get(tenant.getTenantProfileId()); + TenantProfile tenantProfile = tenantProfileCache.get(tenantId); + if (tenantProfile != null) { return new TenantRoutingInfo(tenantId, tenantProfile.isIsolatedTbRuleEngine()); } else { throw new RuntimeException("Tenant not found!");