-
Notifications
You must be signed in to change notification settings - Fork 541
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
Filter services by tag in ConsulDiscoveryClient #18
Comments
We are doing this by editing This behavior change should be able to be wired in via the conditional ribbonServerList in ConsulRibbonClientConfiguration:
We ran into trouble trying to inject that replacement, in that we couldn't seem to load it at a time when Any pointers? |
Usually that means the |
Is this the pattern we should follow then? Basically create a @configuration class (that defines the ribbonServerList method) that is not loaded via componentscan or other mechanisms, then reference it in the @RibbonClients annotation? For example: I'm trying to get this working with Zuul, so I'd put that annotation on the main zuul application which has @EnableDiscoveryClient on it. |
Yes, that is according to the documentation http://projects.spring.io/spring-cloud/spring-cloud.html#_customizing_the_ribbon_client |
Ok, I will give it a shot. The documentation more seemed to imply it shouldn't be componentscanned unless you wanted it to be globally used (which I am fine with): The FooConfiguration has to be @configuration but take care that it is not in a @componentscan for the main application context, otherwise it will be shared by all the @RibbonClients. |
yes, but you would also have to define you're own |
It would be nice to filter services by tag using the ConsulDiscoveryClient. Sometimes you only want some specific services in your application.
The text was updated successfully, but these errors were encountered: