You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@apisix.apache.org by Zexuan Luo <sp...@apache.org> on 2020/12/23 01:52:31 UTC

[DISCUSS] the execution order of between global rule and plugin?

Currently, global rule is executed before any plugin or script (compiled
from plugin orchestration).
There are some issues think it would be better to change the execution
order, like
https://github.com/apache/apisix/issues/3082
https://github.com/apache/apisix/issues/2711

Some suggest the global rule should be interlaced with plugin.

However, I have a different idea. We can add a postpone mark to some global
rule, and then the global rule will be executed like:
global rule -> plugin -> postponed global rule

This way has some advantages:
1. it is backward compatibility
2. it doesn't conflict with the plugin orchestration

If we interlace global rule and plugin, it is hard to put global rule into
plugin orchestration and make it correct (think about reference between
rules and compiled code...).

What about your opinion?

Re: [DISCUSS] the execution order of between global rule and plugin?

Posted by dabue <da...@163.com>.
I think the reason for the issue "https://github.com/apache/apisix/issues/3082" is not hit the route,  so got the unexpected result.

It didn't reach the phase to match route.



dabue
 
From: Zexuan Luo
Date: 2020-12-23 09:52
To: dev
Subject: [DISCUSS] the execution order of between global rule and plugin?
Currently, global rule is executed before any plugin or script (compiled
from plugin orchestration).
There are some issues think it would be better to change the execution
order, like
https://github.com/apache/apisix/issues/3082
https://github.com/apache/apisix/issues/2711
 
Some suggest the global rule should be interlaced with plugin.
 
However, I have a different idea. We can add a postpone mark to some global
rule, and then the global rule will be executed like:
global rule -> plugin -> postponed global rule
 
This way has some advantages:
1. it is backward compatibility
2. it doesn't conflict with the plugin orchestration
 
If we interlace global rule and plugin, it is hard to put global rule into
plugin orchestration and make it correct (think about reference between
rules and compiled code...).
 
What about your opinion?