use of io.fabric8.gateway.fabric.support.http.HttpMappingZooKeeperTreeCache in project fabric8 by jboss-fuse.
the class HttpMappingRuleConfiguration method updateConfiguration.
private void updateConfiguration(Map<String, ?> configuration) throws Exception {
LOG.info("activating http mapping rule " + configuration);
configurer.configure(configuration, this);
LOG.info("activating http mapping rule " + zooKeeperPath + " on " + gateway.get().getPort());
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) {
gateway.get().removeMappingRuleConfiguration(httpMappingRuleBase);
}
httpMappingRuleBase = new HttpMappingRuleBase(new SimplePathTemplate(uriTemplate), gateway.get().getGatewayVersion(), enabledVersion, loadBalancer, reverseHeaders);
mappingTree = new HttpMappingZooKeeperTreeCache(curator.get(), httpMappingRuleBase, zooKeeperPath);
mappingTree.init();
gateway.get().addMappingRuleConfiguration(httpMappingRuleBase);
}
Aggregations