信任库和Google Cloud Dataflow [英] Truststore and Google Cloud Dataflow
问题描述
我需要使用信任存储在Google Cloud Dataflow中建立SSL Kafka连接.我可以从存储桶中提供它,还是可以将其存储在本地文件系统"中?
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 system"?
推荐答案
您可以使用 GcsUtil )并将其保存到本地磁盘上的临时文件-AFAIK Kafka本身仅支持将此文件放在本地磁盘上.然后手动创建KafkaConsumer
并将其指向文件.
You can use KafkaIO.Read.withConsumerFactoryFn to supply a factory function that will be invoked to create the Kafka consumer. In that function, you're free to do anything you like, e.g. you can download the trust store file from a GCS bucket (I would recommend using GcsUtil for that) and save it to a temporary file on local disk - AFAIK Kafka itself only supports having this file on local disk. Then manually create a KafkaConsumer
and point it at the file.
这篇关于信任库和Google Cloud Dataflow的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!