I was working with kong then wanted to understand how will kong know which plugin to execute for a request that has just arrived at the gateway.
Let's say we have configured rate limit plugin on a service entity and has a route associated with it how will kong now know it has to execute rate limit plugin when a request comes on that route.
Is it based on the plugin configuration? If so does kong pull in this details from the Database
Please explain the mechanism of plugin execution.
PS: I'm aware of the execution order but not how kong decides which plugin to execute.
Not sure to understand what you are looking for.
Of course this is based on the plugin configuration. The configuration of the plugins is stored as your kong configuration, you can configure it to be in memory or in database, see datastore section for more details
If you have question when you have several plugins, the plugins have a hardcoded priority to know the order of execution, see plugins order
If you question is which plugins will be executed, the Plugins can be configured for various entities, combination of entities, or even globally.
A plugin will always be run once and only once per request. But the configuration with which it will run depends on the entities it has been configured for. The more specific a plugin is with regards to how many entities it has been configured on, the higher its priority, you can get more details about precedence