Skip to content

Commit e91acd7

Browse files
committed
updated docs to reflect eventually consistent append listener api change - returning lastseen ref now
1 parent c5d9d8c commit e91acd7

File tree

4 files changed

+7
-3
lines changed

4 files changed

+7
-3
lines changed

_posts/2025-11-09-eventstore-quickstart.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -388,6 +388,7 @@ stream.subscribe(new EventStreamEventuallyConsistentAppendListener() {
388388
if (!newEvents.isEmpty()) {
389389
lastSeen.set(newEvents.getLast().reference());
390390
}
391+
return lastSeen.get();
391392
}
392393
});
393394
```

_posts/2025-11-29-eventstore-bookmarking.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,7 @@ stream.subscribe((EventReference atLeastUntil) -> {
119119
Tags.of("processed-at", Instant.now().toString())
120120
);
121121
});
122+
return null;
122123
});
123124

124125
// Initial catch-up: process all existing events

_posts/2025-11-29-eventstore-listeners.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,12 +54,12 @@ stream.subscribe((EventReference atLeastUntil) -> {
5454
stream.query(EventQuery.matchAll(), lastProcessed.get())
5555
.forEach(event -> {
5656
System.out.println("Processing: " + event.type());
57-
updateReadModel(event);
57+
lastProcessed.set(event.reference());
5858
});
5959

6060
// Update bookmark for resumability
61-
lastProcessed.set(atLeastUntil);
6261
stream.placeBookmark("order-processor", atLeastUntil, Tags.none());
62+
return lastProcessed.get();
6363
});
6464
```
6565

_posts/2025-11-29-eventstore-projecting-events.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -419,7 +419,7 @@ public class CustomerProjectionService {
419419
/*
420420
* This method is called asynchronously each time the
421421
*/
422-
private void updateProjection(EventReference atLeastUntil) {
422+
private EventReference updateProjection(EventReference atLeastUntil) {
423423

424424
// Project new events, bookmark is fetched before this run (ref builder instructions above)
425425
ProjectorMetrics metrics = projector.run();
@@ -430,6 +430,8 @@ public class CustomerProjectionService {
430430
}
431431

432432
// Bookmark is automatically updated after each run
433+
434+
return metrics.lastEventReference();
433435
}
434436

435437
public CustomerSummary getProjection() {

0 commit comments

Comments
 (0)