Using multiple runtimes simultaneously

Hello Tyk folks!

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?

Thank you

Hi @Amanjeev_Sethi, just checked this with the team. You can have Go and GRPC and Python/JS all at the same time. :+1:

1 Like

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.

Also. in general a sample plugins written in Go? I see JS and Python sample here https://github.com/TykTechnologies/tyk/tree/master/middleware. I have found these two in Tyk org

But unsure if these are examples.

Thank you!

Unfortunately that is not possible - you can only use a single plugin type per API Definition. The alternative is Go plugin plus virtual endpoint.

We have a bunch of plugins here: https://github.com/TykTechnologies/tyk-awesome-plugins

1 Like

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?

Hi Amanjeev,

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.

Virtual Endpoints can only be written in JS.

Thanks!

1 Like

Thank you @sedky. I was afraid of this. Virtual Endpoints are a part of our Auth API which is separate so I guess that can remain untouched.

Is there a guide to port JS m/w to Go?