Skip to content

feat (queue/ctl): add queue admin CLI for MySQL queue inspection and management#61

Merged
behinddwalls merged 3 commits into
mainfrom
preetam/queue-tools
Feb 25, 2026
Merged

feat (queue/ctl): add queue admin CLI for MySQL queue inspection and management#61
behinddwalls merged 3 commits into
mainfrom
preetam/queue-tools

Conversation

@behinddwalls
Copy link
Copy Markdown
Collaborator

@behinddwalls behinddwalls commented Feb 24, 2026

Summary

Adds a Cobra-based CLI tool (queue-admin) for inspecting, managing, and
troubleshooting the MySQL-backed message queue. Operates directly on the
queue database tables (queue_messages, queue_offsets, queue_partition_leases).

Commands: list-topics, topic-stats, list-messages, inspect-message,
delete-message, purge-topic, list-dlq, requeue-dlq, purge-dlq,
list-offsets, reset-offset, list-leases, consumer-lag, stale-leases,
release-lease. All read commands support --json output.

Library code in ctl/lib/ is importable for integration testing.
Includes unit tests with go-sqlmock and integration tests using
publisher/subscriber to create state, then AdminStore to verify.

Test Plan

Issues

@behinddwalls behinddwalls changed the title feat: add queue admin CLI for MySQL queue inspection and management feat (queue/ctl): add queue admin CLI for MySQL queue inspection and management Feb 24, 2026
behinddwalls added a commit that referenced this pull request Feb 24, 2026
…sql (#60)

## Summary
- Renames `extension/queue/sql` → `extension/queue/mysql` to align with
existing naming conventions (`extension/storage/mysql`,
`extension/counter/mysql`)
- Updates package declarations, import paths, BUILD.bazel files, and all
references across the codebase (Makefile, docs, test utilities,
integration tests, e2e tests)
- The generic `sql` package name is replaced with `mysql` to make the
backend explicit

## Test plan
- [x] `make gazelle` — BUILD files regenerated successfully
- [x] `make build` — all 54 targets build successfully
- [x] `make test` — all 8 unit tests pass (including
`//extension/queue/mysql:mysql_test`)

## Stack
1. @ #60
1. #61
Comment thread extension/queue/mysql/ctl/main.go
@behinddwalls behinddwalls marked this pull request as ready for review February 24, 2026 23:02
@behinddwalls behinddwalls requested review from a team as code owners February 24, 2026 23:02
@behinddwalls behinddwalls force-pushed the preetam/queue-tools branch 2 times, most recently from 8b53c35 to f72c4da Compare February 24, 2026 23:06
@behinddwalls behinddwalls changed the base branch from preetam/queue-utils to main February 24, 2026 23:06
Adds a Cobra-based CLI tool (queue-admin) for inspecting, managing, and
troubleshooting the MySQL-backed message queue. Operates directly on the
queue database tables (queue_messages, queue_offsets, queue_partition_leases).

Commands: list-topics, topic-stats, list-messages, inspect-message,
delete-message, purge-topic, list-dlq, requeue-dlq, purge-dlq,
list-offsets, reset-offset, list-leases, consumer-lag, stale-leases,
release-lease. All read commands support --json output.

Library code in ctl/lib/ is importable for integration testing.
Includes unit tests with go-sqlmock and integration tests using
publisher/subscriber to create state, then AdminStore to verify.
Topic names like "to-batch" and "build-signal" were rejected by
validateTopicName which only allowed [a-z0-9_]. Since topic names
are used as column values (not SQL identifiers), hyphens are safe.
Also adds AllTopics and a test that auto-validates all defined topics.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@behinddwalls behinddwalls merged commit eb8c3ba into main Feb 25, 2026
8 checks passed
@behinddwalls behinddwalls deleted the preetam/queue-tools branch June 2, 2026 18:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants