Show the worker-id when the worker starts.

This commit is contained in:
Lampros Smyrnaios 2023-05-15 13:22:55 +03:00
parent 714938531b
commit cc55354e73
2 changed files with 9 additions and 1 deletions

View File

@ -31,10 +31,17 @@ public class UrlsWorkerApplication {
private static final Logger logger = LoggerFactory.getLogger(UrlsWorkerApplication.class);
private static String workerId;
private static ConfigurableApplicationContext context;
public UrlsWorkerApplication(@Value("${info.workerId}") String workerId)
{
UrlsWorkerApplication.workerId = workerId;
}
public static void main(String[] args) {
context = SpringApplication.run(UrlsWorkerApplication.class, args);
@ -43,6 +50,8 @@ public class UrlsWorkerApplication {
logger.debug("HeapSize: " + (javaRuntime.totalMemory() / mb) + " mb");
logger.debug("HeapMaxSize: " + (javaRuntime.maxMemory() / mb) + " mb");
logger.debug("HeapFreeSize: " + (javaRuntime.freeMemory() / mb) + " mb");
logger.info("The Worker has started running. Its id is: \"" + workerId + "\".");
}

View File

@ -13,7 +13,6 @@
server.port = 1881
# Set the above value to < 0 >, in order to choose a random port (it will automatically choose a new random port, if the previously chosen is already in use)..
# Server api path
server.servlet.context-path=/api