byThreadStrategy

Version

Dispatches each request to a node that has fewer than maxNumberOfThreadsPerEndpoint requests in flight, capping concurrency per node. When every node is at capacity it waits retryTimeOnBusy milliseconds and retries, up to five times, then fails the request with an error.

Example Configuration

balancer:
byThreadStrategy:
maxNumberOfThreadsPerEndpoint: 10
clusters:
- nodes:
- host: node1.predic8.com
port: 8080
balancer:
   byThreadStrategy:
     maxNumberOfThreadsPerEndpoint: 10
   clusters:
     - nodes:
         - host: node1.predic8.com
           port: 8080

Syntax

byThreadStrategy:
maxNumberOfThreadsPerEndpoint: <number>
retryTimeOnBusy: <number>
byThreadStrategy:
  maxNumberOfThreadsPerEndpoint: <number>
  retryTimeOnBusy: <number>

Attributes

NameRequiredDefaultDescriptionExamples
maxNumberOfThreadsPerEndpointfalse5Maximum number of requests allowed in flight per node at the same time.-
retryTimeOnBusyfalse1000Time in milliseconds to wait before retrying when all nodes are at capacity.-

Can be used in