Skip to content

Commit beab234

Browse files
snapshot filters experiments
1 parent 3a771f5 commit beab234

3 files changed

Lines changed: 3 additions & 2 deletions

File tree

src/main/java/com/dddheroes/heroesofddd/astrologers/AstrologersConfiguration.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ private static int random(int min, int max) {
2626
@Bean
2727
public SnapshotFilter astrologersSnapshotFilter() {
2828
return snapshotData -> {
29+
var type = snapshotData.getType();
2930
// Allow all snapshots for dwellings, as they are always in the correct format
3031
return true;
3132
};

src/main/java/com/dddheroes/heroesofddd/creaturerecruitment/CreatureRecruitmentConfiguration.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ SnapshotTriggerDefinition dwellingSnapshotTrigger(Snapshotter snapshotter) {
3636
@Bean
3737
public SnapshotFilter dwellingSnapshotFilter() {
3838
return snapshotData -> {
39-
// Allow all snapshots for dwellings, as they are always in the correct format
39+
var type = snapshotData.getType();
4040
return true;
4141
};
4242
}

src/main/java/com/dddheroes/heroesofddd/creaturerecruitment/write/Dwelling.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424

2525
import static org.axonframework.modelling.command.AggregateLifecycle.*;
2626

27-
@Aggregate(snapshotTriggerDefinition = "dwellingSnapshotTrigger")
27+
@Aggregate(snapshotTriggerDefinition = "dwellingSnapshotTrigger", snapshotFilter = "dwellingSnapshotFilter")
2828
public class Dwelling {
2929

3030
private static final Logger logger = LoggerFactory.getLogger(Dwelling.class);

0 commit comments

Comments
 (0)