-
Notifications
You must be signed in to change notification settings - Fork 2.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Publish custom port to eureka service registry from eureka client #4056
Comments
Hello @an0nh4x0r, why do you need this functionality? Could you describe your use-case in more details? |
Hey @OlgaMaciaszek ... We have our own cloud in my company where we run custom built containers(not docker) ... We basically have two ports i.e. first inner port of which spring boot is running, second outer port through which traffic gets port forwarded to this inner port in which spring boot app runs ... I have access to outer port number in container through enviornment variable ... I was looking for ways to publish this outer port to eureka service registery. In my company I see people who are using zookeeper as service registery have option to publish custom port to zookeeper ... I was looking to get same functionality natively from Eureka client. |
@an0nh4x0r thanks for the details. Will discuss it with the team and get back to you. |
@an0nh4x0r Actually, you should be able to set it using these props. Let me know if this solves your issue. |
If you would like us to look at this issue, please provide the requested information. If the information is not provided within the next 7 days this issue will be closed. |
Closing due to lack of requested feedback. If you would like us to look at this issue, please provide the requested information and we will re-open the issue. |
I am not the original creator of this issue but I'm experiencing a similar issue. Here's the required part of my application.yml:
I want spring to use the default ports for http/https inside of docker (easier integration into out stacks) but eureka should advertise the "external" port. Since this didn't have the effect I wanted I tried it like this:
If I use this command The log looks like this:
If you need any more info please let me know |
Hello @madmurl0c, please provide a minimal, complete, verifiable example that reproduces the issue as a link to a separate GitHub repo with an executable app and steps to reproduce. |
Eureka client by default publishes
${server.port}
to service registery i.e. eureka server. There needs to be a property where we can publish custom port to service registryThere needs to be a property called
${eureka.instance.custom-port}
which can be used to set custom port which will then get published to the eureka server ... instead of${server.port}
In my organization , I've override a bean called
eurekaInstanceConfigBean
basically at this line here in classEurekaClientAutoConfiguration
I'm checking for custom port property and if it's present I'm using custom port instead of${server.port}
and publishing that port instead. It works great for meI would like to get this property support officially from the library
The text was updated successfully, but these errors were encountered: