smallrye-stork
smallrye-stork copied to clipboard
Allow an integrator to provide a customized Stork instance
Currently, the only entrypoint for Stork is a singleton implemented as a static field and accessible via the io.smallrye.stork.Stork.getInstance() static method. This is not very flexible, esp. in the context of integration in a more complex environment. I think that it might be practical to make this more extensible so that an integrator can provide its own way of obtaining the "correct" (and possibly customized) Stork instance.
Furthermore, it might be useful (and not only for testing) to provide a simple builder for to construct a Stork instance, e.g.
Stork stork = Stork.builder()
.initialize() // service loader
.addServiceDiscoveryProvider(customProvider) // custom ServiceDiscoveryProvider
.build();