Add possibility to get ILoadBalancer by name and instance of IClientConfig #459
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hi everybody!
I'd like to get ILoadBalancer by providing the name and IClientConfig instance. Currently we only have a way with Class<? extends IClientConfig> and in this case we will create an instance via newInstance() method.
But I need to provide the clientconfig instance created by myself, because it could be created with some additional parameters, could be configured in a special way (especially when i have to provide some parameters dynamically). In other words I need to provide the prepared IClientConfig instance instead of creation a new one.
Also I want to return an existed loadbalancer (if it exists), that's why I can't use registerNamedLoadBalancerFromclientConfig method because it throws an exception if the balancer exists.
Currently I use reflection to get an access to namedLBMap to get balancer by name and call registerNamedLoadBalancerFromclientConfig if it doesn't exist.
I can provide more details if it is required.
Looking forward to your answers! Thanks!