T - corresponds to Target.type()public class LoadBalancingTarget<T> extends Object implements Target<T>
loadbalancer-aware targets.
Using this will enable dynamic url discovery via ribbon including incrementing server request
counts. MyService api = Feign.builder().target(LoadBalancingTarget.create(MyService.class, "http://myAppProd"))Where
myAppProd is the ribbon loadbalancer name and myAppProd.ribbon.listOfServers configuration is set.Target.EmptyTarget<T>, Target.HardCodedTarget<T>| Modifier | Constructor and Description |
|---|---|
protected |
LoadBalancingTarget(Class<T> type,
String scheme,
String name)
Deprecated.
|
protected |
LoadBalancingTarget(Class<T> type,
String scheme,
String name,
String path) |
| Modifier and Type | Method and Description |
|---|---|
Request |
apply(RequestTemplate input) |
static <T> LoadBalancingTarget<T> |
create(Class<T> type,
String url)
Creates a target which dynamically derives urls from a
loadbalancer. |
boolean |
equals(Object obj) |
int |
hashCode() |
com.netflix.loadbalancer.AbstractLoadBalancer |
lb()
current load balancer for the target.
|
String |
name() |
String |
toString() |
Class<T> |
type() |
String |
url() |
@Deprecated protected LoadBalancingTarget(Class<T> type, String scheme, String name)
public static <T> LoadBalancingTarget<T> create(Class<T> type, String url)
loadbalancer.type - corresponds to Target.type()url - naming convention is https://name or http://name/api/v2 where name
corresponds to ClientFactory.getNamedLoadBalancer(String)public com.netflix.loadbalancer.AbstractLoadBalancer lb()
public Request apply(RequestTemplate input)
Copyright © 2012–2016 OpenFeign. All rights reserved.