From 85af0d645d4f648fea6a433b720453d09350ef08 Mon Sep 17 00:00:00 2001 From: onobc Date: Mon, 6 Apr 2026 15:02:32 -0500 Subject: [PATCH] Upgrade to Pulsar 4.2.0 This commit updates the managed version of Pulsar from `4.1.3` to `4.2.0` and the test image version from `3.3.3` to `4.2.0`. Since Pulsar `4.2.0` standalone mode advertises the container's FQDN (the container ID) instead of localhost. The Pulsar client reconnects to the advertised address during servicediscovery, but is unable to reach the FQDN. Therefore, this also sets the `advertisedAddress` on the Pulsar testcontainers used by the tests. See gh-49900 Signed-off-by: onobc --- platform/spring-boot-dependencies/build.gradle | 2 +- .../boot/testsupport/container/TestImage.java | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/platform/spring-boot-dependencies/build.gradle b/platform/spring-boot-dependencies/build.gradle index 94c4c54d9ad..cc7b335552c 100644 --- a/platform/spring-boot-dependencies/build.gradle +++ b/platform/spring-boot-dependencies/build.gradle @@ -1898,7 +1898,7 @@ bom { releaseNotes("https://github.com/prometheus/client_java/releases/tag/parent-{version}") } } - library("Pulsar", "4.1.3") { + library("Pulsar", "4.2.0") { group("org.apache.pulsar") { bom("pulsar-bom") } diff --git a/test-support/spring-boot-docker-test-support/src/main/java/org/springframework/boot/testsupport/container/TestImage.java b/test-support/spring-boot-docker-test-support/src/main/java/org/springframework/boot/testsupport/container/TestImage.java index 02e3ec66100..6d7d83ed93f 100644 --- a/test-support/spring-boot-docker-test-support/src/main/java/org/springframework/boot/testsupport/container/TestImage.java +++ b/test-support/spring-boot-docker-test-support/src/main/java/org/springframework/boot/testsupport/container/TestImage.java @@ -238,9 +238,10 @@ public enum TestImage { /** * A container image suitable for testing Pulsar. */ - PULSAR("apachepulsar/pulsar", "3.3.3", () -> PulsarContainer.class, + PULSAR("apachepulsar/pulsar", "4.2.0", () -> PulsarContainer.class, (container) -> ((PulsarContainer) container).withStartupAttempts(2) - .withStartupTimeout(Duration.ofMinutes(3))), + .withStartupTimeout(Duration.ofMinutes(3)) + .withEnv("PULSAR_PREFIX_advertisedAddress", "localhost")), /** * A container image suitable for testing Pulsar using the deprecated