Skip to content

Commit 586f61d

Browse files
authored
Update StandaloneRedeliveryTracker.java
1 parent 689e5d7 commit 586f61d

File tree

1 file changed

+20
-1
lines changed

1 file changed

+20
-1
lines changed

example-java/src/main/java/com/softwaremill/kmq/example/standalone/StandaloneRedeliveryTracker.java

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,15 @@
22

33
import com.softwaremill.kmq.RedeliveryTracker;
44
import com.softwaremill.kmq.example.UncaughtExceptionHandling;
5+
import org.apache.kafka.clients.CommonClientConfigs;
6+
import org.apache.kafka.common.config.SslConfigs;
57
import org.slf4j.Logger;
68
import org.slf4j.LoggerFactory;
79

810
import java.io.Closeable;
911
import java.io.IOException;
12+
import java.util.HashMap;
13+
import java.util.Map;
1014

1115
import static com.softwaremill.kmq.example.standalone.StandaloneConfig.*;
1216

@@ -15,6 +19,21 @@ class StandaloneRedeliveryTracker {
1519

1620
public static void main(String[] args) throws InterruptedException, IOException {
1721
UncaughtExceptionHandling.setup();
22+
23+
/* EXAMPLE with extraConfig : SSL Encryption & SSL Authentication
24+
Map extraConfig = new HashMap();
25+
//configure the following three settings for SSL Encryption
26+
extraConfig.put(CommonClientConfigs.SECURITY_PROTOCOL_CONFIG, "SSL");
27+
extraConfig.put(SslConfigs.SSL_TRUSTSTORE_LOCATION_CONFIG, "/directory/kafka.client.truststore.jks");
28+
extraConfig.put(SslConfigs.SSL_TRUSTSTORE_PASSWORD_CONFIG, "test1234");
29+
30+
// configure the following three settings for SSL Authentication
31+
extraConfig.put(SslConfigs.SSL_KEYSTORE_LOCATION_CONFIG, "/directory/kafka.client.keystore.jks");
32+
extraConfig.put(SslConfigs.SSL_KEYSTORE_PASSWORD_CONFIG, "test1234");
33+
extraConfig.put(SslConfigs.SSL_KEY_PASSWORD_CONFIG, "test1234");
34+
35+
Closeable redelivery = RedeliveryTracker.start(KAFKA_CLIENTS, KMQ_CONFIG, scala.Option.apply(extraConfig));
36+
*/
1837

1938
Closeable redelivery = RedeliveryTracker.start(KAFKA_CLIENTS, KMQ_CONFIG);
2039
LOG.info("Redelivery tracker started");
@@ -24,4 +43,4 @@ public static void main(String[] args) throws InterruptedException, IOException
2443
redelivery.close();
2544
LOG.info("Redelivery tracker stopped");
2645
}
27-
}
46+
}

0 commit comments

Comments
 (0)