-
Notifications
You must be signed in to change notification settings - Fork 865
Cannot Parse SNS Message from FIFO SNS -> FIFO SQS #3000
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Hi @marclyo, Good morning. Thanks for reporting the issue. Could you please share sample code to reproduce the issue? Are you using Amazon.SimpleNotificationService.Util.Message.ParseMessage() to parse the message? I'm getting For enabling SignatureVersion, I used AWS CLI to set this attribute (refer Verifying the signatures of Amazon SNS messages). Looks like the Thanks, |
This issue has not received a response in 5 days. If you want to keep this issue open, please just leave a comment below and auto-close will be canceled. |
Sure, I can provide some sample code to reproduce the issue. Please use this CloudFormation template to create the FIFO SNS -> FIFO SQS Resources:
Create the CloudFormtation stack: After the stack has been created then Publish a sample message to the FIFO SNS Topic:
The message will now be available in the FIFO SQS Queue (as it is subscribed to the FIFO SNS Topic) Then, using the aws-sdk-net: Receive the file from SQS Queue using
Parse the message, using Amazon.SimpleNotificationService.Util.Message.ParseMessage()
You should receive this error
This is because the SNS Message has a body like this:
I.e. it doesn't have a |
May be FIFO queue has a different message format. Needs investigation. |
After setting up SQS FIFO queue using customer's CloudFormation template, we receive message with the following JSON body: {
"Type" : "Notification",
"MessageId" : "06192b98-eaa2-56d5-acb8-76c513edd03e",
"SequenceNumber" : "10000000000000003000",
"TopicArn" : "arn:aws:sns:us-east-2:<<REDACTED>>:test-fifo-subscription-SnsTopic-v5q7qbvXDlBy.fifo",
"Message" : "test message",
"Timestamp" : "2023-08-21T23:45:19.931Z",
"UnsubscribeURL" : "https://sns.us-east-2.amazonaws.com/?Action=Unsubscribe&SubscriptionArn=arn:aws:sns:us-east-2:<<REDACTED>>:test-fifo-subscription-SnsTopic-v5q7qbvXDlBy.fifo:590f8d18-c48e-4c32-8355-40f262eaddef"
} Executing
Also notice that some fields in FIFO SNS message are different from ones bing parsed in Amazon.SimpleNotificationService.Util.Message.ParseMessage(). |
Looks like these fields are not available for SNS FIFO
Also, found this commit in one of the other projects where these fields were made optional. aws-powertools/powertools-lambda-python#1606 |
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:
ParseMessage()
as the message payload looks like this:
i.e The
SigningCertURL
entry is missingWhen the non-FIFO Topic and Queue are used the
ParseMessage()
is successful.ParseMessage()
as the message payload looks like this (i.e includes
SigningCertURL
):Expected Behavior
The message is parsed successfully.
Current Behavior
This error is received:
Value cannot be null. (Parameter 'uriString'): ArgumentNullException
Reproduction Steps
Set up:
Steps to reproduce:
AmazonSQSClient.ReceiveMessage()
Message.ParseMessag()
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
The text was updated successfully, but these errors were encountered: