3

AWS サービスを使用したローカル開発には、localstackを使用しています。現在、SNS を操作したいのですが、メッセージを公開すると、サブスクライバーは「メタデータ」(MessageId、TopicArn、Timestamp など) を受信しません。

次の手順を実行しました。

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

私は何を間違っていますか?また、メッセージがこの情報を確実に取得するにはどうすればよいですか?

4

1 に答える 1