From 74787661825e3b244ea6c159c82a293b6b154eb3 Mon Sep 17 00:00:00 2001 From: bvn13 Date: Tue, 28 Jun 2022 21:46:09 +0300 Subject: [PATCH 1/4] Update for next development version --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 12eace5..6c1c048 100644 --- a/pom.xml +++ b/pom.xml @@ -6,7 +6,7 @@ me.bvn13.kafka.health kafka-health-check - 1.5.3 + 1.5.4-SNAPSHOT jar Kafka Health Check From 18b3754075fff3feda6484a12beccc2c3648b5db Mon Sep 17 00:00:00 2001 From: bvn13 Date: Tue, 28 Jun 2022 22:27:19 +0300 Subject: [PATCH 2/4] updated changelog --- changelog.md | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/changelog.md b/changelog.md index 9a84bef..6cd3f00 100644 --- a/changelog.md +++ b/changelog.md @@ -1,9 +1,16 @@ # KafkaHealthCheck +## Version 1.5.3 + +* Added SpringBootAutoConfiguration + +## Version 1.5.2 + +* Changed maven group publication: switched into `me.bvn13.kafka.health` + ## Version 1.4.0 * Got rid of `subscriptionTimeout` as a redundant timeout -* Changed maven group publication: switched into `me.bvn13.kafka.health` ## Version 1.3.0 From 432f8627c97ae20f15c7603a7974047ade69a53d Mon Sep 17 00:00:00 2001 From: bvn13 Date: Thu, 30 Jun 2022 11:35:28 +0300 Subject: [PATCH 3/4] added feature toggling for enabling/disabling --- README.md | 15 ++++++++------- .../health/KafkaHealthAutoConfiguration.java | 2 ++ 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 87d9432..9103af6 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,7 @@ Add the following dependency to your `pom.xml` me.bvn13.kafka.health kafka-health-check - 1.5.0 + 1.5.4 ``` @@ -66,12 +66,13 @@ Now if you call the actuator endpoint `actuator/health` you should see the follo ## Configuration -| Property | Default | Description | -|------------------------------------|------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| -| kafka.health.topic | `health-checks` | Topic to subscribe to | -| kafka.health.sendReceiveTimeout | 2.5s | The maximum time, given as [Duration](https://docs.spring.io/spring-boot/docs/2.1.9.RELEASE/reference/html/boot-features-external-config.html#boot-features-external-config-conversion-duration), to wait for sending and receiving the message. | -| kafka.health.pollTimeout | 200ms | The time, given as [Duration](https://docs.spring.io/spring-boot/docs/2.1.9.RELEASE/reference/html/boot-features-external-config.html#boot-features-external-config-conversion-duration), spent fetching the data from the topic | -| kafka.health.cache.maximumSize | 200 | Specifies the maximum number of entries the cache may contain. | +| Property | Default | Description | +|---------------------------------|-----------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| kafka.health.enabled | false | Enabling kafka health check | +| kafka.health.topic | `health-checks` | Topic to subscribe to | +| kafka.health.sendReceiveTimeout | 2.5s | The maximum time, given as [Duration](https://docs.spring.io/spring-boot/docs/2.1.9.RELEASE/reference/html/boot-features-external-config.html#boot-features-external-config-conversion-duration), to wait for sending and receiving the message.| +| kafka.health.pollTimeout | 200ms | The time, given as [Duration](https://docs.spring.io/spring-boot/docs/2.1.9.RELEASE/reference/html/boot-features-external-config.html#boot-features-external-config-conversion-duration), spent fetching the data from the topic | +| kafka.health.cache.maximumSize | 200 | Specifies the maximum number of entries the cache may contain. | diff --git a/src/main/java/me/bvn13/kafka/health/KafkaHealthAutoConfiguration.java b/src/main/java/me/bvn13/kafka/health/KafkaHealthAutoConfiguration.java index a07e01c..1538116 100644 --- a/src/main/java/me/bvn13/kafka/health/KafkaHealthAutoConfiguration.java +++ b/src/main/java/me/bvn13/kafka/health/KafkaHealthAutoConfiguration.java @@ -3,6 +3,7 @@ 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.condition.ConditionalOnProperty; import org.springframework.boot.autoconfigure.kafka.KafkaProperties; import org.springframework.boot.context.properties.ConfigurationProperties; import org.springframework.context.annotation.Bean; @@ -10,6 +11,7 @@ import org.springframework.context.annotation.Configuration; @Configuration @ConditionalOnClass(AbstractHealthIndicator.class) +//@ConditionalOnProperty(name = "kafka.health.enabled", havingValue = "true") public class KafkaHealthAutoConfiguration { @Bean From ec804bb9f868692964835cc8f5ed4243a30fc15a Mon Sep 17 00:00:00 2001 From: bvn13 Date: Thu, 30 Jun 2022 11:35:39 +0300 Subject: [PATCH 4/4] Update versions for release --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 6c1c048..11260ec 100644 --- a/pom.xml +++ b/pom.xml @@ -6,7 +6,7 @@ me.bvn13.kafka.health kafka-health-check - 1.5.4-SNAPSHOT + 1.5.4 jar Kafka Health Check