Get Started with Queues v1.6.0+ stable

Table of Content

Deploy a KubeMQ

To start using KubeMQ with Pub/Sub, 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. Send a message to hello-world-queue channel.
  2. Request a message from hello-world-queue channel and receive a message.
  3. Display the received message in the console.

get_started_queue.gif

As shown in the following diagram:

image info

Send a Message

The producer can send a message to the "hello-world-queue" channel with one of the following methods.

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

Run the following Kubetools command:

kubetools queue send "hello-world-queue" "this is a queue message"
1

A result message will be shown with an indication of sending time of the message

Kubetools

Kubetools is KubeMQ Command-Line-Interface tool.

Installation instructions here.

Receive a Message

After you have sent a message to a queue, you can request the message from a queue.

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

Run the following Kubetools command:

kubetools queue receive "hello-world-queue"
1

Kubetools

Kubetools is KubeMQ Command-Line-Interface tool.

Installation instructions here.

Get Queues information

You can get Queues information by running kubetools get queues.

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