-
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
EurekaClientAutoConfiguration: unable to provide my own implementation of 'EurekaInstanceConfig' #302
Comments
We have a little functionality in |
We tried, but unfortunately autowiring the
What do you mean by random? A random port selected by the embedded servlet container at boot time (i.e. configured with If so, could you please have a look at my comments on post http://stackoverflow.com/questions/29637324/spring-cloud-random-port-not-registered-to-eureka ? Thanks for your help. |
Anyway, if SpringCloud Netflix components expect an instance of
Otherwise, providing my own implementation of the interface will correctly disable the creation of 'your' See what I mean? |
I'm talking about loosing those features if we moved to just the interface and you replaced the implementation. You're right about random server port. Another possibility is subclassing |
Issue is still there even after refactoring work done recently (Brixton). |
I think it's gone now ( |
|
Specifically CloudEurekaInstanceConfig where needed. see gh-302
|
@dsyer any reason to reopen this? |
I thought you meant we needed to because the Netflix interface isn't used. I guess you meant that as long as the user adds a bean of a different type (which is also an interface) everything is good? If so just close this again. |
Yeah, I created |
Specifically CloudEurekaInstanceConfig where needed. see spring-cloudgh-302
The
EurekaClientAutoConfiguration
creates a defaultEurekaInstanceConfig
instance only if none is found the application context. The snippet below shows the code responsible for that behaviour:EurekaInstanceConfig
is an interface (from the Netflix package) whereasEurekaInstanceConfigBean
is an implementation of that interface (from spring cloud package). Because of that, one may think it can supply its own custom implementation of the interface. Unfortunately, this won't work because theEurekaDiscoveryClient
expects the implementation class and not the interface as shown below:Consequence is user cannot provide his own implementation and is forced to extend
EurekaInstanceConfigBean
.Two comments on this:
(1) Is it expected? Is there any reason why user cannot provide their own implementation?
(2) If it is the case, then shouldn't the
@ConditionalOnMissingBean
annotation refers toEurekaInstanceConfigBean
instead?The text was updated successfully, but these errors were encountered: