Get Started with RPC v1.5.0+ stable

Table of Content

Deploy a KubeMQ

To start using KubeMQ with RPC, we first need to run a KubeMQ docker container either locally or on a remote node.

You can select one of the methods below:

  • kubernetes
  • docker
  • helm
  • docker-compose

Execute the following command:

kubectl apply -f https://get.kubemq.io/deploy?token="YOUR_KUBEMQ_TOKEN"
1

For Example:

get_started_kubernetes.gif

Verify Deployment

Browse to KubeMQ's API end-point with GET request to /health path and get a json response like below:

For Example:

curl --location --request GET "http://localhost:8080/health" --header "Content-Type: application/json"
1

We will get this:

verify_deploy.gif

PROXY

If KubeMQ fails to load, probably there is a proxy server which prevents the validation of KubeMQ token. To fix this, you can add -e KUBEMQ_PROXY="your-proxy-url" as an environment variable.

Next Steps

Now that you have KubeMQ installed and running, we will do the following steps:

  1. Subscribe a receiver to hello-command command channel. When a command will be available a Response will be sent back to the sender.
  2. Send a command in the channel and wait for a response.
  3. Display the response in the console

get_started_rpc.gif

As showed in the following diagram:

image info

Subscribe to a Channel

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

  • kubetools
  • cURL
  • .Net
  • Java
  • Go
  • Python
  • Node
  • PHP
  • Ruby
  • jQuery

Run the following Kubetools command:

 kubetools rpc rec command "hello-command"
1

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

Kubetools

Kubetools is KubeMQ Command-Line-Interface tool.

Installation instructions here.

Send a Command Channel

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

  • kubetools
  • cURL
  • .Net
  • Java
  • Go
  • Python
  • Node
  • PHP
  • Ruby
  • jQuery

Run the following Kubetools command:

kubetools rpc send command "hello-command" "some command"
1

Kubetools

Kubetools is KubeMQ Command-Line-Interface tool.

Installation instructions here.

Last Updated: 8/21/2019, 6:37:49 PM