When using the @Subscription annotation (https://occurrent.org/documentation#spring-boot-annotations) you can specify EventMetadata from which you can get all metadata including stream id and version:
@Component
class Example {
@Subscription(id = "printAllDomainEvents")
fun printAllDomainEvents(e: DomainEvent, metadata: EventMetadata) {
val streamId: String = metadata.streamId
val streamVersion: Long = metadata.streamVersion
val myCustomValue: Any? = metadata["MyCustomValue"]
// ...
}
}
However, it would be nice to selectively just get the scream id and/or version directly:
@Component
class Example {
@Subscription(id = "printAllDomainEvents")
fun printAllDomainEvents(e: DomainEvent, @StreamId streamId : String, @StreamVersion streamVersion : Long) {
// ...
}
}
When using the
@Subscriptionannotation (https://occurrent.org/documentation#spring-boot-annotations) you can specifyEventMetadatafrom which you can get all metadata including stream id and version:However, it would be nice to selectively just get the scream id and/or version directly: