fix(nats): derive CloudEvents subject from metadata instead of hardcoded TODO#6269
Open
TRIVENI206 wants to merge 1 commit intomindersec:mainfrom
Open
fix(nats): derive CloudEvents subject from metadata instead of hardcoded TODO#6269TRIVENI206 wants to merge 1 commit intomindersec:mainfrom
TRIVENI206 wants to merge 1 commit intomindersec:mainfrom
Conversation
…ded TODO Signed-off-by: TRIVENI206 <trivenireddy206@gmail.com>
Member
|
This seems to be conflicting with the work discussed in #6251 (and runs into the same question as to whether we can get by with simply |
Author
|
Thanks for the feedback! I based the implementation on multiple metadata fields for broader compatibility, but I see the point about standardizing on entity_id. Would you prefer simplifying this to use only entity_id (with a fallback if missing), or keeping the current priority-based approach? Happy to update the PR accordingly. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
…ded TODO
Summary
This PR replaces the hardcoded CloudEvents subject ("TODO") in the NATS eventing driver with a dynamically derived value from message metadata.
The subject is now determined using the following priority:
If none of these values are present, a fallback value ("minder") is used.
This improves event filtering in NATS JetStream and aligns with the CloudEvents specification, while keeping the change minimal and avoiding unrelated refactoring for easier review.
Fixes #6250
Testing
Built the NATS module using:
go build ./internal/events/nats/...
Ran tests for the NATS module:
go test ./internal/events/nats/...
Verified that: