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

org.nustaq.kontraktor.routing.WSKrouterStarter Maven / Gradle / Ivy

There is a newer version: 5.2.0
Show newest version
package org.nustaq.kontraktor.routing;

import org.nustaq.kontraktor.remoting.http.undertow.WebSocketPublisher;
import org.nustaq.kontraktor.routers.Routing;
import org.nustaq.kontraktor.util.Log;

import java.util.Arrays;

public class WSKrouterStarter {

    public static void main(String[] args) {
        WSKrouterStarterConfig read = WSKrouterStarterConfig.read();
        Arrays.stream( read.getServices() )
            .forEach( routedServiceEntry -> {
                Log.Info(WSKrouterStarter.class,"start "+routedServiceEntry.strategy+":"+routedServiceEntry.encoding+"@"+routedServiceEntry.getPath());
                Routing.start(
                    routedServiceEntry.getStrategy().getClazz(),
                    new WebSocketPublisher()
                        .hostName(read.getHost())
                        .port(read.getPort())
                        .urlPath(routedServiceEntry.getPath())
                        .serType(routedServiceEntry.getEncoding())

                );
            });
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy