Review AkkaTaggerAdapter's API
See original GitHub issueWe have recently introduced the AkkaTaggerAdapter
, but we may need to reconsider if we should pass the EntityContext
or simply a String
.
The method that is defined as:
def fromLagom[Event <: AggregateEvent[Event]](
entityCtx: EntityContext,
lagomTagger: AggregateEventTagger[Event]
): Event => Set[String]
The main reason we chose to pass the EntityContext
is that we can then make sure that we will use EntityContext.entityId
when generating the virtual partition numbers.
However, that puts a constraint on how one can initialize the EventSourcedBehavior
and that has an impact on testing as it requires EntityContext
on tests.
We should reconsider this. Maybe the method signature should be:
def fromLagom[Event <: AggregateEvent[Event]](
entityId: String,
lagomTagger: AggregateEventTagger[Event]
): Event => Set[String]
Anyway, I just want to raise the flag, so we tackle that before we cut the first RC.
@ignasi35, since you have been experimenting with testing and Akka Persistence Typed, please dump here all your thoughts.
Issue Analytics
- State:
- Created 4 years ago
- Comments:6 (6 by maintainers)
Top GitHub Comments
We’ll need to address this later, quite probably on Akka’s side. For now we’ll keep
EntityContext
, which favours some more type-safety at the cost of some lack of ergonomics (having to usenull
for the sharing actor, in tests).We won’t need a private
EntityContext
, but we will need a privateentityId
. We will need to fill it at construction time using the passedEntityContext
. We can’t use thePersistenceId
because we will need to parse it.