You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@pekko.apache.org by "pjfanning (via GitHub)" <gi...@apache.org> on 2026/09/24 07:15:02 UTC

[PR] Apply entity type check and producer filter to replay and loadEvent [pekko-projection]

pjfanning opened a new pull request, #633:
URL: https://github.com/apache/pekko-projection/pull/633

   ### Motivation
   Replayed events requested with a `ReplayReq` were not checked against the entity type of the stream, unlike `loadEvent`, `eventTimestamp` and replay triggered by `IncludeEntityIds` (which always maps entity ids with the stream's entity type).
   
   Replayed events and events returned by `loadEvent` also did not go through the producer filter, although the producer filter is documented to have priority over consumer defined filters.
   
   ### Modification
   - `FilterStage` ignores replay of persistence ids that don't belong to the entity type of the stream.
   - `FilterStage` applies the producer filter to replayed events. The consumer filter is still not applied to replays, as before. Events excluded by the producer filter are emitted without payload, as `FilteredEvent`, so that the consumer doesn't see a gap in sequence numbers (which would otherwise trigger another replay).
   - `loadEvent` returns `FilteredEvent` for events excluded by the producer filter.
   - Envelopes marked as `filtered` are emitted as `FilteredEvent` instead of as an `Event` without payload.
   
   ### Result
   Replay and `loadEvent` are consistent with the entity type of the stream and with the producer filter.
   
   ### Tests
   - `sbt grpc-test/test` - 75 passed
   - New `FilterStageSpec` and `EventProducerServiceSpec` tests fail without the main code change
   - `sbt grpc/Compile/scalafmtCheck grpc-test/Test/scalafmtCheck` - passed
   - `sbt grpc/headerCheckAll grpc-test/Test/headerCheckAll` - passed
   - MiMa not run - no `mimaReportBinaryIssues` task for the grpc module; only change is to internal API
   - `sortImports` not run - task not available in this build
   - `grpc-int-test` not run locally - requires database, left to CI
   
   ### References
   None - consistency fix for gRPC producer replay
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@pekko.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@pekko.apache.org
For additional commands, e-mail: notifications-help@pekko.apache.org


Re: [PR] Only replay events of the stream's entity type [pekko-projection]

Posted by "pjfanning (via GitHub)" <gi...@apache.org>.
pjfanning merged PR #633:
URL: https://github.com/apache/pekko-projection/pull/633


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@pekko.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@pekko.apache.org
For additional commands, e-mail: notifications-help@pekko.apache.org