From 7d3f5bfd2e4fefe02c7f2fcf59981bb33f026419 Mon Sep 17 00:00:00 2001 From: "adheli.tavares" Date: Thu, 14 Dec 2023 10:05:49 +0000 Subject: Apply lower case to any topics to be compatible with Kafka. Issue-ID: POLICY-4402 Change-Id: Iebaec5f52a1fa0feb881ccfcb5319bc8a951b496 Signed-off-by: adheli.tavares --- .../endpoints/event/comm/bus/IndexedKafkaTopicSourceFactory.java | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'policy-endpoints/src/main/java/org/onap/policy/common/endpoints/event/comm/bus/IndexedKafkaTopicSourceFactory.java') diff --git a/policy-endpoints/src/main/java/org/onap/policy/common/endpoints/event/comm/bus/IndexedKafkaTopicSourceFactory.java b/policy-endpoints/src/main/java/org/onap/policy/common/endpoints/event/comm/bus/IndexedKafkaTopicSourceFactory.java index 1d586e43..151d8f69 100644 --- a/policy-endpoints/src/main/java/org/onap/policy/common/endpoints/event/comm/bus/IndexedKafkaTopicSourceFactory.java +++ b/policy-endpoints/src/main/java/org/onap/policy/common/endpoints/event/comm/bus/IndexedKafkaTopicSourceFactory.java @@ -42,7 +42,7 @@ class IndexedKafkaTopicSourceFactory implements KafkaTopicSourceFactory { /** * Logger. */ - private static Logger logger = LoggerFactory.getLogger(IndexedKafkaTopicSourceFactory.class); + private static final Logger logger = LoggerFactory.getLogger(IndexedKafkaTopicSourceFactory.class); /** * KAFKA Topic Name Index. @@ -84,7 +84,7 @@ class IndexedKafkaTopicSourceFactory implements KafkaTopicSourceFactory { List newKafkaTopicSources = new ArrayList<>(); synchronized (this) { for (String topic : COMMA_SPACE_PAT.split(readTopics)) { - addTopic(newKafkaTopicSources, topic, properties); + addTopic(newKafkaTopicSources, topic.toLowerCase(), properties); } } return newKafkaTopicSources; @@ -110,11 +110,12 @@ class IndexedKafkaTopicSourceFactory implements KafkaTopicSourceFactory { String topicPrefix = PolicyEndPointProperties.PROPERTY_KAFKA_SOURCE_TOPICS + "." + topic; var props = new PropertyUtils(properties, topicPrefix, - (name, value, ex) -> logger.warn("{}: {} {} is in invalid format for topic {} ", this, name, value, topic)); + (name, value, ex) -> logger.warn("{}: {} {} is in invalid format for topic source {} ", + this, name, value, topic)); String servers = properties.getProperty(topicPrefix + PolicyEndPointProperties.PROPERTY_TOPIC_SERVERS_SUFFIX); if (StringUtils.isBlank(servers)) { - logger.error("{}: no KAFKA servers configured for sink {}", this, topic); + logger.error("{}: no KAFKA servers configured for source {}", this, topic); return; } -- cgit 1.2.3-korg