com.kapeta.spring.rabbitmq.RabbitHealthConfiguration Maven / Gradle / Ivy
/*
* Copyright 2023 Kapeta Inc.
* SPDX-License-Identifier: MIT
*/
package com.kapeta.spring.rabbitmq;
import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.boot.actuate.amqp.RabbitHealthIndicator;
import org.springframework.boot.actuate.autoconfigure.health.CompositeHealthContributorConfiguration;
import org.springframework.boot.actuate.health.HealthContributor;
import org.springframework.boot.autoconfigure.condition.ConditionalOnBean;
import org.springframework.context.annotation.Bean;
import java.util.Map;
/**
* Configuration for RabbitMQ health indicators.
*/
public class RabbitHealthConfiguration extends CompositeHealthContributorConfiguration {
public RabbitHealthConfiguration() {
super(RabbitHealthIndicator::new);
}
@Bean
@ConditionalOnBean(RabbitTemplate.class)
public HealthContributor rabbitHealthContributor(Map rabbitTemplates) {
return createContributor(rabbitTemplates);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy