You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@apisix.apache.org by GitBox <gi...@apache.org> on 2020/10/14 11:45:21 UTC

[GitHub] [apisix] haifeng9414 opened a new issue #2423: request help: radixtree_host_uri does not consider routing priority

haifeng9414 opened a new issue #2423:
URL: https://github.com/apache/apisix/issues/2423


   ### Issue description
   Why does radixtree_host_uri.lua not set the priority when creating a route:
   ```
   local radixtree_route = {
           paths = route.value.uris or route.value.uri,
           methods = route.value.methods,
           remote_addrs = route.value.remote_addrs
                          or route.value.remote_addr,
           vars = route.value.vars,
           filter_fun = filter_fun,
           handler = function (api_ctx)
               api_ctx.matched_params = nil
               api_ctx.matched_route = route
           end
       }
   ```
   Is this a bug?
   
   * apisix version (cmd: `apisix version`): latest master(4f535e7401468c3f857cbf6a83ed6c3a0a9496db)
   


----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [apisix] haifeng9414 commented on issue #2423: request help: radixtree_host_uri does not consider routing priority

Posted by GitBox <gi...@apache.org>.
haifeng9414 commented on issue #2423:
URL: https://github.com/apache/apisix/issues/2423#issuecomment-709688380


   The priority of the route is not set in radixtree_host_uri.lua. Even if the route has a priority, the priority of the route is the default value.


----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [apisix] haifeng9414 edited a comment on issue #2423: request help: radixtree_host_uri does not consider routing priority

Posted by GitBox <gi...@apache.org>.
haifeng9414 edited a comment on issue #2423:
URL: https://github.com/apache/apisix/issues/2423#issuecomment-709688380


   @membphis 
   `radixtree_uri.lua`文件创建`radixtree_router`对象的时候设置了路由的priority属性,但是`radixtree_host_uri.lua`文件没有,如果我用`radixtree_host_uri`作为路由实现,配置两个域名和uri相同,优先级不同的路由,路由的优先级能起作用吗?
   下面是两个文件创建`radixtree_router`对象的代码:
   ```
   -- radixtree_uri.lua
   core.table.insert(uri_routes, {
       paths = route.value.uris or route.value.uri,
       methods = route.value.methods,
       priority = route.value.priority, -- 这里设置了路由的优先级
       hosts = route.value.hosts or route.value.host,
       remote_addrs = route.value.remote_addrs
                      or route.value.remote_addr,
       vars = route.value.vars,
       filter_fun = filter_fun,
       handler = function (api_ctx)
           api_ctx.matched_params = nil
           api_ctx.matched_route = route
       end
   })
   ```
   
   ```
   -- radixtree_host_uri.lua
   local radixtree_route = {
       paths = route.value.uris or route.value.uri,
       methods = route.value.methods,
       -- 这里没有设置路由的优先级
       remote_addrs = route.value.remote_addrs
                      or route.value.remote_addr,
       vars = route.value.vars,
       filter_fun = filter_fun,
       handler = function (api_ctx)
           api_ctx.matched_params = nil
           api_ctx.matched_route = route
       end
   }
   ```


----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [apisix] membphis commented on issue #2423: request help: radixtree_host_uri does not consider routing priority

Posted by GitBox <gi...@apache.org>.
membphis commented on issue #2423:
URL: https://github.com/apache/apisix/issues/2423#issuecomment-710074433


   @haifeng9414 many thx for your report. would you like to fix this issue?


----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [apisix] haifeng9414 edited a comment on issue #2423: request help: radixtree_host_uri does not consider routing priority

Posted by GitBox <gi...@apache.org>.
haifeng9414 edited a comment on issue #2423:
URL: https://github.com/apache/apisix/issues/2423#issuecomment-709688380


   `radixtree_uri.lua`文件创建`radixtree_router`对象的时候设置了路由的priority属性,但是`radixtree_host_uri.lua`文件没有,如果我用`radixtree_host_uri`作为路由实现,配置两个域名和uri相同,优先级不同的路由,路由的优先级能起作用吗?
   下面是两个文件创建`radixtree_router`对象的代码:
   ```
   -- radixtree_uri.lua
   core.table.insert(uri_routes, {
       paths = route.value.uris or route.value.uri,
       methods = route.value.methods,
       priority = route.value.priority, -- 这里设置了路由的优先级
       hosts = route.value.hosts or route.value.host,
       remote_addrs = route.value.remote_addrs
                      or route.value.remote_addr,
       vars = route.value.vars,
       filter_fun = filter_fun,
       handler = function (api_ctx)
           api_ctx.matched_params = nil
           api_ctx.matched_route = route
       end
   })
   ```
   
   ```
   -- radixtree_host_uri.lua
   local radixtree_route = {
       paths = route.value.uris or route.value.uri,
       methods = route.value.methods,
       -- 这里没有设置路由的优先级
       remote_addrs = route.value.remote_addrs
                      or route.value.remote_addr,
       vars = route.value.vars,
       filter_fun = filter_fun,
       handler = function (api_ctx)
           api_ctx.matched_params = nil
           api_ctx.matched_route = route
       end
   }
   ```


----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [apisix] membphis closed issue #2423: request help: radixtree_host_uri does not consider routing priority

Posted by GitBox <gi...@apache.org>.
membphis closed issue #2423:
URL: https://github.com/apache/apisix/issues/2423


   


----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [apisix] haifeng9414 edited a comment on issue #2423: request help: radixtree_host_uri does not consider routing priority

Posted by GitBox <gi...@apache.org>.
haifeng9414 edited a comment on issue #2423:
URL: https://github.com/apache/apisix/issues/2423#issuecomment-709688380


   `radixtree_uri.lua`文件创建`radixtree_router`对象的时候设置了路由的priority属性,但是`radixtree_host_uri.lua`文件没有,如果我用`radixtree_host_uri`作为路由实现,配置两个域名相同,优先级不同的路由,路由的优先级能起作用吗?
   下面是两个文件创建`radixtree_router`对象的代码:
   ```
   -- radixtree_uri.lua
   core.table.insert(uri_routes, {
       paths = route.value.uris or route.value.uri,
       methods = route.value.methods,
       priority = route.value.priority, -- 这里设置了路由的优先级
       hosts = route.value.hosts or route.value.host,
       remote_addrs = route.value.remote_addrs
                      or route.value.remote_addr,
       vars = route.value.vars,
       filter_fun = filter_fun,
       handler = function (api_ctx)
           api_ctx.matched_params = nil
           api_ctx.matched_route = route
       end
   })
   ```
   
   ```
   -- radixtree_host_uri.lua
   local radixtree_route = {
       paths = route.value.uris or route.value.uri,
       methods = route.value.methods,
       -- 这里没有设置路由的优先级
       remote_addrs = route.value.remote_addrs
                      or route.value.remote_addr,
       vars = route.value.vars,
       filter_fun = filter_fun,
       handler = function (api_ctx)
           api_ctx.matched_params = nil
           api_ctx.matched_route = route
       end
   }
   ```


----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [apisix] membphis commented on issue #2423: request help: radixtree_host_uri does not consider routing priority

Posted by GitBox <gi...@apache.org>.
membphis commented on issue #2423:
URL: https://github.com/apache/apisix/issues/2423#issuecomment-709462127


   https://github.com/apache/apisix/blob/master/doc/admin-api.md#route
   
   ![image](https://user-images.githubusercontent.com/6814606/96162628-56e8e700-0f4b-11eb-94db-9754f89df89e.png)
   


----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [apisix] haifeng9414 commented on issue #2423: request help: radixtree_host_uri does not consider routing priority

Posted by GitBox <gi...@apache.org>.
haifeng9414 commented on issue #2423:
URL: https://github.com/apache/apisix/issues/2423#issuecomment-710752441


   > @haifeng9414 many thx for your report. would you like to fix this issue?
   
   Yes, I would


----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org