SeunMatt/eureka-client-wrapper

Is possible to set the Instance-ID in some way?

Closed this issue · 2 comments

Is possible to set the Instance-ID in some way?

Hello @ettorezamponi

The current implementation overrides the default way of setting a custom instance id here https://github.com/SeunMatt/eureka-client-wrapper/blob/master/src/main/java/com/smattme/eureka/client/wrapper/config/WebAppInstanceConfig.java#L45. I believe I wrote it so, to overcome the challenges of running the application in a non-traditional web environment or to fix some issues on the localhost (it's been a while 🙂).

However, if you can subclass the WebAppInstanceConfig and provide your own implementation of com.smattme.eureka.client.wrapper.config.WebAppInstanceConfig#getInstanceId. Then also subclass com.smattme.eureka.client.wrapper.EurekaClientService and use your implementation of WebAppInstanceConfig in the constructor. I believe it may work.

The ideal solution will be to provide an update to the library to allow setting it via the properties file. Only if not found, should it then generate a new one. But I don't know when I'll be able to release that.

Please provide more details about how you're using the library and why you need a custom instance id configured. Is it that the current one is not working for you?

I need to be able to write it in the configuration file to be able to manage the services registered with the discovery service.
I commented your @OverRide method and everything works fine.
Thank you so much and compliment for the readable and clean code :)