Skip to content

Cannot consume messages if they are not published using this library #141

Open
@zRosenthal

Description

@zRosenthal

Describe the bug

Love the idea of this library as it drastically simplifies consuming from SQS. However in testing I am unable to get it to work unless the messages are published using this library.
This makes this library unusable in most enterprise environments where we consume events from a wide variety of sources many of which are not directly controlled by the team/app that is publishing those events.

Expected Behavior

Able to consume any json message

Current Behavior

Quick test routing events from AWS EventBridge

fail: AWS.Messaging.Serialization.EnvelopeSerializer[0]
MessageEnvelope instance is not valid
Id cannot be null or empty.
Source cannot be null.
Version cannot be null or empty.
MessageTypeIdentifier cannot be null or empty.
TimeStamp is not set.Message cannot be null.

Whats interesting about this is that the message from EventBridge actually does include Id, Source, Version however my understanding is that because that data is not contained in the detail node it is ignored.

Reproduction Steps

Publish a generic json object to an SQS queue without utilizing this library.

Possible Solution

Why are all of these fields required? Do we truly need them or can they be optional?

Can we allow custom mappers for the fields that are absolutely required? Could even ship with a prebuilt EventBridge mapper to utilize the existing properties in event.

Additional Information/Context

No response

AWS.Messaging (or related) package versions

AWS.Messaging 0.9.1

Targeted .NET Platform

.NET 8

Operating System and version

OSX Sonoma 14.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingp2This is a standard priority issuequeued

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions