Pub/Sub

Get Started with Pub/ Sub 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 Events Channel

A consumer can subscribe to the "hello-world" channel with one of the following methods.

Run the following kubemqctl command:

kubemqctl events rec hello-world

When connected, a stream of events messages will be shown in the console.

Publish to Event Channel

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

Run the following kubemqctl command:

kubemqctl events send hello-world "Hi KubeMQ"

Demo

Last updated