kitex-contrib / kitexcall

A command line tool for sending requests using kitex
Apache License 2.0
5 stars 2 forks source link

Proposal: service discovery plugin #3

Open felix021 opened 1 month ago

felix021 commented 1 month ago

To implement a mechanism (protocol) for invoking external command for service discovery.

For example, by introducing following arguments:

-service-discovery-name EchoService
-service-discovery-cmd etcd-lookup
-service-discovery-args host=127.0.0.1:2379,key=value

to instruct kitexcall calling etcd-lookup -host 127.0.0.1:2379 -key value EchoService who shall return a list of instances which can be used with client.WithHostPorts.

felix021 commented 1 month ago

Another approach may be to send the arguments via stdin in JSON format, since "-key value" are more likely bound to golang, which is not convenient for tools in other languages.