com.bybutter.sisyphus.middleware.kafka.autoconfigure.KafkaMetricsAutoConfiguration.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of sisyphus-kafka2 Show documentation
Show all versions of sisyphus-kafka2 Show documentation
Middleware for using Kafka in Sisyphus Project
package com.bybutter.sisyphus.middleware.kafka.autoconfigure
import com.bybutter.sisyphus.middleware.kafka.KafkaLogger
import com.bybutter.sisyphus.middleware.kafka.metrics.MicrometerKafkaLogger
import io.micrometer.core.instrument.MeterRegistry
import org.springframework.boot.autoconfigure.AutoConfiguration
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass
import org.springframework.context.annotation.Bean
@AutoConfiguration(
afterName = ["org.springframework.boot.actuate.autoconfigure.metrics.MetricsAutoConfiguration", "org.springframework.boot.actuate.autoconfigure.metrics.export.simple.SimpleMetricsExportAutoConfiguration"],
beforeName = ["org.springframework.boot.actuate.autoconfigure.metrics.web.reactive.WebFluxMetricsAutoConfiguration"]
)
@ConditionalOnClass(name = ["io.micrometer.core.instrument.MeterRegistry"])
class KafkaMetricsAutoConfiguration {
@Bean
fun micrometerKafkaMqLogger(registry: MeterRegistry): KafkaLogger {
return MicrometerKafkaLogger(registry)
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy