|
|
|
@ -19,6 +19,7 @@ import lombok.Getter; |
|
|
|
import org.springframework.beans.factory.annotation.Value; |
|
|
|
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; |
|
|
|
import org.springframework.stereotype.Component; |
|
|
|
import org.thingsboard.server.common.data.StringUtils; |
|
|
|
|
|
|
|
import javax.annotation.PostConstruct; |
|
|
|
import java.util.HashMap; |
|
|
|
@ -37,7 +38,7 @@ public class TbKafkaTopicConfigs { |
|
|
|
private String notificationsProperties; |
|
|
|
@Value("${queue.kafka.topic-properties.js-executor}") |
|
|
|
private String jsExecutorProperties; |
|
|
|
@Value("${queue.kafka.topic-properties.fw-updates}") |
|
|
|
@Value("${queue.kafka.topic-properties.fw-updates:}") |
|
|
|
private String fwUpdatesProperties; |
|
|
|
|
|
|
|
@Getter |
|
|
|
@ -65,11 +66,13 @@ public class TbKafkaTopicConfigs { |
|
|
|
|
|
|
|
private Map<String, String> getConfigs(String properties) { |
|
|
|
Map<String, String> configs = new HashMap<>(); |
|
|
|
for (String property : properties.split(";")) { |
|
|
|
int delimiterPosition = property.indexOf(":"); |
|
|
|
String key = property.substring(0, delimiterPosition); |
|
|
|
String value = property.substring(delimiterPosition + 1); |
|
|
|
configs.put(key, value); |
|
|
|
if (StringUtils.isNotEmpty(properties)) { |
|
|
|
for (String property : properties.split(";")) { |
|
|
|
int delimiterPosition = property.indexOf(":"); |
|
|
|
String key = property.substring(0, delimiterPosition); |
|
|
|
String value = property.substring(delimiterPosition + 1); |
|
|
|
configs.put(key, value); |
|
|
|
} |
|
|
|
} |
|
|
|
return configs; |
|
|
|
} |
|
|
|
|