运行 我的 Kinesis Producer 在哪里?
Where to run my Kinesis Producer?
我需要构建一个 Kinesis Producer 应用程序,它只需将数据放入 Kinesis Stream。该应用程序将需要连接到远程主机并维护一个 TCP 套接字,数据将从远程主机推送到该套接字。数据转换非常少,因此生产者应用程序将非常简单...我知道我可以为此设置一个 EC2 实例,但如果有更好的方法,我想探索一下。
示例:
- 您可以在 AWS Lambda 上构建生产者,但由于我必须维护一个长 运行 TCP 连接,所以这行不通。
- 您可以使用 AWS IoT 维护与 WebSocket 的连接并在每条消息上调用 Lambda 函数,但我的连接只是标准 TCP 连接
问题:我可以使用 AWS 产品套件中的哪些其他产品来构建生产者?
Producer 代码通常在 thing 上运行,这是您希望捕获的信息的来源。
例如:
- 捕获网络事件时,Producer 应该是监控流量的网络设备。
- 捕获零售购买时,生产者是处理交易的系统。
- 在捕获地震时,Producer 是监测振动的设备。
在您的情况下,远程主机 应该是生产者,它将数据发送到 Kinesis。与其让远程主机将数据推送到 Lambda 函数,不如让远程主机直接推送到 Kinesis。
更新
你提到 Kinesis Agent:
Kinesis Agent is a stand-alone Java software application that offers an easy way to collect and send data to Kinesis Firehose.
如果您正在使用 Amazon Kinesis Firehose,那么 Kinesis Agent 可以成为您的 Producer。它将数据发送到 Firehose。 或者,您可以编写自己的 Firehose Producer。
来自Writing to a Kinesis Firehose Delivery Stream Using the AWS SDK:
You can use the Kinesis Firehose API to send data to a Kinesis Firehose delivery stream using the AWS SDK for Java, .NET, Node.js, Python, or Ruby.
如果您正在使用 Amazon Kinesis Streams,您将需要编写自己的 Producer。来自 Producers for Amazon Kinesis Streams:
A producer puts data records into Kinesis streams. For example, a web server sending log data to an Kinesis stream is a producer
因此,Producer 只是适用于将数据 发送到 Kinesis 的术语,它由 消费者.
几个选项:
您或许可以将 IoT 与 kinesis action for your remote host to push into a kinesis stream. In this case your remote app would be a device that talks directly to the AWS IoT infrastructure. You'd then setup a rule to forward all of the messages to a kinesis stream for processing. See https://aws.amazon.com/iot-platform/how-it-works/ 一起使用。
这样做的一个好处是您不再需要在任何地方托管生产者应用程序。但是您需要能够在远程主机上修改应用 运行ning。
您不必使用 Kinesis Producer Library (KPL), your data source could simply make repeated calls to PutRecord or PutRecords。同样,这需要修改远程应用程序。
或者如您所知,您可以在 EC2 上 运行 您的 KPL 应用程序。通过网络与它交谈。这可能会让您更好地控制事物 运行 的方式,并且需要对远程应用程序进行更少的修改。但是您现在有更大的开发运营负担。
此处没有合适的托管选项。如果您的任务是...
- 发起并维护与您无法控制的第三方远程设备的持久 TCP 连接,
- 在有效载荷通过管道传输的任何地方消耗,
- process/transform它,并且
- 将其提供给充当 Kinesis 生产者的代码
...那么你需要一个服务器,因为没有一个服务可以完成所有这些事情。 EC2 就是您要找的产品。
我需要构建一个 Kinesis Producer 应用程序,它只需将数据放入 Kinesis Stream。该应用程序将需要连接到远程主机并维护一个 TCP 套接字,数据将从远程主机推送到该套接字。数据转换非常少,因此生产者应用程序将非常简单...我知道我可以为此设置一个 EC2 实例,但如果有更好的方法,我想探索一下。
示例:
- 您可以在 AWS Lambda 上构建生产者,但由于我必须维护一个长 运行 TCP 连接,所以这行不通。
- 您可以使用 AWS IoT 维护与 WebSocket 的连接并在每条消息上调用 Lambda 函数,但我的连接只是标准 TCP 连接
问题:我可以使用 AWS 产品套件中的哪些其他产品来构建生产者?
Producer 代码通常在 thing 上运行,这是您希望捕获的信息的来源。
例如:
- 捕获网络事件时,Producer 应该是监控流量的网络设备。
- 捕获零售购买时,生产者是处理交易的系统。
- 在捕获地震时,Producer 是监测振动的设备。
在您的情况下,远程主机 应该是生产者,它将数据发送到 Kinesis。与其让远程主机将数据推送到 Lambda 函数,不如让远程主机直接推送到 Kinesis。
更新
你提到 Kinesis Agent:
Kinesis Agent is a stand-alone Java software application that offers an easy way to collect and send data to Kinesis Firehose.
如果您正在使用 Amazon Kinesis Firehose,那么 Kinesis Agent 可以成为您的 Producer。它将数据发送到 Firehose。 或者,您可以编写自己的 Firehose Producer。
来自Writing to a Kinesis Firehose Delivery Stream Using the AWS SDK:
You can use the Kinesis Firehose API to send data to a Kinesis Firehose delivery stream using the AWS SDK for Java, .NET, Node.js, Python, or Ruby.
如果您正在使用 Amazon Kinesis Streams,您将需要编写自己的 Producer。来自 Producers for Amazon Kinesis Streams:
A producer puts data records into Kinesis streams. For example, a web server sending log data to an Kinesis stream is a producer
因此,Producer 只是适用于将数据 发送到 Kinesis 的术语,它由 消费者.
几个选项:
您或许可以将 IoT 与 kinesis action for your remote host to push into a kinesis stream. In this case your remote app would be a device that talks directly to the AWS IoT infrastructure. You'd then setup a rule to forward all of the messages to a kinesis stream for processing. See https://aws.amazon.com/iot-platform/how-it-works/ 一起使用。
这样做的一个好处是您不再需要在任何地方托管生产者应用程序。但是您需要能够在远程主机上修改应用 运行ning。
您不必使用 Kinesis Producer Library (KPL), your data source could simply make repeated calls to PutRecord or PutRecords。同样,这需要修改远程应用程序。
或者如您所知,您可以在 EC2 上 运行 您的 KPL 应用程序。通过网络与它交谈。这可能会让您更好地控制事物 运行 的方式,并且需要对远程应用程序进行更少的修改。但是您现在有更大的开发运营负担。
此处没有合适的托管选项。如果您的任务是...
- 发起并维护与您无法控制的第三方远程设备的持久 TCP 连接,
- 在有效载荷通过管道传输的任何地方消耗,
- process/transform它,并且
- 将其提供给充当 Kinesis 生产者的代码
...那么你需要一个服务器,因为没有一个服务可以完成所有这些事情。 EC2 就是您要找的产品。