amazon-web-services - 来自 localstack 的 SNS 通知中缺少 MessageId
问题描述
对于使用 AWS 服务进行本地开发,我使用的是localstack。现在我想使用 SNS,当我发布消息时,订阅者没有收到“元数据”(如 MessageId、TopicArn、Timestamp)
我已经采取了以下步骤:
启动 docker 容器:
docker run --net=host -it -p 4567-4578:4567-4578 -p 8080:8080 atlassianlabs/localstack
创建了一个 SNS 主题:
aws --endpoint-url=http://localhost:4575 sns create-topic --name test-topic
订阅主题:
aws --endpoint-url=http://localhost:4575 sns subscribe --topic-arn arn:aws:sns:eu-west-1:123456789012:test-topic --protocol http --notification-endpoint http://localhost.dev.local/path
最后,我发布了一条消息:
aws --endpoint-url=http://localhost:4575 sns publish --topic-arn arn:aws:sns:eu-west-1:123456789012:test-topic --message "the message"
订阅者成功收到消息,但缺少“messageId”、“Timestamp”和“TopicArn”:
实际结果:
{"Message": "the message", "Type": "Notification"}
预期结果:
{"TopicArn": "arn:aws:sns:eu-central-1:123456789012:test-topic", "MessageId": "af3a73ef-b0b2-4f78-acb1-1dee52d002d2", "Message": "the message", "Type": "Notification" "Timestamp" : "2018-07-19T16:04:28.857Z"}
我究竟做错了什么?以及如何确保消息确实获得了这些信息?
解决方案
我有一个类似的问题,但是在提出 GitHub问题后它得到了修复。
推荐阅读
- curl - cURL 无法获得最终 url
- react-native - React Native Navigation 5 在每个堆栈中结合堆栈和选项卡导航器可见性
- sql-server - SELECT 语句可以同时返回数据和 INSERT 到另一个 SQL 表吗?
- ajax - 在 ajax 调用中发送的数据
- javascript - 我们如何使用 d3 将 CSV 文件加载到 JupyterLab 中?
- javascript - 处理承诺异常的问题
- c# - 如何使用 ASP.NET MVC 在配置文件中显示当前登录用户详细信息
- python - 将文本文件中的单词与 Python 字典匹配
- reactjs - Plotly JS 渲染 150k 点
- r - 带有 ifelse 和 apply 的二元运算符的非数字参数