Browse Source
Merge pull request #10394 from thingsboard/fix/queue-deletion-event
Ignore partition change event for deleted queues
pull/10419/head
Viacheslav Klimov
3 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with
9 additions and
1 deletions
-
application/src/main/java/org/thingsboard/server/service/queue/DefaultTbRuleEngineConsumerService.java
|
|
|
@ -114,9 +114,17 @@ public class DefaultTbRuleEngineConsumerService extends AbstractConsumerService< |
|
|
|
if (partitionService.isManagedByCurrentService(queueKey.getTenantId())) { |
|
|
|
var consumer = getConsumer(queueKey).orElseGet(() -> { |
|
|
|
Queue config = queueService.findQueueByTenantIdAndName(queueKey.getTenantId(), queueKey.getQueueName()); |
|
|
|
if (config == null) { |
|
|
|
if (!partitions.isEmpty()) { |
|
|
|
log.error("[{}] Queue configuration is missing", queueKey, new RuntimeException("stacktrace")); |
|
|
|
} |
|
|
|
return null; |
|
|
|
} |
|
|
|
return createConsumer(queueKey, config); |
|
|
|
}); |
|
|
|
consumer.update(partitions); |
|
|
|
if (consumer != null) { |
|
|
|
consumer.update(partitions); |
|
|
|
} |
|
|
|
} |
|
|
|
}); |
|
|
|
consumers.keySet().stream() |
|
|
|
|