Discovery Manager Question

1,060 views
Skip to first unread message

itsb...@gmail.com

unread,
Mar 24, 2016, 7:14:06 PM3/24/16
to eureka_netflix
I noticed in DiscoveryManager.java that it's deprecated and I should use EurekaModule and DI. Am I correct in assuming that DI is Spring Dependency Injection?

If so, does Eureka only work exclusively with Spring? Is OSGi not a possible alternative for dependency injection?

Any advice on the subject would be appreciated. Thanks!

dl...@netflix.com

unread,
Mar 30, 2016, 3:58:12 PM3/30/16
to eureka_netflix
Hi Douglas,

By default, we actually use Guice. There is spring-cloud-netflix in opensource that wraps this with Spring as well.
You can take a look at the EurekaModuleTest.java class for some ideas of how you can do this.

Alternatively, you can also manually construct ApplicationInfoManager and DiscoveryClient via their exposed public APIs and do not need to depend on DI at all.

beac...@gmail.com

unread,
Jun 1, 2016, 1:56:48 PM6/1/16
to eureka_netflix

So I'm wondering since everything says to use DI now am I forced to use govenator/guice? I'm not seeing a way to not to use them if DI is the way to go.

dl...@netflix.com

unread,
Jun 1, 2016, 5:14:09 PM6/1/16
to eureka_netflix, beac...@gmail.com
Hi,

We encourage using DI, but eureka is definitely useable without DI also (though the management of client singletons can be convoluted). We actually have an example (https://github.com/Netflix/eureka/blob/master/eureka-examples/src/main/java/com/netflix/eureka/ExampleEurekaClient.java) that shows usage of the client with no DI what-so-ever. 

Thanks

mal.p...@gmail.com

unread,
Jul 7, 2017, 9:07:37 PM7/7/17
to eureka_netflix
Hi,

I was wondering if using guice or governator is also the preferred way of creating a EurekaClient for JAX-RS-based module?

Hope you could give me some example on this because I couldn't find any leads on it.

Many thanks,
Toni
Reply all
Reply to author
Forward
0 new messages