Skip to content

Add filtered and source fields to typed EventEnvelope#2807

Merged
He-Pin merged 1 commit intoapache:mainfrom
He-Pin:port-filtered-event-envelope
Mar 28, 2026
Merged

Add filtered and source fields to typed EventEnvelope#2807
He-Pin merged 1 commit intoapache:mainfrom
He-Pin:port-filtered-event-envelope

Conversation

@He-Pin
Copy link
Copy Markdown
Member

@He-Pin He-Pin commented Mar 28, 2026

Motivation

Typed EventEnvelope lacked metadata fields needed for advanced event processing -- specifically whether an event was filtered and what source produced it.

Modification

Added filtered (Boolean) and source (String) fields to typed EventEnvelope with backward-compatible defaults. Updated protobuf schema, serializer, and factory methods.

Result

Enables downstream processors to distinguish filtered events and trace event sources for debugging and routing.

References

Add 'filtered' (Boolean) and 'source' (String) fields to the typed
EventEnvelope class for supporting filtered event delivery and tracking
event sources (e.g. backtracking queries). These fields are needed by
Projections to handle filtered events and event source attribution.

Changes:
- EventEnvelope: Add filtered/source constructor params with backward-
  compatible auxiliary constructor defaulting to (false, "")
- EventEnvelope companion: Add new apply/create factory methods with
  filtered and source parameters
- EventEnvelope.equals: Include filtered field in equality check
- EventEnvelope.toString: Include filtered and source in output
- QueryMessages.proto: Add optional bool filtered = 10 and optional
  string source = 11 fields
- QuerySerializer: Serialize/deserialize the new fields
- QuerySerializerSpec: Add test for filtered and source round-trip
- Regenerate QueryMessages.java from updated proto definition

Upstream: akka/akka-core@c9e4fa6f9f
Cherry-picked from akka/akka-core v2.8.0, which is now Apache licensed.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@He-Pin He-Pin force-pushed the port-filtered-event-envelope branch from 70aaec8 to 2fa22d8 Compare March 28, 2026 06:49
@He-Pin He-Pin marked this pull request as ready for review March 28, 2026 07:20
@He-Pin He-Pin added this to the 2.0.0-M2 milestone Mar 28, 2026
Copy link
Copy Markdown
Member

@pjfanning pjfanning left a comment

Choose a reason for hiding this comment

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

lgtm

@He-Pin He-Pin merged commit 4c468a1 into apache:main Mar 28, 2026
9 checks passed
@He-Pin He-Pin deleted the port-filtered-event-envelope branch March 28, 2026 09:01
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.

2 participants