Kubetools

Kubetools provides access to KubeMQ via a command-line interface.

It currently provides the ability to:

  • Test KubeMQ server installation from the command line and verify proper configuration.
  • Execute Queue, Pub/Sub and RPC commands message patterns.
  • Monitor Channels and view messages.
  • Check Health and get simple stats.
  • Get Metrics detailed data

If there is something you'd like to see Kubetools be able to do from the CLI, let us know! 😃

Table of Content

Installation

Mac OS:

curl -L https://github.com/kubemq-io/kubetools/releases/download/latest/kubetools_darwin_amd64 -o /usr/local/bin/kubetools 
chmod +x /usr/local/bin/kubetools
1
2

Linux 64 bits:

curl -L https://github.com/kubemq-io/kubetools/releases/download/latest/kubetools_linux_amd64 -o /usr/local/bin/kubetools
chmod +x /usr/local/bin/kubetools
1
2

Linux 32 bits:

curl -L https://github.com/kubemq-io/kubetools/releases/download/latest/kubetools_linux_386 -o /usr/local/bin/kubetools
chmod +x /usr/local/bin/kubetools
1
2

Windows:

Run in PowerShell as administrator:

New-Item -ItemType Directory 'C:\Program Files\Kubetools'
Invoke-WebRequest https://github.com/kubemq-io/kubetools/releases/download/latest/kubetools.exe -OutFile 'C:\Program Files\Kubetools\kubetools.exe'
[Environment]::SetEnvironmentVariable('Path', [Environment]::GetEnvironmentVariable('Path', [EnvironmentVariableTarget]::Machine) + ';C:\Program Files\Kubetools', [EnvironmentVariableTarget]::Machine)
$env:Path += ';C:\Program Files\Kubetools'
1
2
3
4

Or manually:

  • Download the latest kubetools.exe.
  • Place the file under e.g. C:\Program Files\Kubetools\kubetools.exe
  • Add that directory to your system path to access it from any command prompt

Configuration

Kubetools require .config.yaml File for connections variables. Default configuration:

statsAddress: "http://localhost:8080/v1/stats" #the address of Stats endpoint, you can replace the localhost:8080 with your address
healthAddress: "http://localhost:8080/health" # the address of Health endpoint , you can replace the localhost:8080 with your address
metricsAddress: "http://localhost:8080/metrics" #the address of Health endpoint, you can replace the localhost:8080 with your address
monitorAddress: "ws://localhost:8080/v1/stats" #the address of Monitor endpoint, you can replace the localhost:8080 with your address
connections:
  - kind: 1 # 1 - grpc 2- rest
    host: "localhost" # host destination
    port: 50000 # port destination
    isSecured: false # set using https
    certFile: "" # set location of cert file
  - kind: 2 # 1 - grpc 2- rest
    host: "localhost" # host destination
    port: 9090  # port destination
    isSecured: false  # set using https
    certFile: "" # set location of cert file - not in use for Rest

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16

Usage

Run :

kubetools
1

Will prompt the following:

Usage:
  kubetools [command]

Available Commands:
  get         Call kubemq get resources endpoint
  health      Call kubemq health endpoint
  help        Help about any command
  metrics     Call kubemq metrics endpoint
  mon         monitor messages/requests channels
  pubsub      send and receive pub/sub real-time and persistent events
  queue       send and receive queue messages
  rpc         send and receive rpc commands and queries
  test        test your kubemq installation
  version     print kubemq version

Flags:
  -h, --help   help for kubetools

Use "kubetools [command] --help" for more information about a command.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20

Get Command v1.3.0+ requires KubeMQ v1.6.0+

Run the following command for retrieve an information about various resources such Queues and Events Stores

Run :

kubetools get
1

Or,

kubetools g
1

A list of sub commands will be shown:

Usage:
  kubetools get [command]

Aliases:
  get, g

Available Commands:
  events_stores Call kubemq get list of events store channels
  queues        Call kubemq get list of queues

Flags:
  -h, --help   help for get

Use "kubetools get [command] --help" for more information about a command.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15

This features is supported only for KubeMQ version v1.6.2 and up

Choose one of the following Get options:

  • Queues
  • Events Stores
kubetools get queues
1

Or,

kubetools g qu
1

Example of results:

CHANNELS:
NAME       CLIENTS  MESSAGES  BYTES   FIRST_SEQUENCE  LAST_SEQUENCE
dead       1        0         0       0               0
done       1        3000      563231  1               3000
receiverA  1        3000      593231  1               3000
receiverB  1        3000      593231  1               3000
receiverC  1        3000      593231  1               3000
receiverD  1        3000      593231  1               3000
receiver   1        3000      593231  1               3000
receiverF  1        3000      593231  1               3000

TOTAL CHANNELS:  8

CLIENTS:
CLIENT_ID                             CHANNEL    ACTIVE  LAST_SENT  PENDING  STALLED
49e2f897-8051-49cb-98af-8949a8ce9093  dead       false   0          0        false
ff897393-bbb6-4877-a7ed-4130b752ae33  done       false   3000       0        false
056b501a-1f5f-4722-875f-859c36e0997a  receiverA  false   3000       0        false
d44d7fb2-f21e-46aa-96db-e475c8bf0848  receiverB  false   3000       0        false
4a9fab08-4cd7-4e75-984c-f94b9759209e  receiverC  false   3000       0        false
06f44b57-afa5-46d9-88d0-4b5ce0516129  receiverD  false   3000       0        false
06bbe283-1978-4751-8abc-5699dacea741  receiver   false   3000       0        false
475d17c0-847c-4969-9c05-bf171f176f86  receiverF  false   3000       0        false

TOTAL CLIENTS:  8
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25

Test Command

Run the following command for running various tests, checking of KubeMQ installation and proper configuration. Run :

kubetools test
1

Or,

kubetools t
1

Monitor Command

Run the following command to enter into a monitoring channels mode.

kubetools mon
1

Or,

kubetools m
1

Available sub commands:

Usage:
  kubetools mon [command]

Aliases:
  mon, m

Available Commands:
  commands     monitor commands channels
  events       monitor events channels
  events_store monitor events store channels
  queries      monitor query channels
  queue        monitor queue channels

Flags:
  -h, --help   help for mon

Use "kubetools mon [command] --help" for more information about a command.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17

Choose one of the following Monitoring options:

  • Queue
  • Events
  • Events Store
  • Commands
  • Queries

Queue

Run the following command will monitor and show all traffic in channel-name Queue channel:

kubetools mon queue channel-name
1

Or,

kubetools m qu channel-name
1

Queue Command

Run the following command for sending and receiving queue messages.

kubetools queue

1
2

Or,

kubetools q
1

Available Queue commands:

Usage:
  kubetools queue [command]

Aliases:
  queue, q

Available Commands:
  ack         acl all messages in a queue
  peak        peak messages from a queue
  receive     receive messages from a queue
  send        send message to a queue

Flags:
  -h, --help                    help for queue
  -t, --queueTransport string   set transport type, grpc or rest (default "grpc")

Use "kubetools queue [command] --help" for more information about a command.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
  • Send
  • Receive
  • Peak
  • Ack All

Send

Run the following command for sending your-message to Queue channel channel-name:

kubetools queue send channel-name your-message 

1
2

Or,

kubetools q s
1

Available flags:

Usage:
  kubetools queue send [flags]

Aliases:
  send, s

Flags:
  -h, --help                 help for send
  -d, --sendDelay int        set queue message send delay seconds
  -e, --sendExpiration int   set queue message expiration seconds

Global Flags:
  -t, --queueTransport string   set transport type, grpc or rest (default "grpc")
1
2
3
4
5
6
7
8
9
10
11
12
13

Pub/Sub Command

Run the following command for publish and subscribe real-time and persistent events:

kubetools pubsub
1

Or,

kubetools p
1

Available Pub/Sub commands:

Usage:
  kubetools pubsub [command]

Aliases:
  pubsub, p, ps

Available Commands:
  receive     receive pub/sub real-time and persistent events
  send        send pub/sub real-time and persistent events

Flags:
  -h, --help                     help for pubsub
  -t, --pubsubTransport string   set transport type, grpc or rest (default "grpc")

Use "kubetools pubsub [command] --help" for more information about a command.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15

Choose one of the following Pub/Sub commands options:

  • Send Event
  • Receive Events
  • Send Event-Store
  • Receive Events-Store

Send Event

Run the following command for sending your-message to Events channel channel-name:

kubetools pubsub send events channel-name your-message
1

Or,

kubetools p s e channel-name your-message
1

RPC Command

Run the following command for for sending and receiving RPC calls of commands and queries:

kubetools rpc
1

Or,

kubetools r
1

Available RPC commands:

Usage:
  kubetools rpc [command]

Aliases:
  rpc, r

Available Commands:
  receive     receive commands or queries
  send        send commands and queries

Flags:
  -h, --help                  help for rpc
  -t, --rpcTransport string   set transport type, grpc or rest (default "grpc")

Use "kubetools rpc [command] --help" for more information about a command.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15

Choose one of the following RPC commands options:

  • Send Command
  • Receive Commands
  • Send Query
  • Receive Queries

Send Command

Run the following command for sending your-message to Commands channel channel-name:

kubetools rpc send command channel-name your-message
1

Or,

kubetools r s c channel-name your-message
1

Health Command

Run the following command for checking health monitor point of KubeMQ:

kubetools health
1

Or,

kubetools h
1

Metrics Command

Run the following command for receiving metrics data of KubeMQ:

kubetools metrics
1

Or,

kubetools m
1
Last Updated: 8/12/2019, 1:09:11 PM