From 6a39bafe137855bd867871d6c588b5ac989ebf4c Mon Sep 17 00:00:00 2001 From: Ravi Pendurty Date: Thu, 20 Apr 2023 19:47:17 +0530 Subject: Include env vars as defaults strimzikafka section updated in mountpoint-registrar.properties Issue-ID: SDNC-1796 Signed-off-by: Ravi Pendurty Change-Id: I2880442966291dd00293bf92e31fecd15d554e4c Signed-off-by: Ravi Pendurty --- sdnr/wt/mountpoint-registrar/feature/pom.xml | 11 ++++++++++- sdnr/wt/mountpoint-registrar/provider/pom.xml | 4 +++- .../wt/mountpointregistrar/config/StrimziKafkaConfig.java | 13 +++++++------ 3 files changed, 20 insertions(+), 8 deletions(-) (limited to 'sdnr/wt') diff --git a/sdnr/wt/mountpoint-registrar/feature/pom.xml b/sdnr/wt/mountpoint-registrar/feature/pom.xml index e5ab684c4..81c0ac4c8 100644 --- a/sdnr/wt/mountpoint-registrar/feature/pom.xml +++ b/sdnr/wt/mountpoint-registrar/feature/pom.xml @@ -22,6 +22,7 @@ ~ ============LICENSE_END======================================================= ~ --> + 4.0.0 @@ -38,7 +39,15 @@ feature ccsdk-features :: ${project.artifactId} - + + + + org.apache.kafka + kafka-clients + 3.0.0 + + + ${project.groupId} diff --git a/sdnr/wt/mountpoint-registrar/provider/pom.xml b/sdnr/wt/mountpoint-registrar/provider/pom.xml index a10566920..9eb06b214 100644 --- a/sdnr/wt/mountpoint-registrar/provider/pom.xml +++ b/sdnr/wt/mountpoint-registrar/provider/pom.xml @@ -22,7 +22,9 @@ ~ ============LICENSE_END======================================================= ~ --> - + + 4.0.0 diff --git a/sdnr/wt/mountpoint-registrar/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/mountpointregistrar/config/StrimziKafkaConfig.java b/sdnr/wt/mountpoint-registrar/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/mountpointregistrar/config/StrimziKafkaConfig.java index 41ab8a7cb..0e88e299f 100644 --- a/sdnr/wt/mountpoint-registrar/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/mountpointregistrar/config/StrimziKafkaConfig.java +++ b/sdnr/wt/mountpoint-registrar/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/mountpointregistrar/config/StrimziKafkaConfig.java @@ -25,7 +25,7 @@ import org.onap.ccsdk.features.sdnr.wt.common.configuration.ConfigurationFileRep * bootstrapServers=abc:9092,def:9092 * securityProtocol=PLAINTEXT #OTHER POSSIBLE VALUES - SSL, SASL_PLAINTEXT, SASL_SSL * saslMechanism=PLAIN #Need to understand more - * saslJaasConfig= + * saslJaasConfig=PLAIN * consumerGroup= * consumerID= */ @@ -34,18 +34,19 @@ public class StrimziKafkaConfig implements Configuration { private static final String SECTION_MARKER = "strimzi-kafka"; private static final String PROPERTY_KEY_ENABLED = "strimziEnabled"; + private static final String DEFAULT_VALUE_KAFKA_ENABLED = "${SDNR_KAFKA_ENABLED}"; private static final String PROPERTY_KEY_BOOTSTRAPSERVERS = "bootstrapServers"; - private static final String DEFAULT_VALUE_BOOTSTRAPSERVERS = "onap-strimzi-kafka-0:9094,onap-strimzi-kafka-1:9094"; + private static final String DEFAULT_VALUE_BOOTSTRAPSERVERS = "${SDNR_KAFKA_BOOTSTRAP_SERVERS}"; private static final String PROPERTY_KEY_SECURITYPROTOCOL = "securityProtocol"; - private static final String DEFAULT_VALUE_SECURITYPROTOCOL = "PLAINTEXT"; + private static final String DEFAULT_VALUE_SECURITYPROTOCOL = "${SDNR_KAFKA_SECURITY_PROTOCOL}"; private static final String PROPERTY_KEY_SASLMECHANISM = "saslMechanism"; - private static final String DEFAULT_VALUE_SASLMECHANISM = "PLAIN"; + private static final String DEFAULT_VALUE_SASLMECHANISM = "${SDNR_KAFKA_SASL_MECHANISM}"; private static final String PROPERTY_KEY_SASLJAASCONFIG = "saslJaasConfig"; - private static final String DEFAULT_VALUE_SASLJAASCONFIG = "PLAIN"; // TBD + private static final String DEFAULT_VALUE_SASLJAASCONFIG = "${SDNR_KAFKA_SASL_JAAS_CONFIG}"; private ConfigurationFileRepresentation configuration; @@ -84,7 +85,7 @@ public class StrimziKafkaConfig implements Configuration { public void defaults() { // The default value should be "false" given that SDNR can be run in // environments where Strimzi is not used - configuration.setPropertyIfNotAvailable(SECTION_MARKER, PROPERTY_KEY_ENABLED, Boolean.FALSE); + configuration.setPropertyIfNotAvailable(SECTION_MARKER, PROPERTY_KEY_ENABLED, DEFAULT_VALUE_KAFKA_ENABLED); configuration.setPropertyIfNotAvailable(SECTION_MARKER, PROPERTY_KEY_BOOTSTRAPSERVERS, DEFAULT_VALUE_BOOTSTRAPSERVERS); configuration.setPropertyIfNotAvailable(SECTION_MARKER, PROPERTY_KEY_SECURITYPROTOCOL, -- cgit 1.2.3-korg