From 96c9a2d891358d64ff6cecb59187bc33d9087410 Mon Sep 17 00:00:00 2001 From: bvn13 Date: Tue, 28 Jun 2022 17:38:54 +0300 Subject: [PATCH 1/3] Update for next development version --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index d005896..42ac998 100644 --- a/pom.xml +++ b/pom.xml @@ -6,7 +6,7 @@ me.bvn13.kafka.health kafka-health-check - 1.5.2 + 1.5.3-SNAPSHOT jar Kafka Health Check From 1cb2c91dba49cc5f27e4efe6c2c35a1043e87aa6 Mon Sep 17 00:00:00 2001 From: bvn13 Date: Tue, 28 Jun 2022 21:45:19 +0300 Subject: [PATCH 2/3] #11 - added SpringBootAutoConfiguration --- pom.xml | 2 +- .../health/KafkaHealthAutoConfiguration.java | 30 +++++++++++++++++++ src/main/resources/META-INF/spring.factories | 1 + 3 files changed, 32 insertions(+), 1 deletion(-) create mode 100644 src/main/java/me/bvn13/kafka/health/KafkaHealthAutoConfiguration.java create mode 100644 src/main/resources/META-INF/spring.factories diff --git a/pom.xml b/pom.xml index 42ac998..1c1be59 100644 --- a/pom.xml +++ b/pom.xml @@ -114,7 +114,7 @@ develop - false + true 2 diff --git a/src/main/java/me/bvn13/kafka/health/KafkaHealthAutoConfiguration.java b/src/main/java/me/bvn13/kafka/health/KafkaHealthAutoConfiguration.java new file mode 100644 index 0000000..a07e01c --- /dev/null +++ b/src/main/java/me/bvn13/kafka/health/KafkaHealthAutoConfiguration.java @@ -0,0 +1,30 @@ +package me.bvn13.kafka.health; + +import org.springframework.boot.actuate.health.AbstractHealthIndicator; +import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; +import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; +import org.springframework.boot.autoconfigure.kafka.KafkaProperties; +import org.springframework.boot.context.properties.ConfigurationProperties; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; + +@Configuration +@ConditionalOnClass(AbstractHealthIndicator.class) +public class KafkaHealthAutoConfiguration { + + @Bean + @ConditionalOnMissingBean(KafkaHealthProperties.class) + @ConfigurationProperties("kafka.health") + public KafkaHealthProperties kafkaHealthProperties() { + return new KafkaHealthProperties(); + } + + @Bean + @ConditionalOnMissingBean(KafkaConsumingHealthIndicator.class) + public KafkaConsumingHealthIndicator kafkaConsumingHealthIndicator(KafkaHealthProperties kafkaHealthProperties, + KafkaProperties kafkaProperties) { + return new KafkaConsumingHealthIndicator(kafkaHealthProperties, kafkaProperties.buildConsumerProperties(), + kafkaProperties.buildProducerProperties()); + } + +} diff --git a/src/main/resources/META-INF/spring.factories b/src/main/resources/META-INF/spring.factories new file mode 100644 index 0000000..ba32998 --- /dev/null +++ b/src/main/resources/META-INF/spring.factories @@ -0,0 +1 @@ +org.springframework.boot.autoconfigure.EnableAutoConfiguration=me.bvn13.kafka.health.KafkaHealthAutoConfiguration From cc56c30401f3ca0e0470de795d5d09cfee235380 Mon Sep 17 00:00:00 2001 From: bvn13 Date: Tue, 28 Jun 2022 21:45:48 +0300 Subject: [PATCH 3/3] Update versions for release --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 1c1be59..12eace5 100644 --- a/pom.xml +++ b/pom.xml @@ -6,7 +6,7 @@ me.bvn13.kafka.health kafka-health-check - 1.5.3-SNAPSHOT + 1.5.3 jar Kafka Health Check