All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.smallrye.stork.loadbalancer.requests.LeastRequestsLoadBalancerProvider Maven / Gradle / Ivy

Go to download

SmallRye Stork Load Balancer provider picking the instance with the least inflight requests

There is a newer version: 2.7.0
Show newest version
package io.smallrye.stork.loadbalancer.requests;

import jakarta.enterprise.context.ApplicationScoped;

import io.smallrye.stork.api.LoadBalancer;
import io.smallrye.stork.api.ServiceDiscovery;
import io.smallrye.stork.api.config.LoadBalancerType;
import io.smallrye.stork.spi.LoadBalancerProvider;

/**
 * A load balancer provider that picks the instance with the less inflight requests.
 */
@LoadBalancerType("least-requests")
@ApplicationScoped
public class LeastRequestsLoadBalancerProvider
        implements LoadBalancerProvider {

    @Override
    public LoadBalancer createLoadBalancer(LeastRequestsConfiguration config,
            ServiceDiscovery serviceDiscovery) {
        return new LeastRequestsLoadBalancer();
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy