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/10/23 00:42:29 UTC
[PR] feat: add with-methods to typed query EventEnvelope [pekko]
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: 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] feat: add with-methods to typed query EventEnvelope [pekko]
Posted by "He-Pin (via GitHub)" <gi...@apache.org>.
He-Pin merged PR #3646:
URL: https://github.com/apache/pekko/pull/3646
--
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