Class LoadBalancingRouterProxyClient
- java.lang.Object
-
- io.undertow.server.handlers.proxy.LoadBalancingRouterProxyClient
-
- All Implemented Interfaces:
io.undertow.server.handlers.proxy.ProxyClient
public class LoadBalancingRouterProxyClient extends Object implements io.undertow.server.handlers.proxy.ProxyClient
This is a proxy client that supports multiple downstream services.- Author:
- Steve Hu
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description classLoadBalancingRouterProxyClient.Hoststatic interfaceLoadBalancingRouterProxyClient.HostSelector
-
Constructor Summary
Constructors Constructor Description LoadBalancingRouterProxyClient()LoadBalancingRouterProxyClient(io.undertow.client.UndertowClient client)LoadBalancingRouterProxyClient(io.undertow.client.UndertowClient client, LoadBalancingRouterProxyClient.HostSelector hostSelector)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddHosts(String serviceId, String envTag)voidcloseCurrentConnections()Should only be used for testsio.undertow.server.handlers.proxy.ProxyClient.ProxyTargetfindTarget(io.undertow.server.HttpServerExchange exchange)voidgetConnection(io.undertow.server.handlers.proxy.ProxyClient.ProxyTarget target, io.undertow.server.HttpServerExchange exchange, io.undertow.server.handlers.proxy.ProxyCallback<io.undertow.server.handlers.proxy.ProxyConnection> callback, long timeout, TimeUnit timeUnit)intgetConnectionsPerThread()intgetMaxQueueSize()intgetProblemServerRetry()protected LoadBalancingRouterProxyClient.HostselectHost(io.undertow.server.HttpServerExchange exchange)LoadBalancingRouterProxyClientsetConnectionsPerThread(int connectionsPerThread)LoadBalancingRouterProxyClientsetMaxQueueSize(int maxQueueSize)LoadBalancingRouterProxyClientsetOptionMap(org.xnio.OptionMap options)LoadBalancingRouterProxyClientsetProblemServerRetry(int problemServerRetry)LoadBalancingRouterProxyClientsetSoftMaxConnectionsPerThread(int softMaxConnectionsPerThread)LoadBalancingRouterProxyClientsetSsl(org.xnio.ssl.XnioSsl ssl)LoadBalancingRouterProxyClientsetTtl(int ttl)
-
-
-
Constructor Detail
-
LoadBalancingRouterProxyClient
public LoadBalancingRouterProxyClient()
-
LoadBalancingRouterProxyClient
public LoadBalancingRouterProxyClient(io.undertow.client.UndertowClient client)
-
LoadBalancingRouterProxyClient
public LoadBalancingRouterProxyClient(io.undertow.client.UndertowClient client, LoadBalancingRouterProxyClient.HostSelector hostSelector)
-
-
Method Detail
-
setSsl
public LoadBalancingRouterProxyClient setSsl(org.xnio.ssl.XnioSsl ssl)
-
setOptionMap
public LoadBalancingRouterProxyClient setOptionMap(org.xnio.OptionMap options)
-
setProblemServerRetry
public LoadBalancingRouterProxyClient setProblemServerRetry(int problemServerRetry)
-
getProblemServerRetry
public int getProblemServerRetry()
-
getConnectionsPerThread
public int getConnectionsPerThread()
-
setConnectionsPerThread
public LoadBalancingRouterProxyClient setConnectionsPerThread(int connectionsPerThread)
-
getMaxQueueSize
public int getMaxQueueSize()
-
setMaxQueueSize
public LoadBalancingRouterProxyClient setMaxQueueSize(int maxQueueSize)
-
setTtl
public LoadBalancingRouterProxyClient setTtl(int ttl)
-
setSoftMaxConnectionsPerThread
public LoadBalancingRouterProxyClient setSoftMaxConnectionsPerThread(int softMaxConnectionsPerThread)
-
findTarget
public io.undertow.server.handlers.proxy.ProxyClient.ProxyTarget findTarget(io.undertow.server.HttpServerExchange exchange)
- Specified by:
findTargetin interfaceio.undertow.server.handlers.proxy.ProxyClient
-
getConnection
public void getConnection(io.undertow.server.handlers.proxy.ProxyClient.ProxyTarget target, io.undertow.server.HttpServerExchange exchange, io.undertow.server.handlers.proxy.ProxyCallback<io.undertow.server.handlers.proxy.ProxyConnection> callback, long timeout, TimeUnit timeUnit)- Specified by:
getConnectionin interfaceio.undertow.server.handlers.proxy.ProxyClient
-
selectHost
protected LoadBalancingRouterProxyClient.Host selectHost(io.undertow.server.HttpServerExchange exchange)
-
closeCurrentConnections
public void closeCurrentConnections()
Should only be used for testsDO NOT CALL THIS METHOD WHEN REQUESTS ARE IN PROGRESS
It is not thread safe so internal state can get messed up.
-
-