How do i access vert.x port number? #42626
-
Im trying to register microservice to consul discovery service. I have not been able to do it automatically so i do it explicitly using init method with @observes annotation. Problem arrives when i set port number to be 0 (aka random) because im unable to get the port, as everything i tried to do just returns 0 instead of an actual port number. Example:
I have also tried HttpConfiguration.port but the result appears to be the same. Any other approach? Anything non-explicit? !!! It appears that when live reload triggers retart the port is displayed properly. Is there any other event that i can observe that is guaranteed to happen after the port has been set? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
@ConfigProperty(name = "quarkus.http.port", defaultValue="8080") int port; It should be fine, except if you use random ports, you should be able to access it using a system property directly ( |
Beta Was this translation helpful? Give feedback.
It should be fine, except if you use random ports, you should be able to access it using a system property directly (
quarkus.http.port
).