Order in which Plugins are executed #7193
Replies: 15 comments
-
I agree. As the number of plugins grows it's hard to define what Having the order in the configuration is an option: plugins will be executed accordingly to their order in the Another option would be to sit down and look at the use cases that we have, and introduce some triggers in the lifecycle of the request, like:
Etc |
Beta Was this translation helpful? Give feedback.
-
Another link to #505 when redesigning the Model. |
Beta Was this translation helpful? Give feedback.
-
Hopefully this is still up for debate, but it seems to me that having some type of endpoints like /order/plugins and /order/apis/plugins or similar that returned and accepted an ordered list of plugins provides the best flexibility. This would allow the user to control the flow through plugins, and by default could be autosorted on the PRIORITY. |
Beta Was this translation helpful? Give feedback.
-
As it currently stands, what is the plugin order? Undefined? Edit: Sorry, here it is https://getkong.org/docs/0.11.x/plugin-development/custom-logic/ I'd say maybe a custom |
Beta Was this translation helpful? Give feedback.
-
On Thu, 31 Aug 2017 05:23:55 -0700 Jonathan ES Lin ***@***.***> wrote:
As it currently stands, what is the plugin order? Undefined?
Hi Jonathan.
The plugin execution/priority order is defined here - https://getkong.org/docs/0.11.x/plugin-development/custom-logic/#plugins-execution-order .
Best regards.
Guilherme Macedo
--
Sent from my Android device with K-9 Mail. Please excuse my brevity.
|
Beta Was this translation helpful? Give feedback.
-
Any more news on this issue? Being able to set priority order when applying the plugin would be great.
As it stands the only way to change priority is to fork the plugin and change it manually (as far as I am aware anyway). |
Beta Was this translation helpful? Give feedback.
-
If two plugins's phases and priority are same, which one will be executed first? |
Beta Was this translation helpful? Give feedback.
-
@samwonwyd In this case the order is (was) undefined. |
Beta Was this translation helpful? Give feedback.
-
@samwonwyd it is not undefined, it is sorted by plugin created_at. |
Beta Was this translation helpful? Give feedback.
-
Any update on this issue? Being allowed to easily change the plugins priorities would be greatly appreciated, as it would allow us to avoid forking a plugin just to change the PRIORITY constant value. In my case I would set the rate-limiting plugin priority higher than basic-Auth for instance, as the Current order prevents rate limiting protection against password bruteforce attackers |
Beta Was this translation helpful? Give feedback.
-
Just wondering, if any change to the plugin order be made, is it also possible to have a plugin executed more than once? for example applying rate-limit to route and route+consumer, to make sure that the route will serve max 100 tps but a certain consumer can only get max 10 tps on that route. I'm also thinking that this will benefit scripting-like plugin, maybe when we need to add some generic processing to a route but add some custom processing for a certain consumer without losing the generic processing done on the route. |
Beta Was this translation helpful? Give feedback.
-
In the end I ended up with the following steps in order to adress this issue :
I will stay tuned for this issue in case there is a cleaner, config-driven way to do this |
Beta Was this translation helpful? Give feedback.
-
this is insane that this issue is still opened after 6 years. I have very standard flow, i wanna rate limit based on header that i build in request transformation plugin. Is it really unique what i'm doing here? But i can't do that cause rate limiting happens before request transformation. |
Beta Was this translation helpful? Give feedback.
-
This request is, as simple as it might seem, a very complex one to implement. It is still on the radar however. Meanwhile this can be used as a workaround: https://github.com/Kong/priority-updater ping @brycehemme |
Beta Was this translation helpful? Give feedback.
-
we have a similar problem wherein we wanted to rate-limit the kong authentication calls so that callers do not misuse the oauth process itself. We use a double-hop approach for the auth request so that first hop acts as the rate limiter and the second hop acts as the oauth generator. Described here. |
Beta Was this translation helpful? Give feedback.
-
We need a better way than having a
PRIORITY
constant in a plugin's handler to decide the order of execution of the plugins. As the number of plugins grow, it's not intuitive.More appropriate would be putting the order in the configuration.
Beta Was this translation helpful? Give feedback.
All reactions