AWS DynamoDB不使用规则引擎插入所有物联网核心

发布于 2025-02-01 15:05:29 字数 617 浏览 4 评论 0原文

因此,我使用AWS IoT Core,AWS规则引擎和AWS DynamoDB创建的IoT解决方案有问题。

解决方案看起来如下:MQTT消息已发布到主题“主题/+/数据”的主题 “+”是发布消息的内容。有一个规则拦截这些消息 并且应该将发布的消息作为DynamoDB表中的记录保存。问题是 并非所有消息都在数据库中持续存在。 DynamoDB表容量模式设置为“按需”。

可能出现问题的可能发生的事情:

  1. 都发布给主题流。
  2. 所有
  3. 消息

并非 duleexcution“与发布的消息相对应的事件,如果发布了600个消息,则 然后发生了600个成功的“ Rulexecution”事件。还测试了500条发布的消息。消息源自Apache Jmeter的负载测试,其中模拟的不同数量的设备每秒都会发布消息。设备的数量在10到100之间,跑步30秒至15分钟。所有测试均导致大部分(最多30%) 即使CloudWatch声称它们是成功的插入,但未插入DynamoDB表中的消息。

以某种方式DynamoDB并未插入所有截获的消息,即使规则 CloudWatch确认所有“ ruleexecution”事件都是成功的。 CloudWatch也不会显示任何失败的事件。

这样做的原因是什么?

So I have a problem with an IoT solution I have created using AWS IoT Core, AWS Rules Engine and AWS DynamoDB.

The solution looks like the following: MQTT messages are published to a topic "topic/+/data" where
the "+" is the thing that is publishing a message. There is a rule that intercepts these messages
and is supposed to save the published message as a record in a DynamoDB table. The problem is that
not all messages are persisted in the database. The DynamoDB tables capacity mode is set to be "On-demand".

Possible things that can have gone wrong:

  1. Not all messages are published to the topic stream
  2. The rule doesn't catch all messages
  3. DynamoDB isn't persisting all messages as it should

1 and 2 can be eliminated since AWS Cloudwatch IoT logs only shows successful "RuleExecution" events that correspond to the amount of messages published i.e if there was 600 messages published
then there was 600 successful "RuleExecution" events. This was also tested for 500 messages published. The messages originated from a load test by Apache JMeter where different numbers of devices where simulated to post a message each second. The number of devices ranged from 10 to 100 and ran between 30 seconds and 15 minutes. All tests resulted in a large percentage, up to 30%, of
messages that were not inserted in to the DynamoDB table even though Cloudwatch claims that they were successful insertions.

Somehow DynamoDB doesn't insert all the messages that are intercepted byt the rule even though
Cloudwatch confirms that all the "RuleExecution" events are successful. Cloudwatch does not present any failed events either.

What could be the reason for this?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

空心空情空意 2025-02-08 15:05:29

主要关键的碰撞是问题。通过将timestamp()用作主键,而traceid()作为排序键,一切都按预期工作。我现在可以在表中看到几个条目具有相同的时间戳。

要明确:用于将消息插入DynamoDB的规则(裁剪出IAM角色):

Collisions of the primary key were the problem. By using the timestamp() as the primary key and the traceid() as the sort key, everything works as intended. I can see now in the table that several entries have the same timestamp.

To be clear: The rule used to insert messages in to DynamoDB (The IAM role is cropped out):

Image

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文