Last year I was working with Python plugins as middleware but learned the hard way that JS and Python cannot mix in one deployment of Tyk. This is because we already had an existing JS middleware.
Fast forward to today, we now see that Go is also an option and would like to leverage that. So the question I have is that can multiple runtimes be used, as in, can we mix middleware from different platforms in one Tyk deployment?
Thanks @Shreyas : this seems like a great improvement! This might let us leverage Go while not having to port JS middleware.
Is there an example of Go plugins living along side JS and Python plugins? I want to see what the Tyk config looks like and what is needed to achieve this.
Oh sorry, I perhaps misunderstood. We do have middleware in JS that needs to be in every API Definition. So, given your comment it seems that we won’t be able to combine a new middlware in Go with that JS middleware.
Another question regarding Virtual Endpoints: We have three Virtual Endpoints used in all API Definitions, but they are written in JS. Should those be changed as well?
You’re right - as of today, you can only have a single plugin type (Go/JS, etc) per API definition. You could port your existing JS middleware to Go or Python.
Adding a comment here to bump this up now that some time has passed. So, can we use multiple middleware runtimes at the same time in the current version of Tyk (3.x)?
Unfortunately that’s not something we’re planning on supporting, and I must admit that I don’t see the need for this.
Why not simply use Go for all your plugins? Furthermore, you could even simplify things by writing a single plugin with many methods, that way you only have to manage the deployment process for a single bundle.
That one GoPlugin would be extremely versatile and performant given that it’s GoLang, but you could manage both your global plugin and your individual ones in there.
This practice is a bottleneck as you scale, but it’s definitely helplful to simplify things in the short term.
+1 for supporting multiple runtimes simultaneously. We’d like to use Go plugin for things that impact every request due to its superior performance. However, when doing request and response transformations we prefer to work with Python. Additionally, you cannot specify extended_paths to run after response which makes this impossible to only invoke the Python functions when needed for responses.