Revision

@Target(allowedTargets = [AnnotationTarget.CLASS])
annotation class Revision(val value: Int)

The revision of a domain event's schema. An event without it is at revision 1.

The log stores each event with the revision it was written at. When the event's structure changes in a way old records do not fit, raise the revision and give an upgrade from each earlier revision to the next one: records of an older revision are read through that chain of Upgrade functions. Adding an optional field with a default is not such a change and needs no new revision. The revision and its upgrades cover the service's own records only: the events query and the published stream give the event at its current revision, so the Manifest compatibility gate still reports a field removed, retyped or made required as breaking for their readers.

@Revision(2)
data class ItemAdded(val productId: String, val quantity: Int)

Only events have revisions; a command is identified by its name alone.

Parameters

value

the current revision, 1 or more.

Properties

Link copied to clipboard
val value: Int