Class 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
    • Constructor Detail

      • LoadBalancingRouterProxyClient

        public LoadBalancingRouterProxyClient()
      • LoadBalancingRouterProxyClient

        public LoadBalancingRouterProxyClient​(io.undertow.client.UndertowClient client)
    • Method Detail

      • getProblemServerRetry

        public int getProblemServerRetry()
      • getConnectionsPerThread

        public int getConnectionsPerThread()
      • getMaxQueueSize

        public int getMaxQueueSize()
      • addHosts

        public void addHosts​(String serviceId,
                             String envTag)
      • findTarget

        public io.undertow.server.handlers.proxy.ProxyClient.ProxyTarget findTarget​(io.undertow.server.HttpServerExchange exchange)
        Specified by:
        findTarget in interface io.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:
        getConnection in interface io.undertow.server.handlers.proxy.ProxyClient
      • closeCurrentConnections

        public void closeCurrentConnections()
        Should only be used for tests

        DO NOT CALL THIS METHOD WHEN REQUESTS ARE IN PROGRESS

        It is not thread safe so internal state can get messed up.