Page History
...
Expand | ||
---|---|---|
| ||
[DEBUG][2017-09-24 오후 1:59:13][Thread 0009][EventStream(ServiceA)] Logger log1-DefaultLogger [DefaultLogger] started |
주요 체크 Point
- 메시지 설계는 명령(cmd)와 발생하는 이벤트(evt) 를 분리하여 설계합니다.
UntypedPersistentActor 를 상속받아서 자신만의 PersitentActor를 설계합니다.
OnCommand 에서 메시지 처리기를 설계합니다.
명령과 관련있는 이벤트를 저장합니다. Persist(new Evt($"{cmd.Data}-{NumEvents}"), UpdateState)
- override Recovery Recovery 를 통해 복구기를 지정합니다.
- protected override void OnRecover 를 통해 복구가 일어날때의 코드를 재정의합니다.
- EventList 는 ImmutableList를 사용하여, 업데이트 될시 Event를 추가만 하면됩니다.
위 설계 코드를 테스트하는 코드는 간단합니다. 우리는 어떠한 커멘드를 비 동기로 보내고,
...