Browse Source
Merge pull request #13461 from thingsboard/fix/re-init
Fix circular references
pull/13463/head
Viacheslav Klimov
1 year ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with
7 additions and
5 deletions
-
application/src/main/java/org/thingsboard/server/service/queue/DefaultTenantRoutingInfoService.java
-
dao/src/main/java/org/thingsboard/server/dao/service/validator/QueueValidator.java
|
|
|
@ -16,7 +16,9 @@ |
|
|
|
package org.thingsboard.server.service.queue; |
|
|
|
|
|
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
import org.springframework.boot.autoconfigure.condition.ConditionalOnExpression; |
|
|
|
import org.springframework.context.annotation.Lazy; |
|
|
|
import org.springframework.stereotype.Service; |
|
|
|
import org.thingsboard.server.common.data.TenantProfile; |
|
|
|
import org.thingsboard.server.common.data.exception.TenantNotFoundException; |
|
|
|
@ -30,11 +32,9 @@ import org.thingsboard.server.queue.discovery.TenantRoutingInfoService; |
|
|
|
@ConditionalOnExpression("'${service.type:null}'=='monolith' || '${service.type:null}'=='tb-core' || '${service.type:null}'=='tb-rule-engine'") |
|
|
|
public class DefaultTenantRoutingInfoService implements TenantRoutingInfoService { |
|
|
|
|
|
|
|
private final TbTenantProfileCache tenantProfileCache; |
|
|
|
|
|
|
|
public DefaultTenantRoutingInfoService(TbTenantProfileCache tenantProfileCache) { |
|
|
|
this.tenantProfileCache = tenantProfileCache; |
|
|
|
} |
|
|
|
@Lazy |
|
|
|
@Autowired |
|
|
|
private TbTenantProfileCache tenantProfileCache; |
|
|
|
|
|
|
|
@Override |
|
|
|
public TenantRoutingInfo getRoutingInfo(TenantId tenantId) { |
|
|
|
|
|
|
|
@ -16,6 +16,7 @@ |
|
|
|
package org.thingsboard.server.dao.service.validator; |
|
|
|
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
import org.springframework.context.annotation.Lazy; |
|
|
|
import org.springframework.stereotype.Component; |
|
|
|
import org.thingsboard.server.common.data.TenantProfile; |
|
|
|
import org.thingsboard.server.common.data.id.TenantId; |
|
|
|
@ -34,6 +35,7 @@ public class QueueValidator extends DataValidator<Queue> { |
|
|
|
@Autowired |
|
|
|
private QueueDao queueDao; |
|
|
|
|
|
|
|
@Lazy |
|
|
|
@Autowired |
|
|
|
private TbTenantProfileCache tenantProfileCache; |
|
|
|
|
|
|
|
|