public SparknginServer() throws Exception { FileUtil.removeIfExist("build/queue", false); forwarder = new NullDevMessageForwarder(); server = new HttpServer(); server.setPort(7080); metricRegistry = new MetricRegistry(); server.add( "/message/json", new JSONMessageRouteHandler(new Sparkngin(metricRegistry, forwarder, "build/queue/data"))); server.setDefault(new StaticFileHandler(".")); server.startAsDeamon(); Thread.sleep(2000); }
public HttpServerSimulator start() { server.startAsDeamon(); return this; }