-
Notifications
You must be signed in to change notification settings - Fork 17
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
System.FormatException when MessageAttributes contains type number #1556
Comments
From
We need to add support for JustSaying/src/JustSaying/Messaging/MessageSerialization/NewtonsoftSerializer.cs Lines 64 to 78 in 56b8877
JustSaying/src/JustSaying/Messaging/MessageSerialization/SystemTextJsonSerializer.cs Lines 71 to 81 in 56b8877
|
Handle message attributes of type `Number` or with a custom suffix label. Resolves #1556.
Handle message attributes of type `Number` or with a custom suffix label. Resolves #1556.
Describe the bug
When an SQS message contains MessageAttributes with Type Number, an exception of type System.FormatException is thrown when the message is picked up from the queue.
Steps To reproduce
Send an SQS message coining the following MessageAttributes:
"MessageAttributes" : {
"TotalValue" : {"Type":"Number","Value":"100"}
}
Expected behaviour
Message should be picked up with no exception.
Actual behaviour
The following exception is thrown:
System.FormatException: The input is not a valid Base-64 string as it contains a non-base 64 character, more than two padding characters, or an illegal character among the padding characters.
at JustSaying.Messaging.MessageSerialization.NewtonsoftSerializer.GetMessageAttributes(String message) in //src/JustSaying/Messaging/MessageSerialization/NewtonsoftSerializer.cs:line 54
at JustSaying.Messaging.MessageSerialization.MessageSerializationRegister.DeserializeMessage(String body) in //src/JustSaying/Messaging/MessageSerialization/MessageSerializationRegister.cs:line 45
at JustSaying.AwsTools.MessageHandling.Dispatch.MessageDispatcher.DeserializeMessage(IQueueMessageContext messageContext, CancellationToken cancellationToken) in /_/src/JustSaying/AwsTools/MessageHandling/Dispatch/MessageDispatcher.cs:line 79
System information:
Additional context
Both SystemTextJsonSerializer and NewtonsoftSerializer implementation of GetMessageAttributes() handle only String data types. Everything else is considered Binary. But AWS documentation specifies that Message Attributes can have 4 data types: string, number, binary and custom which should be handled.
The text was updated successfully, but these errors were encountered: