Search in sources :

Example 11 with TbProtoQueueMsg

use of org.thingsboard.server.queue.common.TbProtoQueueMsg in project thingsboard by thingsboard.

the class DefaultTbClusterService method broadcast.

private void broadcast(ToTransportMsg transportMsg, TbQueueCallback callback) {
    TbQueueProducer<TbProtoQueueMsg<ToTransportMsg>> toTransportNfProducer = producerProvider.getTransportNotificationsMsgProducer();
    Set<String> tbTransportServices = partitionService.getAllServiceIds(ServiceType.TB_TRANSPORT);
    TbQueueCallback proxyCallback = callback != null ? new MultipleTbQueueCallbackWrapper(tbTransportServices.size(), callback) : null;
    for (String transportServiceId : tbTransportServices) {
        TopicPartitionInfo tpi = partitionService.getNotificationsTopic(ServiceType.TB_TRANSPORT, transportServiceId);
        toTransportNfProducer.send(tpi, new TbProtoQueueMsg<>(UUID.randomUUID(), transportMsg), proxyCallback);
        toTransportNfs.incrementAndGet();
    }
}
Also used : TopicPartitionInfo(org.thingsboard.server.common.msg.queue.TopicPartitionInfo) TbQueueCallback(org.thingsboard.server.queue.TbQueueCallback) TbProtoQueueMsg(org.thingsboard.server.queue.common.TbProtoQueueMsg) MultipleTbQueueCallbackWrapper(org.thingsboard.server.queue.common.MultipleTbQueueCallbackWrapper) ByteString(com.google.protobuf.ByteString)

Example 12 with TbProtoQueueMsg

use of org.thingsboard.server.queue.common.TbProtoQueueMsg in project thingsboard by thingsboard.

the class DefaultTbClusterService method broadcast.

private void broadcast(ComponentLifecycleMsg msg) {
    byte[] msgBytes = encodingService.encode(msg);
    TbQueueProducer<TbProtoQueueMsg<ToRuleEngineNotificationMsg>> toRuleEngineProducer = producerProvider.getRuleEngineNotificationsMsgProducer();
    Set<String> tbRuleEngineServices = new HashSet<>(partitionService.getAllServiceIds(ServiceType.TB_RULE_ENGINE));
    EntityType entityType = msg.getEntityId().getEntityType();
    if (entityType.equals(EntityType.TENANT) || entityType.equals(EntityType.TENANT_PROFILE) || entityType.equals(EntityType.DEVICE_PROFILE) || entityType.equals(EntityType.API_USAGE_STATE) || (entityType.equals(EntityType.DEVICE) && msg.getEvent() == ComponentLifecycleEvent.UPDATED) || entityType.equals(EntityType.EDGE)) {
        TbQueueProducer<TbProtoQueueMsg<ToCoreNotificationMsg>> toCoreNfProducer = producerProvider.getTbCoreNotificationsMsgProducer();
        Set<String> tbCoreServices = partitionService.getAllServiceIds(ServiceType.TB_CORE);
        for (String serviceId : tbCoreServices) {
            TopicPartitionInfo tpi = partitionService.getNotificationsTopic(ServiceType.TB_CORE, serviceId);
            ToCoreNotificationMsg toCoreMsg = ToCoreNotificationMsg.newBuilder().setComponentLifecycleMsg(ByteString.copyFrom(msgBytes)).build();
            toCoreNfProducer.send(tpi, new TbProtoQueueMsg<>(msg.getEntityId().getId(), toCoreMsg), null);
            toCoreNfs.incrementAndGet();
        }
        // No need to push notifications twice
        tbRuleEngineServices.removeAll(tbCoreServices);
    }
    for (String serviceId : tbRuleEngineServices) {
        TopicPartitionInfo tpi = partitionService.getNotificationsTopic(ServiceType.TB_RULE_ENGINE, serviceId);
        ToRuleEngineNotificationMsg toRuleEngineMsg = ToRuleEngineNotificationMsg.newBuilder().setComponentLifecycleMsg(ByteString.copyFrom(msgBytes)).build();
        toRuleEngineProducer.send(tpi, new TbProtoQueueMsg<>(msg.getEntityId().getId(), toRuleEngineMsg), null);
        toRuleEngineNfs.incrementAndGet();
    }
}
Also used : EntityType(org.thingsboard.server.common.data.EntityType) ToCoreNotificationMsg(org.thingsboard.server.gen.transport.TransportProtos.ToCoreNotificationMsg) TopicPartitionInfo(org.thingsboard.server.common.msg.queue.TopicPartitionInfo) ToRuleEngineNotificationMsg(org.thingsboard.server.gen.transport.TransportProtos.ToRuleEngineNotificationMsg) TbProtoQueueMsg(org.thingsboard.server.queue.common.TbProtoQueueMsg) ByteString(com.google.protobuf.ByteString) HashSet(java.util.HashSet)

Example 13 with TbProtoQueueMsg

use of org.thingsboard.server.queue.common.TbProtoQueueMsg in project thingsboard by thingsboard.

the class DefaultTbCoreConsumerService method launchMainConsumers.

@Override
protected void launchMainConsumers() {
    consumersExecutor.submit(() -> {
        while (!stopped) {
            try {
                List<TbProtoQueueMsg<ToCoreMsg>> msgs = mainConsumer.poll(pollDuration);
                if (msgs.isEmpty()) {
                    continue;
                }
                List<IdMsgPair<ToCoreMsg>> orderedMsgList = msgs.stream().map(msg -> new IdMsgPair<>(UUID.randomUUID(), msg)).collect(Collectors.toList());
                ConcurrentMap<UUID, TbProtoQueueMsg<ToCoreMsg>> pendingMap = orderedMsgList.stream().collect(Collectors.toConcurrentMap(IdMsgPair::getUuid, IdMsgPair::getMsg));
                CountDownLatch processingTimeoutLatch = new CountDownLatch(1);
                TbPackProcessingContext<TbProtoQueueMsg<ToCoreMsg>> ctx = new TbPackProcessingContext<>(processingTimeoutLatch, pendingMap, new ConcurrentHashMap<>());
                PendingMsgHolder pendingMsgHolder = new PendingMsgHolder();
                Future<?> packSubmitFuture = consumersExecutor.submit(() -> {
                    orderedMsgList.forEach((element) -> {
                        UUID id = element.getUuid();
                        TbProtoQueueMsg<ToCoreMsg> msg = element.getMsg();
                        log.trace("[{}] Creating main callback for message: {}", id, msg.getValue());
                        TbCallback callback = new TbPackCallback<>(id, ctx);
                        try {
                            ToCoreMsg toCoreMsg = msg.getValue();
                            pendingMsgHolder.setToCoreMsg(toCoreMsg);
                            if (toCoreMsg.hasToSubscriptionMgrMsg()) {
                                log.trace("[{}] Forwarding message to subscription manager service {}", id, toCoreMsg.getToSubscriptionMgrMsg());
                                forwardToSubMgrService(toCoreMsg.getToSubscriptionMgrMsg(), callback);
                            } else if (toCoreMsg.hasToDeviceActorMsg()) {
                                log.trace("[{}] Forwarding message to device actor {}", id, toCoreMsg.getToDeviceActorMsg());
                                forwardToDeviceActor(toCoreMsg.getToDeviceActorMsg(), callback);
                            } else if (toCoreMsg.hasDeviceStateServiceMsg()) {
                                log.trace("[{}] Forwarding message to state service {}", id, toCoreMsg.getDeviceStateServiceMsg());
                                forwardToStateService(toCoreMsg.getDeviceStateServiceMsg(), callback);
                            } else if (toCoreMsg.hasEdgeNotificationMsg()) {
                                log.trace("[{}] Forwarding message to edge service {}", id, toCoreMsg.getEdgeNotificationMsg());
                                forwardToEdgeNotificationService(toCoreMsg.getEdgeNotificationMsg(), callback);
                            } else if (!toCoreMsg.getToDeviceActorNotificationMsg().isEmpty()) {
                                Optional<TbActorMsg> actorMsg = encodingService.decode(toCoreMsg.getToDeviceActorNotificationMsg().toByteArray());
                                if (actorMsg.isPresent()) {
                                    TbActorMsg tbActorMsg = actorMsg.get();
                                    if (tbActorMsg.getMsgType().equals(MsgType.DEVICE_RPC_REQUEST_TO_DEVICE_ACTOR_MSG)) {
                                        tbCoreDeviceRpcService.forwardRpcRequestToDeviceActor((ToDeviceRpcRequestActorMsg) tbActorMsg);
                                    } else {
                                        log.trace("[{}] Forwarding message to App Actor {}", id, actorMsg.get());
                                        actorContext.tell(actorMsg.get());
                                    }
                                }
                                callback.onSuccess();
                            }
                        } catch (Throwable e) {
                            log.warn("[{}] Failed to process message: {}", id, msg, e);
                            callback.onFailure(e);
                        }
                    });
                });
                if (!processingTimeoutLatch.await(packProcessingTimeout, TimeUnit.MILLISECONDS)) {
                    if (!packSubmitFuture.isDone()) {
                        packSubmitFuture.cancel(true);
                        ToCoreMsg lastSubmitMsg = pendingMsgHolder.getToCoreMsg();
                        log.info("Timeout to process message: {}", lastSubmitMsg);
                    }
                    ctx.getAckMap().forEach((id, msg) -> log.debug("[{}] Timeout to process message: {}", id, msg.getValue()));
                    ctx.getFailedMap().forEach((id, msg) -> log.warn("[{}] Failed to process message: {}", id, msg.getValue()));
                }
                mainConsumer.commit();
            } catch (Exception e) {
                if (!stopped) {
                    log.warn("Failed to obtain messages from queue.", e);
                    try {
                        Thread.sleep(pollDuration);
                    } catch (InterruptedException e2) {
                        log.trace("Failed to wait until the server has capacity to handle new requests", e2);
                    }
                }
            }
        }
        log.info("TB Core Consumer stopped.");
    });
}
Also used : TbCoreDeviceRpcService(org.thingsboard.server.service.rpc.TbCoreDeviceRpcService) DeviceStateServiceMsgProto(org.thingsboard.server.gen.transport.TransportProtos.DeviceStateServiceMsgProto) ApplicationReadyEvent(org.springframework.boot.context.event.ApplicationReadyEvent) ToDeviceRpcRequestActorMsg(org.thingsboard.server.service.rpc.ToDeviceRpcRequestActorMsg) ToCoreNotificationMsg(org.thingsboard.server.gen.transport.TransportProtos.ToCoreNotificationMsg) StatsFactory(org.thingsboard.server.common.stats.StatsFactory) TenantId(org.thingsboard.server.common.data.id.TenantId) PreDestroy(javax.annotation.PreDestroy) Future(java.util.concurrent.Future) TbAlarmDeleteProto(org.thingsboard.server.gen.transport.TransportProtos.TbAlarmDeleteProto) ActorSystemContext(org.thingsboard.server.actors.ActorSystemContext) EdgeNotificationService(org.thingsboard.server.service.edge.EdgeNotificationService) SubscriptionMgrMsgProto(org.thingsboard.server.gen.transport.TransportProtos.SubscriptionMgrMsgProto) AbstractConsumerService(org.thingsboard.server.service.queue.processing.AbstractConsumerService) LocalSubscriptionServiceMsgProto(org.thingsboard.server.gen.transport.TransportProtos.LocalSubscriptionServiceMsgProto) FromDeviceRPCResponseProto(org.thingsboard.server.gen.transport.TransportProtos.FromDeviceRPCResponseProto) TbSubscriptionCloseProto(org.thingsboard.server.gen.transport.TransportProtos.TbSubscriptionCloseProto) TransportToDeviceActorMsg(org.thingsboard.server.gen.transport.TransportProtos.TransportToDeviceActorMsg) TbAlarmUpdateProto(org.thingsboard.server.gen.transport.TransportProtos.TbAlarmUpdateProto) ToOtaPackageStateServiceMsg(org.thingsboard.server.gen.transport.TransportProtos.ToOtaPackageStateServiceMsg) DeviceStateService(org.thingsboard.server.service.state.DeviceStateService) ConcurrentHashMap(java.util.concurrent.ConcurrentHashMap) EventListener(org.springframework.context.event.EventListener) ThingsBoardThreadFactory(org.thingsboard.common.util.ThingsBoardThreadFactory) UUID(java.util.UUID) Collectors(java.util.stream.Collectors) TbTimeSeriesUpdateProto(org.thingsboard.server.gen.transport.TransportProtos.TbTimeSeriesUpdateProto) Executors(java.util.concurrent.Executors) Alarm(org.thingsboard.server.common.data.alarm.Alarm) CountDownLatch(java.util.concurrent.CountDownLatch) Slf4j(lombok.extern.slf4j.Slf4j) List(java.util.List) TbActorMsg(org.thingsboard.server.common.msg.TbActorMsg) TbCoreQueueFactory(org.thingsboard.server.queue.provider.TbCoreQueueFactory) PostConstruct(javax.annotation.PostConstruct) Optional(java.util.Optional) TbTenantProfileCache(org.thingsboard.server.dao.tenant.TbTenantProfileCache) TbApiUsageStateService(org.thingsboard.server.service.apiusage.TbApiUsageStateService) TbQueueConsumer(org.thingsboard.server.queue.TbQueueConsumer) TransportToDeviceActorMsgWrapper(org.thingsboard.server.service.transport.msg.TransportToDeviceActorMsgWrapper) Setter(lombok.Setter) Getter(lombok.Getter) JacksonUtil(org.thingsboard.common.util.JacksonUtil) Scheduled(org.springframework.scheduling.annotation.Scheduled) Function(java.util.function.Function) TbAttributeDeleteProto(org.thingsboard.server.gen.transport.TransportProtos.TbAttributeDeleteProto) DataDecodingEncodingService(org.thingsboard.server.common.transport.util.DataDecodingEncodingService) ConcurrentMap(java.util.concurrent.ConcurrentMap) Value(org.springframework.beans.factory.annotation.Value) MsgType(org.thingsboard.server.common.msg.MsgType) ToUsageStatsServiceMsg(org.thingsboard.server.gen.transport.TransportProtos.ToUsageStatsServiceMsg) TbCoreComponent(org.thingsboard.server.queue.util.TbCoreComponent) ServiceType(org.thingsboard.server.common.msg.queue.ServiceType) Service(org.springframework.stereotype.Service) ToCoreMsg(org.thingsboard.server.gen.transport.TransportProtos.ToCoreMsg) TbAttributeUpdateProto(org.thingsboard.server.gen.transport.TransportProtos.TbAttributeUpdateProto) TbCallback(org.thingsboard.server.common.msg.queue.TbCallback) ExecutorService(java.util.concurrent.ExecutorService) IdMsgPair(org.thingsboard.server.service.queue.processing.IdMsgPair) TbSubscriptionUtils(org.thingsboard.server.service.subscription.TbSubscriptionUtils) Order(org.springframework.core.annotation.Order) FromDeviceRpcResponse(org.thingsboard.server.common.msg.rpc.FromDeviceRpcResponse) PartitionChangeEvent(org.thingsboard.server.queue.discovery.event.PartitionChangeEvent) EdgeNotificationMsgProto(org.thingsboard.server.gen.transport.TransportProtos.EdgeNotificationMsgProto) RpcError(org.thingsboard.server.common.data.rpc.RpcError) TbDeviceProfileCache(org.thingsboard.server.service.profile.TbDeviceProfileCache) TimeUnit(java.util.concurrent.TimeUnit) SubscriptionManagerService(org.thingsboard.server.service.subscription.SubscriptionManagerService) OtaPackageStateService(org.thingsboard.server.service.ota.OtaPackageStateService) TbLocalSubscriptionService(org.thingsboard.server.service.subscription.TbLocalSubscriptionService) TbTimeSeriesDeleteProto(org.thingsboard.server.gen.transport.TransportProtos.TbTimeSeriesDeleteProto) TbProtoQueueMsg(org.thingsboard.server.queue.common.TbProtoQueueMsg) IdMsgPair(org.thingsboard.server.service.queue.processing.IdMsgPair) TbProtoQueueMsg(org.thingsboard.server.queue.common.TbProtoQueueMsg) CountDownLatch(java.util.concurrent.CountDownLatch) ToCoreMsg(org.thingsboard.server.gen.transport.TransportProtos.ToCoreMsg) TbCallback(org.thingsboard.server.common.msg.queue.TbCallback) UUID(java.util.UUID) TbActorMsg(org.thingsboard.server.common.msg.TbActorMsg)

Example 14 with TbProtoQueueMsg

use of org.thingsboard.server.queue.common.TbProtoQueueMsg in project thingsboard by thingsboard.

the class AbstractConsumerService method launchNotificationsConsumer.

protected void launchNotificationsConsumer() {
    notificationsConsumerExecutor.submit(() -> {
        while (!stopped) {
            try {
                List<TbProtoQueueMsg<N>> msgs = nfConsumer.poll(getNotificationPollDuration());
                if (msgs.isEmpty()) {
                    continue;
                }
                ConcurrentMap<UUID, TbProtoQueueMsg<N>> pendingMap = msgs.stream().collect(Collectors.toConcurrentMap(s -> UUID.randomUUID(), Function.identity()));
                CountDownLatch processingTimeoutLatch = new CountDownLatch(1);
                TbPackProcessingContext<TbProtoQueueMsg<N>> ctx = new TbPackProcessingContext<>(processingTimeoutLatch, pendingMap, new ConcurrentHashMap<>());
                pendingMap.forEach((id, msg) -> {
                    log.trace("[{}] Creating notification callback for message: {}", id, msg.getValue());
                    TbCallback callback = new TbPackCallback<>(id, ctx);
                    try {
                        handleNotification(id, msg, callback);
                    } catch (Throwable e) {
                        log.warn("[{}] Failed to process notification: {}", id, msg, e);
                        callback.onFailure(e);
                    }
                });
                if (!processingTimeoutLatch.await(getNotificationPackProcessingTimeout(), TimeUnit.MILLISECONDS)) {
                    ctx.getAckMap().forEach((id, msg) -> log.warn("[{}] Timeout to process notification: {}", id, msg.getValue()));
                    ctx.getFailedMap().forEach((id, msg) -> log.warn("[{}] Failed to process notification: {}", id, msg.getValue()));
                }
                nfConsumer.commit();
            } catch (Exception e) {
                if (!stopped) {
                    log.warn("Failed to obtain notifications from queue.", e);
                    try {
                        Thread.sleep(getNotificationPollDuration());
                    } catch (InterruptedException e2) {
                        log.trace("Failed to wait until the server has capacity to handle new notifications", e2);
                    }
                }
            }
        }
        log.info("TB Notifications Consumer stopped.");
    });
}
Also used : ApplicationReadyEvent(org.springframework.boot.context.event.ApplicationReadyEvent) DeviceProfileId(org.thingsboard.server.common.data.id.DeviceProfileId) Function(java.util.function.Function) TenantId(org.thingsboard.server.common.data.id.TenantId) DataDecodingEncodingService(org.thingsboard.server.common.transport.util.DataDecodingEncodingService) ConcurrentMap(java.util.concurrent.ConcurrentMap) PreDestroy(javax.annotation.PreDestroy) ActorSystemContext(org.thingsboard.server.actors.ActorSystemContext) ServiceType(org.thingsboard.server.common.msg.queue.ServiceType) EntityType(org.thingsboard.server.common.data.EntityType) TbApplicationEventListener(org.thingsboard.server.queue.discovery.TbApplicationEventListener) TbCallback(org.thingsboard.server.common.msg.queue.TbCallback) ExecutorService(java.util.concurrent.ExecutorService) Order(org.springframework.core.annotation.Order) DeviceId(org.thingsboard.server.common.data.id.DeviceId) ComponentLifecycleMsg(org.thingsboard.server.common.msg.plugin.ComponentLifecycleMsg) PartitionChangeEvent(org.thingsboard.server.queue.discovery.event.PartitionChangeEvent) ConcurrentHashMap(java.util.concurrent.ConcurrentHashMap) EventListener(org.springframework.context.event.EventListener) ThingsBoardThreadFactory(org.thingsboard.common.util.ThingsBoardThreadFactory) UUID(java.util.UUID) Collectors(java.util.stream.Collectors) ComponentLifecycleEvent(org.thingsboard.server.common.data.plugin.ComponentLifecycleEvent) Executors(java.util.concurrent.Executors) TbDeviceProfileCache(org.thingsboard.server.service.profile.TbDeviceProfileCache) ByteString(com.google.protobuf.ByteString) TimeUnit(java.util.concurrent.TimeUnit) CountDownLatch(java.util.concurrent.CountDownLatch) Slf4j(lombok.extern.slf4j.Slf4j) List(java.util.List) TbActorMsg(org.thingsboard.server.common.msg.TbActorMsg) TbPackProcessingContext(org.thingsboard.server.service.queue.TbPackProcessingContext) TenantProfileId(org.thingsboard.server.common.data.id.TenantProfileId) TbPackCallback(org.thingsboard.server.service.queue.TbPackCallback) Optional(java.util.Optional) TbApiUsageStateService(org.thingsboard.server.service.apiusage.TbApiUsageStateService) TbTenantProfileCache(org.thingsboard.server.dao.tenant.TbTenantProfileCache) TbProtoQueueMsg(org.thingsboard.server.queue.common.TbProtoQueueMsg) TbQueueConsumer(org.thingsboard.server.queue.TbQueueConsumer) CustomerId(org.thingsboard.server.common.data.id.CustomerId) TbPackProcessingContext(org.thingsboard.server.service.queue.TbPackProcessingContext) TbProtoQueueMsg(org.thingsboard.server.queue.common.TbProtoQueueMsg) CountDownLatch(java.util.concurrent.CountDownLatch) TbCallback(org.thingsboard.server.common.msg.queue.TbCallback) UUID(java.util.UUID) TbPackCallback(org.thingsboard.server.service.queue.TbPackCallback)

Example 15 with TbProtoQueueMsg

use of org.thingsboard.server.queue.common.TbProtoQueueMsg in project thingsboard by thingsboard.

the class InMemoryTbTransportQueueFactory method createTransportApiRequestTemplate.

@Override
public TbQueueRequestTemplate<TbProtoQueueMsg<TransportApiRequestMsg>, TbProtoQueueMsg<TransportApiResponseMsg>> createTransportApiRequestTemplate() {
    InMemoryTbQueueProducer<TbProtoQueueMsg<TransportApiRequestMsg>> producerTemplate = new InMemoryTbQueueProducer<>(transportApiSettings.getRequestsTopic());
    InMemoryTbQueueConsumer<TbProtoQueueMsg<TransportApiResponseMsg>> consumerTemplate = new InMemoryTbQueueConsumer<>(transportApiSettings.getResponsesTopic() + "." + serviceInfoProvider.getServiceId());
    DefaultTbQueueRequestTemplate.DefaultTbQueueRequestTemplateBuilder<TbProtoQueueMsg<TransportApiRequestMsg>, TbProtoQueueMsg<TransportApiResponseMsg>> templateBuilder = DefaultTbQueueRequestTemplate.builder();
    templateBuilder.queueAdmin(new TbQueueAdmin() {

        @Override
        public void createTopicIfNotExists(String topic) {
        }

        @Override
        public void destroy() {
        }
    });
    templateBuilder.requestTemplate(producerTemplate);
    templateBuilder.responseTemplate(consumerTemplate);
    templateBuilder.maxPendingRequests(transportApiSettings.getMaxPendingRequests());
    templateBuilder.maxRequestTimeout(transportApiSettings.getMaxRequestsTimeout());
    templateBuilder.pollInterval(transportApiSettings.getResponsePollInterval());
    return templateBuilder.build();
}
Also used : InMemoryTbQueueConsumer(org.thingsboard.server.queue.memory.InMemoryTbQueueConsumer) TbProtoQueueMsg(org.thingsboard.server.queue.common.TbProtoQueueMsg) InMemoryTbQueueProducer(org.thingsboard.server.queue.memory.InMemoryTbQueueProducer) TbQueueAdmin(org.thingsboard.server.queue.TbQueueAdmin) DefaultTbQueueRequestTemplate(org.thingsboard.server.queue.common.DefaultTbQueueRequestTemplate)

Aggregations

TbProtoQueueMsg (org.thingsboard.server.queue.common.TbProtoQueueMsg)21 UUID (java.util.UUID)9 ByteString (com.google.protobuf.ByteString)6 ConcurrentHashMap (java.util.concurrent.ConcurrentHashMap)6 TopicPartitionInfo (org.thingsboard.server.common.msg.queue.TopicPartitionInfo)6 ToCoreNotificationMsg (org.thingsboard.server.gen.transport.TransportProtos.ToCoreNotificationMsg)6 ConcurrentMap (java.util.concurrent.ConcurrentMap)5 List (java.util.List)4 Optional (java.util.Optional)4 CountDownLatch (java.util.concurrent.CountDownLatch)4 TimeUnit (java.util.concurrent.TimeUnit)4 PostConstruct (javax.annotation.PostConstruct)4 Slf4j (lombok.extern.slf4j.Slf4j)4 TbQueueConsumer (org.thingsboard.server.queue.TbQueueConsumer)4 ExecutorService (java.util.concurrent.ExecutorService)3 Executors (java.util.concurrent.Executors)3 Function (java.util.function.Function)3 Collectors (java.util.stream.Collectors)3 PreDestroy (javax.annotation.PreDestroy)3 Value (org.springframework.beans.factory.annotation.Value)3