Browse Source

Fix circular references

pull/13461/head
ViacheslavKlimov 1 year ago
parent
commit
e17004ebb3
  1. 10
      application/src/main/java/org/thingsboard/server/service/queue/DefaultTenantRoutingInfoService.java
  2. 2
      dao/src/main/java/org/thingsboard/server/dao/service/validator/QueueValidator.java

10
application/src/main/java/org/thingsboard/server/service/queue/DefaultTenantRoutingInfoService.java

@ -16,7 +16,9 @@
package org.thingsboard.server.service.queue; package org.thingsboard.server.service.queue;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.condition.ConditionalOnExpression; import org.springframework.boot.autoconfigure.condition.ConditionalOnExpression;
import org.springframework.context.annotation.Lazy;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.thingsboard.server.common.data.TenantProfile; import org.thingsboard.server.common.data.TenantProfile;
import org.thingsboard.server.common.data.exception.TenantNotFoundException; 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'") @ConditionalOnExpression("'${service.type:null}'=='monolith' || '${service.type:null}'=='tb-core' || '${service.type:null}'=='tb-rule-engine'")
public class DefaultTenantRoutingInfoService implements TenantRoutingInfoService { public class DefaultTenantRoutingInfoService implements TenantRoutingInfoService {
private final TbTenantProfileCache tenantProfileCache; @Lazy
@Autowired
public DefaultTenantRoutingInfoService(TbTenantProfileCache tenantProfileCache) { private TbTenantProfileCache tenantProfileCache;
this.tenantProfileCache = tenantProfileCache;
}
@Override @Override
public TenantRoutingInfo getRoutingInfo(TenantId tenantId) { public TenantRoutingInfo getRoutingInfo(TenantId tenantId) {

2
dao/src/main/java/org/thingsboard/server/dao/service/validator/QueueValidator.java

@ -16,6 +16,7 @@
package org.thingsboard.server.dao.service.validator; package org.thingsboard.server.dao.service.validator;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Lazy;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
import org.thingsboard.server.common.data.TenantProfile; import org.thingsboard.server.common.data.TenantProfile;
import org.thingsboard.server.common.data.id.TenantId; import org.thingsboard.server.common.data.id.TenantId;
@ -34,6 +35,7 @@ public class QueueValidator extends DataValidator<Queue> {
@Autowired @Autowired
private QueueDao queueDao; private QueueDao queueDao;
@Lazy
@Autowired @Autowired
private TbTenantProfileCache tenantProfileCache; private TbTenantProfileCache tenantProfileCache;

Loading…
Cancel
Save