简体   繁体   English

带有 Protobuf 数据的 Amazon Kinesis Firehose 到 S3

[英]Amazon Kinesis Firehose to S3 with Protobuf data

Has anyone tried pushing Google Protobuf (PB) data through Kinesis Firehose for storage to S3.有没有人尝试通过 Kinesis Firehose 将Google Protobuf (PB) 数据推送到 S3 进行存储。 I ask this question because Protobuf is (usually) a binary format, and I recall (perhaps incorrectly) that Firehose runs all data through a base64 conversion before writing.我问这个问题是因为 Protobuf(通常)是一种二进制格式,我记得(可能是错误的)Firehose 在写入之前通过 base64 转换运行所有数据。 I will need to read the PB data later for processing and want to know if I would need to de-base64 it before usage, or will I have access to raw PB data straight off S3.我将需要稍后读取 PB 数据进行处理,并想知道我是否需要在使用前对其进行 de-base64,或者我是否可以直接从 S3 访问原始 PB 数据。 Thanks.谢谢。

You could use a Lambda to write the binary data directly to S3.您可以使用 Lambda 将二进制数据直接写入 S3。 You would need to be able to pull the file from your source from the lambda though, since I believe API Gateway will Base64-encode binary payloads.不过,您需要能够从 lambda 的源中提取文件,因为我相信 API Gateway 将对二进制有效负载进行 Base64 编码。

You can pass binary data to Kineses Firehose, and Kinesis will base64 encode the data before sending to another AWS Service.您可以将二进制数据传递给 Kinesis Firehose,Kinesis 会对数据进行 base64 编码,然后再发送到另一个 AWS 服务。 Look at the setData() function in the Java documents:查看Java文档中的setData()函数:

Kinesis Firehose Record Kinesis Firehose 记录

You would then need to decode the data for further processing after reading from S3 for example.例如,您需要在从 S3 读取数据后对数据进行解码以进行进一步处理。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM