You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by GitBox <gi...@apache.org> on 2018/03/04 20:08:03 UTC

[GitHub] sijie commented on a change in pull request #1325: Rename pulsar function api from V1 to V2

sijie commented on a change in pull request #1325: Rename pulsar function api from V1 to V2
URL: https://github.com/apache/incubator-pulsar/pull/1325#discussion_r172062425
 
 

 ##########
 File path: pulsar-functions/worker/src/main/java/org/apache/pulsar/functions/worker/rest/WorkerServer.java
 ##########
 @@ -49,7 +55,17 @@ public WorkerServer(WorkerService workerService) {
     @Override
     public void run() {
         final Server server = new Server(this.workerConfig.getWorkerPort());
-        server.setHandler(WorkerService.newServletContextHandler("/", workerService));
+
+        List<Handler> handlers = new ArrayList<>(2);
+        handlers.add(WorkerService.newServletContextHandler("/admin", workerService));
+        handlers.add(WorkerService.newServletContextHandler("/admin/v2", workerService));
 
 Review comment:
   @merlimat : 
   
   the reason I did this because current function tools extends pulsar admin, pulsar admin still uses v1 api not v2 api. so if I only added in `/admin/v2/functions`, the functions cli will be broken. so I temporarily add it to both v1 and v2 endpoints. we should remove the v1 endpoint after switching pulsar-admin to use v2 endpoints (#1278).
   
   does that make sense?

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services