Open stantonk opened 8 years ago
You can specify an IP in the configuration. Does that work?
@jplock it is a reasonable workaround for now, yes, but then the config can't be checked in and used by multiple developers who want to run integration tests. you'd have to manually modify the config each time you ran the tests on a different machine or on a different day (as IPs are dynamically allocated)
I'm not sure if this is the best way to solve this problem, but if you want to run a service locally and you use a VPN, the logic here:
https://github.com/dropwizard/dropwizard-discovery/blob/2c3f45b9a6612515762b0dcec8590f06aa27bff1/src/main/java/io/dropwizard/discovery/core/CuratorAdvertiser.java#L85
will sometimes pick the wrong local IP if you are connected to a VPN.
Easiest solution I can think of is do have a config param for dropwizard-discovery to match those addresses returned by
ServiceInstanceBuilder.getAllLocalIPs();
against a regex pattern like"^10\.0\.1\.\d+"
or something like that.