当前位置: 首页>>代码示例>>Java>>正文


Java HttpServerConfig类代码示例

本文整理汇总了Java中io.advantageous.qbit.http.config.HttpServerConfig的典型用法代码示例。如果您正苦于以下问题:Java HttpServerConfig类的具体用法?Java HttpServerConfig怎么用?Java HttpServerConfig使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


HttpServerConfig类属于io.advantageous.qbit.http.config包,在下文中一共展示了HttpServerConfig类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getHttpServerAndRoutes

import io.advantageous.qbit.http.config.HttpServerConfig; //导入依赖的package包/类
private HttpServer getHttpServerAndRoutes(final io.vertx.core.http.HttpServer vertxHttpServer, final Router router) {

        /* Route everything under /v1 to QBit http server. */
        final Route qbitRoute = router.route().path("/v1/*");



        /*
         * Use the VertxHttpServerBuilder which is a special builder for Vertx/Qbit integration.
         */
        return VertxHttpServerBuilder.vertxHttpServerBuilder()
                .setRoute(qbitRoute)
                .setHttpServer(vertxHttpServer)
                .setVertx(getVertx())
                .setConfig(new HttpServerConfig()) //not needed in master branch of qbit workaround for bug
                .build();
    }
 
开发者ID:MammatusTech,项目名称:qbit-microservices-examples,代码行数:18,代码来源:VertxTodoServiceVerticle.java

示例2: start

import io.advantageous.qbit.http.config.HttpServerConfig; //导入依赖的package包/类
@Override
     public void start() throws Exception {

         managedServiceBuilder.setRootURI("/v1");
         managedServiceBuilder.enableRequestChain();

         final Vertx vertx = getVertx();
/* Vertx HTTP Server. */
         final io.vertx.core.http.HttpServer vertxHttpServer =
                 vertx.createHttpServer();

/* Route one call to a vertx handler. */
         final Router router = Router.router(vertx); //Vertx router

/* Route everything under /v1 to QBit http server. */
         final Route qbitRoute = router.route().path("/v1/*");

/*
 * Use the VertxHttpServerBuilder which is a special builder for Vertx/Qbit integration.
 */
         VertxHttpServerBuilder vertxHttpServerBuilder =  VertxHttpServerBuilder.vertxHttpServerBuilder();


         final HttpServer httpServer=  vertxHttpServerBuilder
                 .setRoute(qbitRoute)
                 .setHttpServer(vertxHttpServer)
                 .setVertx(vertx)
                 .setConfig(new HttpServerConfig())
                 .build();

         vertxHttpServerBuilder.addShouldContinueHttpRequestPredicate(request -> {
             System.out.println("BODY " + request.getBodyAsString());

             System.out.println("FORM PARAMS " + request.getFormParams());
             return true;
         } );
         managedServiceBuilder.addEndpointService(new FormSubmit());


/*
 * Create and start new service endpointServer.
 */
         managedServiceBuilder.getEndpointServerBuilder()
                 .setHttpServer(httpServer)
                 .build()
                 .startServer();

/*
 * Associate the router as a request handler for the vertxHttpServer.
 */
         vertxHttpServer.requestHandler(router::accept).listen(
                 managedServiceBuilder.getPort());

     }
 
开发者ID:advantageous,项目名称:qbit-extensions,代码行数:55,代码来源:FormSubmit.java

示例3: setHttpServerConfig

import io.advantageous.qbit.http.config.HttpServerConfig; //导入依赖的package包/类
public HttpServerBuilder setHttpServerConfig(HttpServerConfig httpServerConfig) {
    this.httpServerConfig = httpServerConfig;
    return this;
}
 
开发者ID:advantageous,项目名称:qbit,代码行数:5,代码来源:HttpServerBuilder.java

示例4: setConfig

import io.advantageous.qbit.http.config.HttpServerConfig; //导入依赖的package包/类
public HttpServerBuilder setConfig(HttpServerConfig config) {
    this.httpServerConfig = config;
    return this;
}
 
开发者ID:advantageous,项目名称:qbit,代码行数:5,代码来源:HttpServerBuilder.java

示例5: withConfig

import io.advantageous.qbit.http.config.HttpServerConfig; //导入依赖的package包/类
public HttpServerBuilder withConfig(Consumer<HttpServerConfig> config) {
    config.accept(this.httpServerConfig);
    return this;
}
 
开发者ID:advantageous,项目名称:qbit,代码行数:5,代码来源:HttpServerBuilder.java


注:本文中的io.advantageous.qbit.http.config.HttpServerConfig类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。