You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 00c006f
Browse filesBrowse the repository at this point in the historyBrowse files
docs: embed the rendered class diagram in the event-carried state transfer README
Render etc/event-carried-state-transfer.urm.puml to PNG and embed it in the detailed explanation section, matching the other modules, instead of the inline mermaid block. The producer and consumer snippets now show the plain long sequence counters the code uses.
Copy file name to clipboardExpand all lines: event-carried-state-transfer/README.md
+4-77Lines changed: 4 additions & 77 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -57,6 +57,8 @@ sequenceDiagram
57
57
OS->>R: apply (version 1 <= 2, ignored)
58
58
```
59
59
60
+

61
+
60
62
## Programmatic Example of Event-Carried State Transfer Pattern in Java
61
63
62
64
The example has a producer, a channel and a consumer. The producer is the customer service, the channel is a tiny in-memory event bus and the consumer is the order service with its local customer replica.
@@ -116,7 +118,7 @@ public CustomerState changeShippingAddress(String customerId, String newAddress)
116
118
117
119
privateCustomerState store(CustomerState state) {
118
120
customers.put(state.customerId(), state);
119
-
var event =newCustomerUpdatedEvent(eventSequence.incrementAndGet(), Instant.now(), state);
121
+
var event =newCustomerUpdatedEvent(++eventSequence, Instant.now(), state);
120
122
bus.publish(event);
121
123
return state;
122
124
}
@@ -166,7 +168,7 @@ public Order placeOrder(String customerId, BigDecimal amount) {
0 commit comments