|
|
|
@ -157,13 +157,10 @@ public class DefaultTransportService implements TransportService { |
|
|
|
@Autowired |
|
|
|
@Lazy |
|
|
|
private TbApiUsageClient apiUsageClient; |
|
|
|
@Autowired |
|
|
|
@Lazy |
|
|
|
private PartitionService partitionService; |
|
|
|
|
|
|
|
private final Map<String, Number> statsMap = new LinkedHashMap<>(); |
|
|
|
|
|
|
|
private final Gson gson = new Gson(); |
|
|
|
private final PartitionService partitionService; |
|
|
|
private final TbTransportQueueFactory queueProvider; |
|
|
|
private final TbQueueProducerProvider producerProvider; |
|
|
|
|
|
|
|
@ -197,7 +194,8 @@ public class DefaultTransportService implements TransportService { |
|
|
|
|
|
|
|
private volatile boolean stopped = false; |
|
|
|
|
|
|
|
public DefaultTransportService(TbServiceInfoProvider serviceInfoProvider, |
|
|
|
public DefaultTransportService(PartitionService partitionService, |
|
|
|
TbServiceInfoProvider serviceInfoProvider, |
|
|
|
TbTransportQueueFactory queueProvider, |
|
|
|
TbQueueProducerProvider producerProvider, |
|
|
|
NotificationsTopicService notificationsTopicService, |
|
|
|
@ -207,6 +205,7 @@ public class DefaultTransportService implements TransportService { |
|
|
|
TransportRateLimitService rateLimitService, |
|
|
|
DataDecodingEncodingService dataDecodingEncodingService, SchedulerComponent scheduler, TransportResourceCache transportResourceCache, |
|
|
|
ApplicationEventPublisher eventPublisher) { |
|
|
|
this.partitionService = partitionService; |
|
|
|
this.serviceInfoProvider = serviceInfoProvider; |
|
|
|
this.queueProvider = queueProvider; |
|
|
|
this.producerProvider = producerProvider; |
|
|
|
@ -240,7 +239,7 @@ public class DefaultTransportService implements TransportService { |
|
|
|
mainConsumerExecutor = Executors.newSingleThreadExecutor(ThingsBoardThreadFactory.forName("transport-consumer")); |
|
|
|
} |
|
|
|
|
|
|
|
@AfterStartUp |
|
|
|
@AfterStartUp(order = AfterStartUp.TRANSPORT_SERVICE) |
|
|
|
private void start() { |
|
|
|
mainConsumerExecutor.execute(() -> { |
|
|
|
while (!stopped) { |
|
|
|
|