zengkui opened a new issue, #1780:
URL: https://github.com/apache/incubator-brpc/issues/1780

   **Is your feature request related to a problem? (你需要的功能是否与某个问题有关?)**
   client针对http server做健康检查,有时是依赖下游结点的一个标志文件,比如nginx里就经常会touch
    status.html 作为心跳标志文件。 当用brpc来替换这个http服务的时候,好像健康检查只能是/health 
   为了迁移不影响上下游模块,这个访问路径希望能支持restful mapping
   
   **Describe the solution you'd like (描述你期望的解决方法)**
   1.   在server.cpp里添加一个gflag变量,获取restful mapping
   2.  重载AddBuiltinService方法,支持传入option。 demo如下:
   ```cpp
       if (!FLAGS_restful_mapping_health_check_path.empty()) {
         LOG(INFO) << "health check path " << 
FLAGS_restful_mapping_health_check_path;
         ServiceOptions options;
         options.restful_mappings = FLAGS_restful_mapping_health_check_path;
         // override AddBulitinService, add restfull mappings to options
         if (AddBuiltinService(new (std::nothrow) HealthService, &options)) {
           LOG(ERROR) << "Fail to add HealthService";
           return -1;
         }
       } else if (AddBuiltinService(new (std::nothrow) HealthService)) {
           LOG(ERROR) << "Fail to add HealthService";
           return -1;
       }
   ```
   
   **Describe alternatives you've considered (描述你想到的折衷方案)**
   
   **Additional context/screenshots (更多上下文/截图)**
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to