RPC

Get Started with RPC in KubeMQ

Connect Your KubeMQ Cluster

To be able to communicate with KubeMQ interface ports running in Kubernetes cluster, a Port Forward of KubeMQ's ports is needed.

kubemqctl has a handy command that will do it for you:

kubemqctl set cluster proxy

Subscribe to Commands Channel

A receiver can subscribe to the hello-command channel with one of the following methods.

Run the following kubemqctl command:

 kubemqctl commands rec "hello-command" -a

When connected, the stream will block until receiving a command. Once a command will be received, kubemqctl automatically will send a Response.

Send to Commands Channel

After you have subscribed to a hello-command channel, you can send your command to it.

Run the following kubemqctl command:

kubemqctl commands send "hello-command" "some command"

Demo

Last updated