use of org.vertx.java.core.Vertx in project fabric8 by jboss-fuse.
the class FabricHTTPGateway method updateConfiguration.
private void updateConfiguration(Map<String, ?> configuration) throws Exception {
configurer.configure(configuration, this);
Vertx vertx = getVertx();
handler = new HttpGatewayHandler(vertx, this);
handler.setAddMissingTrailingSlashes(addMissingTrailingSlashes);
handler.setConnectionTimeout(connectionTimeout);
handler.setRequestTimeout(requestTimeout);
websocketHandler.setPathPrefix(websocketGatewayPrefix);
server = new HttpGatewayServer(vertx, handler, enableWebSocketGateway ? websocketHandler : null, port);
server.init();
}
use of org.vertx.java.core.Vertx in project fabric8 by jboss-fuse.
the class FabricMQGateway method createListener.
protected GatewayServiceTreeCache createListener() {
String zkPath = getZooKeeperPath();
// TODO we should discover the broker group configuration here using the same
// mq-create / mq-client profiles so that we only listen to a subset of the available brokers here?
ServiceMap serviceMap = new ServiceMap();
VertxService vertxService = getVertxService();
Vertx vertx = vertxService.getVertx();
CuratorFramework curator = getCurator();
LoadBalancer pathLoadBalancer = LoadBalancers.createLoadBalancer(loadBalancerType, stickyLoadBalancerCacheSize);
LoadBalancer serviceLoadBalancer = LoadBalancers.createLoadBalancer(loadBalancerType, stickyLoadBalancerCacheSize);
LOG.info("activating MQ mapping ZooKeeper path: " + zkPath + " host: " + host + " with load balancer: " + pathLoadBalancer);
List<TcpGateway> gateways = new ArrayList<TcpGateway>();
addGateway(gateways, vertx, serviceMap, "tcp", isOpenWireEnabled(), getOpenWirePort(), pathLoadBalancer, serviceLoadBalancer);
addGateway(gateways, vertx, serviceMap, "stomp", isStompEnabled(), getStompPort(), pathLoadBalancer, serviceLoadBalancer);
addGateway(gateways, vertx, serviceMap, "amqp", isAmqpEnabled(), getAmqpPort(), pathLoadBalancer, serviceLoadBalancer);
addGateway(gateways, vertx, serviceMap, "mqtt", isMqttEnabled(), getMqttPort(), pathLoadBalancer, serviceLoadBalancer);
addGateway(gateways, vertx, serviceMap, "ws", isWebsocketEnabled(), getWebsocketPort(), pathLoadBalancer, serviceLoadBalancer);
if (gateways.isEmpty()) {
return null;
}
return new GatewayServiceTreeCache(curator, zkPath, serviceMap, gateways);
}
Aggregations