MetricLocalDomainEventBus

Metric decorator specifically for local domain event buses. Extends MetricDomainEventBus to provide metrics collection for local domain event bus operations while maintaining the LocalDomainEventBus interface.

Constructors

Link copied to clipboard
constructor(delegate: LocalDomainEventBus)

Properties

Link copied to clipboard

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

Functions

Link copied to clipboard
open override fun close()

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

Link copied to clipboard

Wraps a LocalDomainEventBus with metrics collection capabilities. Returns a MetricLocalDomainEventBus that collects metrics on domain event operations.

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

Receives event stream 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: DomainEventStream): Mono<Void>

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

Link copied to clipboard
open override fun subscriberCount(namedAggregate: NamedAggregate): Int

Returns the number of subscribers for the specified named aggregate. This delegates to the underlying local domain event bus implementation.

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.