awslabs/aws-dotnet-messaging

EventBridge -> SQS. Failed to create a MessageEnvelop

careri opened this issue · 2 comments

careri commented

Hi,

I've got a simple setup where I publish an event to EventBridge.
A simple rule that matces a source and forwards to a SQS.

I'm running commit #96
OS: Windows 11

Publishing works as expected. Consuming fails, since the detail of the EventBridge envelope is an object and not a string:

Category: AWS.Messaging.Serialization.EnvelopeSerializer
Message: Failed to create a MessageEnvelope
Exception: System.InvalidOperationException: The requested operation requires an element of type \u0027String\u0027, but the target element has type \u0027Object\u0027.
   at System.Text.Json.ThrowHelper.ThrowJsonElementWrongTypeException(JsonTokenType expectedType, JsonTokenType actualType)
   at System.Text.Json.JsonDocument.GetString(Int32 index, JsonTokenType expectedType)
   at AWS.Messaging.Serialization.EnvelopeSerializer.GetMessageEnvelopeConfiguration(Message sqsMessage)
   at AWS.Messaging.Serialization.EnvelopeSerializer.ConvertToEnvelopeAsync(Message sqsMessage)

I've fixed the failing line. Will create a pull request.

careri commented

PR:
#98