diff options
author | sunil.unnava <sunil.unnava@att.com> | 2019-04-02 16:55:44 -0400 |
---|---|---|
committer | sunil.unnava <sunil.unnava@att.com> | 2019-04-02 16:56:06 -0400 |
commit | deaef554cc6ac0025a088b6c11ce82b85fd89083 (patch) | |
tree | cfc6fd777eea8ad47793a4d64cd369c773792dfe /src/main/java | |
parent | 4787fb499d29814267218ddf4d8de1c5880d6657 (diff) |
add testcases
Issue-ID: DMAAP-1140
Change-Id: I6dce89a14f874e7788acd7bea1fd48ebaafed71e
Signed-off-by: sunil.unnava <sunil.unnava@att.com>
Diffstat (limited to 'src/main/java')
-rw-r--r-- | src/main/java/org/onap/dmaap/dmf/mr/backends/kafka/KafkaPublisher.java | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/src/main/java/org/onap/dmaap/dmf/mr/backends/kafka/KafkaPublisher.java b/src/main/java/org/onap/dmaap/dmf/mr/backends/kafka/KafkaPublisher.java index 2a9e0ab..4bdd9f3 100644 --- a/src/main/java/org/onap/dmaap/dmf/mr/backends/kafka/KafkaPublisher.java +++ b/src/main/java/org/onap/dmaap/dmf/mr/backends/kafka/KafkaPublisher.java @@ -32,7 +32,7 @@ import org.apache.kafka.clients.producer.Producer; import org.apache.kafka.clients.producer.ProducerRecord; import org.json.JSONException; import org.springframework.beans.factory.annotation.Qualifier; - +import org.springframework.util.StringUtils; import org.onap.dmaap.dmf.mr.backends.Publisher; import org.onap.dmaap.dmf.mr.constants.CambriaConstants; import org.onap.dmaap.dmf.mr.utils.Utils; @@ -61,15 +61,10 @@ public class KafkaPublisher implements Publisher { * @throws rrNvReadable.missingReqdSetting */ public KafkaPublisher(@Qualifier("propertyReader") rrNvReadable settings) throws rrNvReadable.missingReqdSetting { - //fSettings = settings; final Properties props = new Properties(); - /*transferSetting(fSettings, props, "metadata.broker.list", "localhost:9092"); - transferSetting(fSettings, props, "request.required.acks", "1"); - transferSetting(fSettings, props, "message.send.max.retries", "5"); - transferSetting(fSettings, props, "retry.backoff.ms", "150"); */ String kafkaConnUrl= com.att.ajsc.filemonitor.AJSCPropertiesMap.getProperty(CambriaConstants.msgRtr_prop,"kafka.metadata.broker.list"); - if(null==kafkaConnUrl){ + if(StringUtils.isEmpty(kafkaConnUrl)){ kafkaConnUrl="localhost:9092"; } @@ -209,7 +204,7 @@ try{ */ private void transferSetting(Properties props, String key, String defVal) { String kafka_prop= com.att.ajsc.filemonitor.AJSCPropertiesMap.getProperty(CambriaConstants.msgRtr_prop,"kafka." + key); - if (null==kafka_prop) kafka_prop=defVal; + if (StringUtils.isEmpty(kafka_prop)) kafka_prop=defVal; //props.put(key, settings.getString("kafka." + key, defVal)); props.put(key, kafka_prop); } |