ソースを参照

fix optional security.protocol

Grega Bremec 7 ヶ月 前
コミット
42c8308fa4

+ 2 - 2
code/core-api-producer/src/main/java/com/redhat/training/kafka/coreapi/producer/Producer.java

@@ -45,8 +45,8 @@ public class Producer {
         Properties props = new Properties();
 
         // Standard mandatory configs.
-        props.put(CommonClientConfigs.SECURITY_PROTOCOL_CONFIG, cf.getValue("security.protocol", String.class));
-        props.put(SslConfigs.SSL_TRUSTSTORE_LOCATION_CONFIG, cf.getOptionalValue("ssl.truststore.location", String.class).orElse("SSL"));
+        props.put(CommonClientConfigs.SECURITY_PROTOCOL_CONFIG, cf.getOptionalValue("security.protocol", String.class).orElse("SSL"));
+        props.put(SslConfigs.SSL_TRUSTSTORE_LOCATION_CONFIG, cf.getValue("ssl.truststore.location", String.class));
         props.put(SslConfigs.SSL_TRUSTSTORE_PASSWORD_CONFIG, cf.getValue("ssl.truststore.password", String.class));
         props.put(ProducerConfig.BOOTSTRAP_SERVERS_CONFIG, cf.getValue("kafka.bootstrap.server", String.class));