Package io.fabric8.gateway.loadbalancer

Examples of io.fabric8.gateway.loadbalancer.LoadBalancer


  }

  @Override
  public INodeStatistics getNodeStats(String nodeId) {
    if (nodeId != null) {
      CamelProcessorMBean processorMBean = camelContextNode.getProcessorMBean(nodeId);
      if (processorMBean != null) {
        return new ProcessorNodeStatistics(processorMBean);
      }
    }
    return null;
View Full Code Here


    HttpGatewayServer httpGatewayServer;
    public HttpGatewayServer startHttpGateway() {


        if( restEndpointServer!=null ) {
            LoadBalancer loadBalancer=new RoundRobinLoadBalancer();

            ServiceDTO serviceDetails = new ServiceDTO();
            serviceDetails.setContainer("local");
            serviceDetails.setVersion("1");
View Full Code Here

    public DetectingGateway startDetectingGateway() {

        String loadBalancerType = LoadBalancers.STICKY_LOAD_BALANCER;
        int stickyLoadBalancerCacheSize = LoadBalancers.STICKY_LOAD_BALANCER_DEFAULT_CACHE_SIZE;

        LoadBalancer serviceLoadBalancer = LoadBalancers.createLoadBalancer(loadBalancerType, stickyLoadBalancerCacheSize);

        ArrayList<Protocol> protocols = new ArrayList<Protocol>();
        protocols.add(new StompProtocol());
        protocols.add(new MqttProtocol());
        protocols.add(new AmqpProtocol());
View Full Code Here

    /**
     * Chooses a back end service from the set of destination templates
     */
    public UriTemplateDefinition chooseBackEndService(ClientRequestFacade requestFacade) {
        LoadBalancer loadBalancer = getLoadBalancer().getLoadBalancer();
        List<UriTemplateDefinition> uriDefList = new ArrayList<UriTemplateDefinition>(destinationUriTemplates);
        return loadBalancer.choose(uriDefList, requestFacade);
    }
View Full Code Here

    protected int requestCount = services.size() * 2;

    @Test
    public void testRandomLoadBalancer() throws Exception {
        LoadBalancer loadBalancer = new RandomLoadBalancer();
        assertLoadBalancerWorksOnEmptyOrSingletonServices(loadBalancer);
        List<String> results = performRequests(loadBalancer);
        Set<String> set = asSet(results);
        assertTrue("Should have most of the values but was: " + set, set.size() > 1);
    }
View Full Code Here

        return set;
    }

    @Test
    public void testRoundRobbinLoadBalancer() throws Exception {
        LoadBalancer loadBalancer = new RoundRobinLoadBalancer();
        assertLoadBalancerWorksOnEmptyOrSingletonServices(loadBalancer);
        List<String> results = performRequests(loadBalancer);
        Set<String> set = asSet(results);
        assertEquals("Should have all of the values: " + set, services.size(), set.size());
        for (String service : services) {
View Full Code Here

    @Test
    public void testStickyLoadBalancer() throws Exception {
        assertLoadBalancerWorksOnEmptyOrSingletonServices(new StickyLoadBalancer());

        LoadBalancer loadBalancer = new StickyLoadBalancer();
        Set<String> allRequests = new HashSet<String>();
        int numberOfClients = 10;
        for (int i = 0; i < numberOfClients; i++) {
            clientRequestKey = "newClient:" + i;
View Full Code Here

    public DetectingGateway createGateway() {

        String loadBalancerType = LoadBalancers.STICKY_LOAD_BALANCER;
        int stickyLoadBalancerCacheSize = LoadBalancers.STICKY_LOAD_BALANCER_DEFAULT_CACHE_SIZE;

        LoadBalancer serviceLoadBalancer = LoadBalancers.createLoadBalancer(loadBalancerType, stickyLoadBalancerCacheSize);

        ArrayList<Protocol> protocols = new ArrayList<Protocol>();
        protocols.add(new StompProtocol());
        protocols.add(new MqttProtocol());
        protocols.add(new AmqpProtocol());
View Full Code Here

        String zkPath = getZooKeeperPath();
        Objects.notNull(getGateway(), "gateway");
        Objects.notNull(zkPath, "zooKeeperPath");
        Objects.notNull(getUriTemplate(), "uriTemplate");

        LoadBalancer loadBalancer = LoadBalancers.createLoadBalancer(loadBalancerType, stickyLoadBalancerCacheSize);

        LOG.info("activating http mapping ZooKeeper path: " + zkPath + " with URI template: " + uriTemplate
                + " enabledVersion: " + enabledVersion + " with load balancer: " + loadBalancer);

        if (httpMappingRuleBase != null) {
View Full Code Here

        String zkPath = getZooKeeperPath();
        Objects.notNull(zkPath, "zooKeeperPath");
        Objects.notNull(getUriTemplate(), "uriTemplate");

        LoadBalancer loadBalancer = LoadBalancers.createLoadBalancer(loadBalancerType, stickyLoadBalancerCacheSize);

        LOG.info("activating http mapping ZooKeeper path: " + zkPath + " with URI template: " + uriTemplate
                + " enabledVersion: " + enabledVersion + " with load balancer: " + loadBalancer);

        if (httpMappingRuleBase != null) {
View Full Code Here

TOP

Related Classes of io.fabric8.gateway.loadbalancer.LoadBalancer

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.