Mixer out-of-process adapter in something other than golang


#1

Hi everyone,

As far as I understand, Mixer’s out-of-process adapter is simply a gRPC server, and therefore I should be able to implement it in any language. I have a very good reason to implement my adapter in C#, so I’m looking for pointers as to what’s really happening inside of that gcr.io/istio-testing/protoc:2018-06-12 image that generates gRPC golang code for me. Is it some magic that is difficult to replicate for other languages? Or can I just call protoc myself on the .proto definition file and generate contrac code in any language I need?

Please let me know.

Best regards,
Alex


#2

It’s just gRPC. You should be able to use any language to implement the appropriate interfaces.


#3

I have the same question (I want to write a mixer adapter in Java). Can you please provide more details on how to do that? It will be great if there is an example for an out-of-process adapter in another language, that will be very helpful to bring people (who have to write adapter in other language for various reasons) on board with mixer adapter.


#4

I did it in C#. Basically just follow the same walk-through as for Go, except when it comes to generating code from proto definitions - run protoc for your own language rather than using that Istio-supplied container for golang. See here for reference: https://grpc.io/docs/tutorials/
I got mine to work with the same proto files as golang, except I had to comment out certain go-specific meta commands in a couple of places.
Once you have your gRPC service definition - just use it as directed by grpc.io for that language.