
pl.allegro.tech.hermes.consumers.config.ServerConfiguration Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of hermes-consumers Show documentation
Show all versions of hermes-consumers Show documentation
Fast and reliable message broker built on top of Kafka.
package pl.allegro.tech.hermes.consumers.config;
import com.fasterxml.jackson.databind.ObjectMapper;
import io.micrometer.prometheus.PrometheusMeterRegistry;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import pl.allegro.tech.hermes.consumers.health.ConsumerMonitor;
import pl.allegro.tech.hermes.consumers.server.ConsumerHttpServer;
import java.io.IOException;
@Configuration
@EnableConfigurationProperties(CommonConsumerProperties.class)
public class ServerConfiguration {
@Bean(initMethod = "start", destroyMethod = "stop")
public ConsumerHttpServer consumerHttpServer(CommonConsumerProperties commonConsumerProperties,
ConsumerMonitor monitor,
ObjectMapper mapper,
PrometheusMeterRegistry meterRegistry) throws IOException {
return new ConsumerHttpServer(commonConsumerProperties.getHealthCheckPort(), monitor, mapper, meterRegistry);
}
@Bean
public ConsumerMonitor consumerMonitor() {
return new ConsumerMonitor();
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy