Search in sources :

Example 6 with DetectingGateway

use of io.fabric8.gateway.handlers.detecting.DetectingGateway in project fabric8 by jboss-fuse.

the class ExtendedBurnIn method startDetectingGateway.

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());
    protocols.add(new OpenwireProtocol());
    protocols.add(new HttpProtocol());
    protocols.add(new SslProtocol());
    DetectingGateway gateway = new DetectingGateway();
    gateway.setPort(0);
    gateway.setVertx(vertx);
    SslConfig sslConfig = new SslConfig(new File(basedir(), "src/test/resources/server.ks"), "password");
    sslConfig.setKeyPassword("password");
    gateway.setSslConfig(sslConfig);
    gateway.setServiceMap(serviceMap);
    gateway.setProtocols(protocols);
    gateway.setServiceLoadBalancer(serviceLoadBalancer);
    gateway.setDefaultVirtualHost("broker1");
    gateway.setConnectionTimeout(5000);
    if (httpGatewayServer != null) {
        gateway.setHttpGateway(new InetSocketAddress("localhost", httpGatewayServer.getPort()));
    }
    gateway.init();
    gateways.add(gateway);
    return gateway;
}
Also used : DetectingGateway(io.fabric8.gateway.handlers.detecting.DetectingGateway) SslProtocol(io.fabric8.gateway.handlers.detecting.protocol.ssl.SslProtocol) InetSocketAddress(java.net.InetSocketAddress) RoundRobinLoadBalancer(io.fabric8.gateway.loadbalancer.RoundRobinLoadBalancer) LoadBalancer(io.fabric8.gateway.loadbalancer.LoadBalancer) MqttProtocol(io.fabric8.gateway.handlers.detecting.protocol.mqtt.MqttProtocol) OpenwireProtocol(io.fabric8.gateway.handlers.detecting.protocol.openwire.OpenwireProtocol) SslConfig(io.fabric8.gateway.handlers.detecting.protocol.ssl.SslConfig) HttpProtocol(io.fabric8.gateway.handlers.detecting.protocol.http.HttpProtocol) StompProtocol(io.fabric8.gateway.handlers.detecting.protocol.stomp.StompProtocol) AmqpProtocol(io.fabric8.gateway.handlers.detecting.protocol.amqp.AmqpProtocol) MqttProtocol(io.fabric8.gateway.handlers.detecting.protocol.mqtt.MqttProtocol) SslProtocol(io.fabric8.gateway.handlers.detecting.protocol.ssl.SslProtocol) StompProtocol(io.fabric8.gateway.handlers.detecting.protocol.stomp.StompProtocol) AmqpProtocol(io.fabric8.gateway.handlers.detecting.protocol.amqp.AmqpProtocol) HttpProtocol(io.fabric8.gateway.handlers.detecting.protocol.http.HttpProtocol) OpenwireProtocol(io.fabric8.gateway.handlers.detecting.protocol.openwire.OpenwireProtocol) Protocol(io.fabric8.gateway.handlers.detecting.Protocol) File(java.io.File)

Aggregations

AmqpProtocol (io.fabric8.gateway.handlers.detecting.protocol.amqp.AmqpProtocol)4 HttpProtocol (io.fabric8.gateway.handlers.detecting.protocol.http.HttpProtocol)4 MqttProtocol (io.fabric8.gateway.handlers.detecting.protocol.mqtt.MqttProtocol)4 OpenwireProtocol (io.fabric8.gateway.handlers.detecting.protocol.openwire.OpenwireProtocol)4 SslConfig (io.fabric8.gateway.handlers.detecting.protocol.ssl.SslConfig)4 SslProtocol (io.fabric8.gateway.handlers.detecting.protocol.ssl.SslProtocol)4 StompProtocol (io.fabric8.gateway.handlers.detecting.protocol.stomp.StompProtocol)4 LoadBalancer (io.fabric8.gateway.loadbalancer.LoadBalancer)4 DetectingGateway (io.fabric8.gateway.handlers.detecting.DetectingGateway)3 File (java.io.File)3 ArrayList (java.util.ArrayList)3 ShutdownException (io.fabric8.common.util.ShutdownTracker.ShutdownException)2 Protocol (io.fabric8.gateway.handlers.detecting.Protocol)2 ObjectName (javax.management.ObjectName)2 ShutdownTracker (io.fabric8.common.util.ShutdownTracker)1 VertxService (io.fabric8.gateway.fabric.support.vertx.VertxService)1 RoundRobinLoadBalancer (io.fabric8.gateway.loadbalancer.RoundRobinLoadBalancer)1 ByteArrayOutputStream (java.io.ByteArrayOutputStream)1 InputStream (java.io.InputStream)1 InetSocketAddress (java.net.InetSocketAddress)1