Skip to content

Commit

Permalink
fixes #2043 Add an indicator ready for the server
Browse files Browse the repository at this point in the history
  • Loading branch information
stevehu committed Dec 13, 2023
1 parent 92be1a4 commit f572c1b
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions server/src/main/java/com/networknt/server/Server.java
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,9 @@ public class Server {
// When dynamic port is used, this HashSet contains used port so that we just need to check here instead of trying bind.
private static Set usedPorts;

// indicate if the server is ready to accept requests. Used by Kafka sidecar to consume messages in reactive consumer.
public static boolean ready = false;

public static void main(final String[] args) {
init();
}
Expand Down Expand Up @@ -134,6 +137,7 @@ public static void init() {
// send a graceful system shutdown
System.exit(1);
}
ready = true;
}

/**
Expand Down

0 comments on commit f572c1b

Please sign in to comment.