CLI top-like viewer for RabbitMQ queues with optional Kubernetes port-forwarding.
Project description
MQTop
MQTop is a lightweight Python CLI tool for developers and SREs working with RabbitMQ, especially in Kubernetes environments. It provides a top-like live view of queues and can automatically manage kubectl port-forward for RabbitMQ running inside a cluster.
Installation (development)
python -m venv .venv
source .venv/bin/activate
pip install -e .
This will install the mqtop command in your virtualenv.
Configuration
MQTop reads its configuration from:
~/.mqtop/config.toml
Start by copying the example config from the repo:
mkdir -p ~/.mqtop
cp config.example.toml ~/.mqtop/config.toml
Adjust provider definitions to match your environment. Example dev-k8s provider:
[providers.dev-k8s]
type = "k8s"
context = "dev"
namespace = "messaging"
service = "rabbitmq"
remote_amqp_port = 5672
local_amqp_port = 5673
local_ui_port = 15672
username = "guest"
password = "guest"
Usage
- Default
topview (auto-uses providerdev-k8s):
mqtop
The top view is a Textual TUI. It shows, among others:
-
current queue depth (
ready,unacked), -
basic rates (
pub/s,del/s), -
per-session totals (
pubΔ,delΔ) since MQTop was started. -
Explicit provider and refresh interval:
mqtop --provider dev-k8s --refresh 1.0
- List configured providers:
mqtop providers list
- Manually manage Kubernetes port-forward:
mqtop k8s forward start dev-k8s
mqtop k8s forward status dev-k8s
mqtop k8s forward stop dev-k8s
- Peek messages from a queue (non-destructive):
mqtop msg peek my_queue_name -P dev-k8s -n 5
- Inside the TUI:
p– open provider selector (choose profile and confirm with Enter),q– quit,- status bar shows current profile and connection state (direct vs K8s port-forward, errors, etc.).
Notes for learning Python
The codebase is intentionally structured to be educational:
src/mqtop/config.py– typed configuration models and TOML handling.src/mqtop/k8s.py– small adapter aroundkubectl port-forward.src/mqtop/monitor.py– RabbitMQ Management API integration and queue metrics helpers.src/mqtop/tui.py– Textual-based main TUI (profiles, status bar).src/mqtop/cli.py– Typer-based CLI wiring everything together.
Comments and structure should help you see how a typical modern Python CLI project is organised.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file mqtop-0.1.0.tar.gz.
File metadata
- Download URL: mqtop-0.1.0.tar.gz
- Upload date:
- Size: 15.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.9.22
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
de26aec04bab0aeb30634051245b24dd87fb7a7776e9ffd1620eb02d635336bd
|
|
| MD5 |
c0fddf872fda6c7b23cf477c458fd837
|
|
| BLAKE2b-256 |
0302d4de18c4361ab9c68fc7737415e632afb5e43697c672978b747238235a02
|
File details
Details for the file mqtop-0.1.0-py3-none-any.whl.
File metadata
- Download URL: mqtop-0.1.0-py3-none-any.whl
- Upload date:
- Size: 16.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.9.22
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
58033a33e6f3f0574cd776e526230db186e9dfabc23816f3babaa9d896dc8995
|
|
| MD5 |
7c4f6ea2d2ef5348eed3bcda418b08bf
|
|
| BLAKE2b-256 |
55cb2bd3915ec59cbec7a2a09ae3b7b9853603910c1bbfc2fdbbb9f369c9b50f
|