Skip to content

Cannot Parse SNS Message from FIFO SNS -> FIFO SQS #3000

Open
@marclyo

Description

@marclyo

Describe the bug

When attempting to parse a message with:
var snsMessage = AwsSnsMessage.ParseMessage(message.Body);
https://docs.aws.amazon.com/sdkfornet/latest/apidocs/items/MSNSUtilMessageParseMessageStringNET45.html

This error is received:
Value cannot be null. (Parameter 'uriString'): ArgumentNullException


This error only occurs when the message has come via FIFO SNS and FIFO SQS, like this:

  • Message publisher -> FIFO SNS Topic -> FIFO SQS Queue -> Message Consumer ParseMessage()

as the message payload looks like this:

{
    "Type": "Notification",
    "MessageId": "19848d6e-64b6-5fbb-906e-d588078ccac0",
    "TopicArn": "arn*****",
    "Subject": "Subject",
    "Message": "redacted to make it easier to read",
    "Timestamp": "2023-07-06T13:24:10.934Z",
    "UnsubscribeURL": "redacted to make it easier to read"
}

i.e The SigningCertURL entry is missing


When the non-FIFO Topic and Queue are used the ParseMessage() is successful.

  • Message publisher -> SNS -> SQS -> Message Consumer ParseMessage()

as the message payload looks like this (i.e includes SigningCertURL):

{
    "Type": "Notification",
    "MessageId": "19848d6e-64b6-5fbb-906e-d588078ccac0",
    "TopicArn": "arn*****",
    "Subject": "Subject",
    "Message": "redacted to make it easier to read",
    "Timestamp": "2023-07-06T13:24:10.934Z",
    "SignatureVersion": "1",
    "Signature": "redacted to make it easier to read",
    "SigningCertURL": "redacted to make it easier to read",
    "UnsubscribeURL": "redacted to make it easier to read"
}

Expected Behavior

The message is parsed successfully.

Current Behavior

This error is received:
Value cannot be null. (Parameter 'uriString'): ArgumentNullException

Reproduction Steps

Set up:

  • a FIFO SNS Topic
  • a FIFO SQS Queue
  • Subscribe the FIFO SQS to the FIFO SNS Topic (with raw_delivery=false)

Steps to reproduce:

Possible Solution

No response

Additional Information/Context

No response

AWS .NET SDK and/or Package version used

AWSSDK.SimpleNotificationService 3.7.3.76

Targeted .NET Platform

.NET 6

Operating System and version

Linux

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions