Repository navigation
GH-4871: Parse IPv6 application.server host info - #4872
Merged
Merged
Conversation
Fixes: spring-projects#4871 **Auto-cherry-pick to `4.1.x` & `4.0.x`** getCurrentKafkaStreamsApplicationHostInfo() split application.server at the first ':', so an IPv6 value such as [::1]:8080 failed with a NumberFormatException. Parse it with HostInfo.buildFromEndpoint(), as Kafka Streams does, so the result matches the active host that Kafka Streams reports for the instance. Signed-off-by: Yingzi Zhang <yingzizhang1205@gmail.com>
spring-builds
pushed a commit
that referenced
this pull request
Nov 4, 2026
Fixes: #4871 getCurrentKafkaStreamsApplicationHostInfo() split application.server at the first ':', so an IPv6 value such as [::1]:8080 failed with a NumberFormatException. Parse it with HostInfo.buildFromEndpoint(), as Kafka Streams does, so the result matches the active host that Kafka Streams reports for the instance. Signed-off-by: Yingzi Zhang <yingzizhang1205@gmail.com> (cherry picked from commit ea3d3c8)
spring-builds
pushed a commit
that referenced
this pull request
Nov 4, 2026
Fixes: #4871 getCurrentKafkaStreamsApplicationHostInfo() split application.server at the first ':', so an IPv6 value such as [::1]:8080 failed with a NumberFormatException. Parse it with HostInfo.buildFromEndpoint(), as Kafka Streams does, so the result matches the active host that Kafka Streams reports for the instance. Signed-off-by: Yingzi Zhang <yingzizhang1205@gmail.com> (cherry picked from commit ea3d3c8)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes: #4871
getCurrentKafkaStreamsApplicationHostInfo()splitapplication.serverat the first:, so an IPv6 value such as[::1]:8080failed with aNumberFormatException.It now parses the value with
HostInfo.buildFromEndpoint(), the same method Kafka Streams uses for this property, so the result matches the active host that Kafka Streams reports for the instance. A blank value still returnsnull. A value without a port, which used to returnnull, now throws the sameConfigExceptionthat Kafka Streams throws for it when theKafkaStreamsinstance is created.Tests:
currentHostInfoWithIpv6ApplicationServertoKafkaStreamsInteractiveQueryServiceTests. It fails onmain(NumberFormatException: For input string: ":1]:8080") and passes with the fix.application.servertemporarily set to[::1]:8080in the existing test context,getKafkaStreamsApplicationHostInfo(...)andgetCurrentKafkaStreamsApplicationHostInfo()both returnHostInfo("::1", 8080)(not part of this change).checkstyleMainandcheckstyleTestpass (JDK 25). The full:spring-kafka:testrun locally: 1272 tests, 4 skipped, 1 failure inAsyncMonoRetryTopicScenarioTests(topic metadata timeout), which passes when run on its own.