Event-carried state transfer (ECST) publishes an event containing the producer’s complete entity state, allowing consumers to maintain local representations without requesting state separately. It fits publish-subscribe integration: producers expose a stable, comprehensive event interface without knowing which attributes future consumers will need. section 6.2.2
ECST contrasts with delta events. A fact event carries every profile attribute even when only one field changes; a delta event carries only the changed value. Full-state events simplify consumer onboarding and recovery because consumers can reconstruct current state by reading the latest event, while consumer-specific logic remains on the consumer side. section 6.2.2
Listing 6.1 UserProfileUpdated event carrying all the attributes from the user profile
{
"eventType": "UserProfileUpdated",
"eventId": "123e4567-e89b-12d3-a456-426614174003",
"timestamp": "2024-09-26T12:00:00Z",
"userProfile": {
"userId": "12345",
"name": "Alice Johnson",
"email": "alice.johnson@example.com",
"preferredLanguage": "en",
"addresses": [
{
"addressId": "98765",
"street": "456 Elm St",
"city": "Metropolis",
"state": "NY",
"zipCode": "10001"
}
],
"socialAccounts": [
{
"type": "twitter",
"handle": "@alicejohnson"
}
],
"phoneNumber": "+1-555-123-4567"
}
}
A UserProfileUpdated event demonstrates ECST by carrying identity, contact details, preferences, addresses, and social accounts together, even when one attribute changes. section 6.2.2
