File tree Expand file tree Collapse file tree
src/main/java/com/dddheroes/heroesofddd
creaturerecruitment/read/getdwellingbyid Expand file tree Collapse file tree Original file line number Diff line number Diff line change 33import com .dddheroes .heroesofddd .shared .application .GameMetaData ;
44import org .axonframework .eventhandling .EventMessage ;
55import org .axonframework .eventhandling .async .SequencingPolicy ;
6+ import org .axonframework .messaging .correlation .CorrelationDataProvider ;
7+ import org .axonframework .messaging .correlation .MessageOriginProvider ;
8+ import org .axonframework .messaging .correlation .SimpleCorrelationDataProvider ;
69import org .springframework .context .annotation .Bean ;
710import org .springframework .context .annotation .Configuration ;
811
@@ -13,4 +16,14 @@ public class GameConfiguration {
1316 public SequencingPolicy <EventMessage <?>> gameIdSequencingPolicy () {
1417 return e -> e .getMetaData ().get (GameMetaData .GAME_ID_KEY );
1518 }
19+
20+ @ Bean
21+ public CorrelationDataProvider gameDataProvider () {
22+ return new SimpleCorrelationDataProvider (GameMetaData .GAME_ID_KEY , GameMetaData .PLAYER_ID_KEY );
23+ }
24+
25+ @ Bean
26+ public CorrelationDataProvider messageOriginProvider () {
27+ return new MessageOriginProvider ();
28+ }
1629}
Original file line number Diff line number Diff line change @@ -24,7 +24,7 @@ CompletableFuture<DwellingReadModel> getDwellings(
2424 @ PathVariable String gameId ,
2525 @ PathVariable String dwellingId
2626 ) {
27- var query = GetDwellingById .query (dwellingId , gameId );
27+ var query = GetDwellingById .query (gameId , dwellingId );
2828
2929 return queryGateway .query (
3030 query ,
You can’t perform that action at this time.
0 commit comments