Skip to content

Commit 6aebabe

Browse files
committed
Add support for custom port on Java HEALTHCHECK client
1 parent 667b0bf commit 6aebabe

2 files changed

Lines changed: 3 additions & 1 deletion

File tree

docker/HealthCheck.jar

39 Bytes
Binary file not shown.

docker/HealthCheck.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,11 @@
2020

2121
public class HealthCheck {
2222
public static void main(String[] args) throws IOException, InterruptedException {
23+
final var port = args.length > 0 ? args[0] : "8080";
24+
2325
final var client = HttpClient.newHttpClient();
2426
final var request = HttpRequest.newBuilder()
25-
.uri(URI.create("http://localhost:8080/actuator/health"))
27+
.uri(URI.create("http://localhost:" + port + "/actuator/health"))
2628
.header("accept", "application/json")
2729
.build();
2830

0 commit comments

Comments
 (0)