avoiding fixed persistenceId on example (#30203)
This commit is contained in:
parent
5de4942485
commit
4f5e01376d
2 changed files with 4 additions and 4 deletions
|
|
@ -46,8 +46,8 @@ public class BasicPersistentBehaviorTest {
|
|||
|
||||
public static class State {}
|
||||
|
||||
public static Behavior<Command> create() {
|
||||
return new MyPersistentBehavior(PersistenceId.ofUniqueId("pid"));
|
||||
public static Behavior<Command> create(PersistenceId persistenceId) {
|
||||
return new MyPersistentBehavior(persistenceId);
|
||||
}
|
||||
|
||||
private MyPersistentBehavior(PersistenceId persistenceId) {
|
||||
|
|
|
|||
|
|
@ -108,10 +108,10 @@ object BasicPersistentBehaviorCompileOnly {
|
|||
import MyPersistentBehavior._
|
||||
|
||||
object RecoveryBehavior {
|
||||
def apply(): Behavior[Command] =
|
||||
def apply(persistenceId: PersistenceId): Behavior[Command] =
|
||||
//#recovery
|
||||
EventSourcedBehavior[Command, Event, State](
|
||||
persistenceId = PersistenceId.ofUniqueId("abc"),
|
||||
persistenceId = persistenceId,
|
||||
emptyState = State(),
|
||||
commandHandler = (state, cmd) => throw new NotImplementedError("TODO: process the command & return an Effect"),
|
||||
eventHandler = (state, evt) => throw new NotImplementedError("TODO: process the event return the next state"))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue