Skip to content

feat(event_sources): support for custom properties in ActiveMQEvent #1999

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

Merged
merged 2 commits into from
Mar 17, 2023

Conversation

alexaiss
Copy link
Contributor

Summary

Changes

Adds custom properties to ActiveMQ event after Lambda Event Source Mappings added the support

User experience

Users will now be able to interpret custom properties at runtime for their ActiveMQ messages delivered via Lambda Event Source Mappings.

Checklist

If your change doesn't seem to apply, please leave them unchecked.

Is this a breaking change?

RFC issue number:

Checklist:

  • Migration process documented
  • Implement warnings (if it can live side by side)

Acknowledgment

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

Disclaimer: We value your time and bandwidth. As such, any pull requests created on non-triaged issues might not be successful.

@alexaiss alexaiss requested a review from a team as a code owner March 11, 2023 08:44
@alexaiss alexaiss requested review from rubenfonseca and removed request for a team March 11, 2023 08:44
@boring-cyborg boring-cyborg bot added the tests label Mar 11, 2023
@pull-request-size pull-request-size bot added the size/S Denotes a PR that changes 10-29 lines, ignoring generated files. label Mar 11, 2023
@boring-cyborg
Copy link

boring-cyborg bot commented Mar 11, 2023

Thanks a lot for your first contribution! Please check out our contributing guidelines and don't hesitate to ask whatever you need.
In the meantime, check out the #python channel on our AWS Lambda Powertools Discord: Invite link

@github-actions github-actions bot added the feature New feature or functionality label Mar 11, 2023
@github-actions
Copy link
Contributor

No related issues found. Please ensure there is an open issue related to this change to avoid significant delays or closure.

@github-actions github-actions bot added do-not-merge need-issue PRs that are missing related issues labels Mar 11, 2023
@rubenfonseca
Copy link
Contributor

Hi @alexaiss thank you for your PR!

In order for us to handle it, you'll need to create an issue first. Please check the CONTRIBUTING guide for more details.

Can you please create an issue about this feature?

@heitorlessa heitorlessa linked an issue Mar 16, 2023 that may be closed by this pull request
2 tasks
@heitorlessa heitorlessa self-requested a review March 16, 2023 11:38
@heitorlessa
Copy link
Contributor

heitorlessa commented Mar 16, 2023

I created an issue #2018 but I couldn't trace the origin though - when custom properties were added, or was it always there and we missed it?

Went down the rabbit hole reading every release note until November 2022 and couldn't find it either. However, Lambda MQ docs do have the properties key, Lambda Java Events merged @alexaiss PR too so they must be familiar, so going ahead with this PR.

@heitorlessa heitorlessa changed the title feat: Adds custom properties to ActiveMQ event feat(event_sources): support for custom properties to ActiveMQ event Mar 16, 2023
@heitorlessa heitorlessa changed the title feat(event_sources): support for custom properties to ActiveMQ event feat(event_sources): support for custom properties in ActiveMQEvent Mar 16, 2023
@heitorlessa heitorlessa removed do-not-merge need-issue PRs that are missing related issues labels Mar 16, 2023
@heitorlessa
Copy link
Contributor

We don't have permissions to push to your fork, so please apply this patch so tests can pass and we can merge. We'll make a release tomorrow, hopefully this can be fixed earlier to be included.

Thank you!


From ee9343e814853d41b5f66057575946a221052cff Mon Sep 17 00:00:00 2001
From: heitorlessa <[email protected]>
Date: Thu, 16 Mar 2023 12:47:29 +0100
Subject: [PATCH] fix(tests): add custom properties

---
 tests/events/activeMQEvent.json | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/tests/events/activeMQEvent.json b/tests/events/activeMQEvent.json
index 57d206ba..6bcae212 100644
--- a/tests/events/activeMQEvent.json
+++ b/tests/events/activeMQEvent.json
@@ -13,7 +13,10 @@
       },
       "timestamp": 1598827811958,
       "brokerInTime": 1598827811958,
-      "brokerOutTime": 1598827811959
+      "brokerOutTime": 1598827811959,
+      "properties": {
+        "testKey": "testValue"
+      }
     },
     {
       "messageID": "ID:b-9bcfa592-423a-4942-879d-eb284b418fc8-1.mq.us-west-2.amazonaws.com-37557-1234520418293-4:1:1:1:1",
@@ -30,7 +33,6 @@
       "properties": {
         "testKey": "testValue"
       }
-
     },
     {
       "messageID": "ID:b-9bcfa592-423a-4942-879d-eb284b418fc8-1.mq.us-west-2.amazonaws.com-37557-1234520418293-4:1:1:1:1",
@@ -49,4 +51,4 @@
       }
     }
   ]
-}
+}
\ No newline at end of file
-- 
2.37.1 (Apple Git-137.1)

@alexaiss
Copy link
Contributor Author

Hi Heitor and Ruben,

Thanks for the comments. Apologies for missing creating an issue, thanks for doing that for me! And thanks for finding the bug, not sure how I missed that but it is fixed now to my knowledge.

I'm from one of the Lambda teams that maintains ActiveMQ Lambda integration, we recently added this as a minor improvement, not a feature launch. Thanks!

@codecov-commenter
Copy link

codecov-commenter commented Mar 17, 2023

Codecov Report

Patch coverage: 100.00% and project coverage change: +0.01 🎉

Comparison is base (21a7400) 97.44% compared to head (d25a3ba) 97.45%.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #1999      +/-   ##
===========================================
+ Coverage    97.44%   97.45%   +0.01%     
===========================================
  Files          146      146              
  Lines         6660     6688      +28     
  Branches       478      478              
===========================================
+ Hits          6490     6518      +28     
  Misses         134      134              
  Partials        36       36              
Impacted Files Coverage Δ
...wertools/utilities/data_classes/active_mq_event.py 100.00% <100.00%> (ø)

... and 4 files with indirect coverage changes

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@rubenfonseca
Copy link
Contributor

Looking at this now

Copy link
Contributor

@rubenfonseca rubenfonseca left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the background, and for submitting this fix! Looking forward to release this later today.

@rubenfonseca rubenfonseca merged commit 210ded1 into aws-powertools:develop Mar 17, 2023
@boring-cyborg
Copy link

boring-cyborg bot commented Mar 17, 2023

Awesome work, congrats on your first merged pull request and thank you for helping improve everyone's experience!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or functionality size/S Denotes a PR that changes 10-29 lines, ignoring generated files. tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Feature request: Custom Properties support in ActiveMQ Event Source Data Class
4 participants