I need to use a trust store to make an SSL Kafka connection in Google Cloud Dataflow. Can I supply this from a bucket or is there a way to store this on the \"local file sys
Thanks @jkff for the solution, here is an implementation example:
Sample ConsumerFactoryFn implementation:
private static class ConsumerFactoryFn
implements SerializableFunction
and do not forget to use .withConsumerFactoryFn in your KafkaIO.read() call, should be something like:
Map configMap = new HashMap();
configMap.put("security.protocol", (Object) "SSL");
configMap.put("ssl.truststore.password", (Object) "clientpass");
p.apply("ReadFromKafka", KafkaIO.read()
.withBootstrapServers("ip:9093")
.withTopic("pageviews")
.withKeyDeserializer(StringDeserializer.class)
.withValueDeserializer(StringDeserializer.class)
.updateConsumerProperties(configMap)
.withConsumerFactoryFn(new ConsumerFactoryFn()) ... etc.