From 1ac3c9fb93d262363faaa63ef11c8336c814b93c Mon Sep 17 00:00:00 2001 From: Artem Bilan Date: Wed, 4 Jun 2025 13:24:53 -0400 Subject: [PATCH] GH-236: Fix `KinesisBinderHealthIndicator for newer Spring Boot Fixes: https://github.com/spring-cloud/spring-cloud-stream-binder-aws-kinesis/issues/236 Spring Boot starting with version `3.3` has changed `Health.Builder down(Exception ex)` to `Health.Builder down(Throwable ex)`. This is compatible by compilation against that newer Spring Boot version, but not at runtime by bytecode. * Fix `KinesisBinderHealthIndicator` to use bytecode-compatible version of API We cannot upgrade to newer Spring version in current point version. And this still don't justify a new major/minor version of the Kinesis Binder --- .../stream/binder/kinesis/KinesisBinderHealthIndicator.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/spring-cloud-stream-binder-kinesis/src/main/java/org/springframework/cloud/stream/binder/kinesis/KinesisBinderHealthIndicator.java b/spring-cloud-stream-binder-kinesis/src/main/java/org/springframework/cloud/stream/binder/kinesis/KinesisBinderHealthIndicator.java index 56352e3..c1d69c3 100644 --- a/spring-cloud-stream-binder-kinesis/src/main/java/org/springframework/cloud/stream/binder/kinesis/KinesisBinderHealthIndicator.java +++ b/spring-cloud-stream-binder-kinesis/src/main/java/org/springframework/cloud/stream/binder/kinesis/KinesisBinderHealthIndicator.java @@ -1,5 +1,5 @@ /* - * Copyright 2017-2023 the original author or authors. + * Copyright 2017-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -58,11 +58,11 @@ public class KinesisBinderHealthIndicator implements HealthIndicator { } catch (InterruptedException e) { Thread.currentThread().interrupt(); - return Health.down(ex).build(); + return Health.down().withException(ex).build(); } } else { - return Health.down(ex).build(); + return Health.down().withException(ex).build(); } } }