【问题标题】:MessageId missing in SNS notification from localstack来自 localstack 的 SNS 通知中缺少 MessageId
【发布时间】:2018-07-19 19:08:39
【问题描述】:

对于使用 AWS 服务进行本地开发,我使用的是 localstack。现在我想使用 SNS,当我发布消息时,订阅者没有收到“元数据”(如 MessageId、TopicArn、时间戳)

我已经采取了接下来的步骤:

  1. 启动 docker 容器:

    docker run --net=host -it -p 4567-4578:4567-4578 -p 8080:8080 atlassianlabs/localstack
    
  2. 创建了一个 SNS 主题:

    aws --endpoint-url=http://localhost:4575 sns create-topic --name test-topic
    
  3. 订阅主题:

    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
    
  4. 最后,我发布了一条消息:

    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"}

我做错了什么?以及如何确保消息确实获得了这些信息?

【问题讨论】:

  • 你解决过这个问题吗?
  • 嗨 Adam,不,我还没有解决它,但 Ignas 注意到它在提出 GitHub 问题后已得到修复。

标签: amazon-web-services amazon-sns localstack


【解决方案1】:

我遇到了类似的问题,但在提出 GitHub issue 后已解决。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2018-12-21
    • 1970-01-01
    • 2015-07-17
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2020-08-14
    • 2021-05-26
    相关资源
    最近更新 更多