pjfanning opened a new pull request, #3646: URL: https://github.com/apache/pekko/pull/3646
### Motivation The typed persistence query `EventEnvelope` is a final class with a long constructor and no copy support. Changing one field (for example the event payload or the tags when transforming envelopes) means rebuilding the whole envelope by hand. ### Modification Add `withPersistenceId(persistenceId, entityType, slice)`, `withEvent`, `withEventOption`, `withTags` and `withMetadata` (`withEventOption` and `withTags` each have Scala and Java overloads) to `org.apache.pekko.persistence.query.typed.EventEnvelope`, backed by a private `copy` helper. `withPersistenceId` takes `entityType` and `slice` explicitly, because both are derived from the persistence id. ### Result Envelopes can be changed with additive, binary compatible methods. ### Tests - Not run locally - left to CI - New case in `EventEnvelopeSpec` ### References Ported from (Apache-2.0 since 2026-10-23): - https://github.com/akka/akka-core/pull/32067 ### Notes for reviewers - Only additive methods on a final class (plus a private helper), so no MiMa excludes are needed. - `withTags` has Scala `Set` and Java `java.util.Set` overloads; `withEventOption` has Scala `Option` and Java `java.util.Optional` overloads. - `EventEnvelope` is `@ApiMayChange`. -- 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: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
