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 2022/03/03 14:22:28 UTC

[GitHub] [apisix] nfrankel opened a new issue #6504: feat: As a User, I want to be able to configure the priority of each plugin so I don't need to change the source code

nfrankel opened a new issue #6504:
URL: https://github.com/apache/apisix/issues/6504


   ### Issue description
   
   ### Use-case
   
   To test a new version of my endpoint, I want to use the [proxy-mirror plugin](https://apisix.apache.org/docs/apisix/plugins/proxy-mirror).
   
   The incoming request is `/v1/hello`. I'm using the [proxy-rewrite plugin](https://apisix.apache.org/docs/apisix/plugins/proxy-rewrite) to rewrite the path to `/hello` before sending it to the upstream. However, the priority of `proxy-rewrite` is 1008; the priority of proxy-mirror 1010.
   
   For this reason, the mirroring is first applied, sending `/v1/hello` to the mirror host, and only then is the rewrite applied, sending `/hello` to the nominal upstream. The mirror returns 404, as it doesn't know about `v1`. I need the opposite, first rewrite, then mirror.
   
   ### Alternative solutions
   
   * Change the respective priority of `proxy-mirror` and `proxy-rewrite` to execute rewrite before mirror.
   
       **Pro**: easy fix
       **Cons**:
   
       * Breaking change
       * Some users may want to keep the current order
   
   * Move the ordering to configuration. Instead of having the priority in the source code, make it a runtime concern.
   
       **Pro**: very flexible
       **Cons**: 
   
       * Breaking change
       * Require configuring the order, even if the current one fits
       
   * Allow to override default order. Keep the default priority in the source code, but allows overriding it in configuration
   
       **Pro**:
   
       * Very flexible
       * Compatible with existing usage
   
       **Con**: design and development effort


-- 
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: notifications-unsubscribe@apisix.apache.org

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



[GitHub] [apisix] nfrankel commented on issue #6504: feat: As a User, I want to be able to configure the priority of each plugin so I don't need to change the source code

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


   ### Another use-case
   
   I want to use the [kafka-logger plugin](https://apisix.apache.org/docs/apisix/plugins/kafka-logger) to send data to Kafka and use them to bill users.
   
   The plugin's priority is [403](https://github.com/apache/apisix/blob/master/apisix/plugins/kafka-logger.lua#L99), thus it runs before the upstream. If the upstream is down, data is written anyway and user will be billed wrongly.


-- 
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: notifications-unsubscribe@apisix.apache.org

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



[GitHub] [apisix] tokers commented on issue #6504: feat: As a User, I want to be able to configure the priority of each plugin so I don't need to change the source code

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


   Some other solutions like Gateway APIs, they just run the plugins / filters according to the order the users defined, so that users won't be overwhelmed by the priority.


-- 
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: notifications-unsubscribe@apisix.apache.org

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



[GitHub] [apisix] spacewander commented on issue #6504: feat: As a User, I want to be able to configure the priority of each plugin so I don't need to change the source code

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


   Sorry for not being able to reply to this issue. I am too busy those days. Personally, I agree with allowing the user to specify the order.


-- 
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: notifications-unsubscribe@apisix.apache.org

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