Browse Source

Improve customization for edge-event topic

pull/12588/head
Andrii Landiak 2 years ago
parent
commit
8de861f897
  1. 2
      application/src/main/resources/thingsboard.yml
  2. 5
      common/queue/src/main/java/org/thingsboard/server/queue/discovery/TopicService.java

2
application/src/main/resources/thingsboard.yml

@ -1748,6 +1748,8 @@ queue:
topic: "${TB_QUEUE_EDGE_TOPIC:tb_edge}"
# For high-priority notifications that require minimum latency and processing time
notifications_topic: "${TB_QUEUE_EDGE_NOTIFICATIONS_TOPIC:tb_edge.notifications}"
# For edge events messages
event_notifications_topic: "${TB_QUEUE_EDGE_EVENT_NOTIFICATIONS_TOPIC:tb_edge_event.notifications}"
# Amount of partitions used by Edge services
partitions: "${TB_QUEUE_EDGE_PARTITIONS:10}"
# Poll interval for topics related to Edge services

5
common/queue/src/main/java/org/thingsboard/server/queue/discovery/TopicService.java

@ -44,6 +44,9 @@ public class TopicService {
@Value("${queue.edge.notifications-topic:tb_edge.notifications}")
private String tbEdgeNotificationsTopic;
@Value("${queue.edge.event-notifications-topic:tb_edge.notifications}")
private String tbEdgeEventNotificationsTopic;
private final ConcurrentMap<String, TopicPartitionInfo> tbCoreNotificationTopics = new ConcurrentHashMap<>();
private final ConcurrentMap<String, TopicPartitionInfo> tbRuleEngineNotificationTopics = new ConcurrentHashMap<>();
private final ConcurrentMap<String, TopicPartitionInfo> tbEdgeNotificationTopics = new ConcurrentHashMap<>();
@ -88,7 +91,7 @@ public class TopicService {
}
public TopicPartitionInfo buildEdgeEventNotificationsTopicPartitionInfo(TenantId tenantId, EdgeId edgeId) {
return buildTopicPartitionInfo("tb_edge_event.notifications." + tenantId + "." + edgeId, null, null, false);
return buildTopicPartitionInfo(tbEdgeEventNotificationsTopic + "." + tenantId + "." + edgeId, null, null, false);
}
public String buildTopicName(String topic) {

Loading…
Cancel
Save