Skip to content
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

fix: Correctly deserialize outer envelope when processing messages relayed through EventBridge #114

Merged
merged 2 commits into from
Mar 26, 2024

Conversation

96malhar
Copy link
Contributor

@96malhar 96malhar commented Mar 25, 2024

Issue

Description of changes:
This is a sample SQS message when messages are forwarded by EventBridge

{
  "version": "0",
  "id": "961ac8a3-a4ee-0e17-d8d9-36c81ae29955",
  "detail-type": "AWS.Messaging.IntegrationTests.Models.ChatMessage",
  "source": "/aws/messaging",
  "account": "000000000",
  "time": "2024-03-25T20:39:11Z",
  "region": "us-west-2",
  "resources": [],
  "detail": {
    "id": "526d5466-5f51-42ce-a64b-8a220a7f1b71",
    "source": "/aws/messaging",
    "specversion": "1.0",
    "type": "AWS.Messaging.IntegrationTests.Models.ChatMessage",
    "time": "2024-03-25T20:39:10.8491344+00:00",
    "data": "{\"MessageDescription\":\"Test1\"}"
  }
}

The detail property is sent as a JSON object and not as a string. Invoking JsonElement.GetString on this node throws an InvalidOperationException.

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@96malhar 96malhar requested a review from normj March 25, 2024 23:37
@96malhar 96malhar merged commit b0391cc into dev Mar 26, 2024
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants