Search code examples
kongkong-plugin

Multiple request transformers for kong API gateway


Using the Request Transformer plugin, we are transforming a query string to multiple headers. This is done globally for all our services.

We also want do other specific transformations for a subset of a services. From what I read here that does not seem to be possible.

Am I misunderstanding this? Is there perhaps a different way of doing it?


Solution

  • In my perspective, yes, this (the precedence of plugin execution) makes kind of impossible to do what you want using the Request Transformer plugin.

    The other way of doing it that i can imagine is adding to your Kong a custom plugin that would perform your "2nd phase" transformation. You could for example, fork the repo of the Request Transformer plugin itself (https://github.com/Kong/kong-plugin-request-transformer) , and add a second version of it to your Kong, and then you can apply two "different" request transforming plugins, but this seems kind of ugly.