MetricStateEventBus

Metric decorator for state event buses that collects metrics on state event sending and receiving operations. This class wraps any StateEventBus implementation and adds metrics collection with tags for aggregate name and source identification.

Parameters

T

the specific type of StateEventBus being decorated

Inheritors

Constructors

Link copied to clipboard
constructor(delegate: T)

Properties

Link copied to clipboard
override val delegate: T

the original component being decorated, must implement the Decorator interface

Link copied to clipboard

The source identifier derived from the original delegate's class name. This is used for metrics tagging to identify the component type.

Link copied to clipboard
open override val topicKind: TopicKind

The topic kind for state events.

Functions

Link copied to clipboard
open override fun close()

Closes the state event bus and releases any resources. This delegates to the underlying state event bus implementation.

Link copied to clipboard
open override fun receive(namedAggregates: Set<NamedAggregate>): Flux<StateEventExchange<*>>

Receives state event exchanges for the specified named aggregates and collects metrics on the operation. Metrics collected include timing and tags for aggregate identification and subscriber information.

Link copied to clipboard
open override fun send(message: StateEvent<*>): Mono<Void>

Sends a state event and collects metrics on the operation. Metrics collected include timing, success/failure rates, and tags for aggregate identification.

Link copied to clipboard
fun <M> Flux<M>.tagSource(): Flux<M>

Extension function to tag a Flux publisher with the current source identifier. This adds the source tag to metrics collected from this reactive stream.

fun <M> Mono<M>.tagSource(): Mono<M>

Extension function to tag a Mono publisher with the current source identifier. This adds the source tag to metrics collected from this reactive stream.