Get the server port number from tomcat without a request

前端 未结 12 1565
佛祖请我去吃肉
佛祖请我去吃肉 2020-11-28 06:32

Is there any Tomcat API or configuration available which can tell an application (probably on startup), what port its running on without a request?

Imagine a scenari

12条回答
  •  执念已碎
    2020-11-28 07:14

    Previously on a large distributed project, the design I used was to have the centralised service initialise the several services with the central service's URL(& port).

    Obviously this means that the central service must maintain a list of the services (URL & port) to initialise.

提交回复
热议问题