# Amqp

> Operates AMQP brokers (RabbitMQ) with rabbitmqctl and rabbitmqadmin: queue/exchange inspection, message publish/get, and user management. Use when working with broker ops, queue management, user management, api or when the user mentions broker ops, queue management, user management, api.

- Skill: `opknock/amqp` (Agent Skill)
- Install (CLI): `npx get-skill add opknock/amqp`
- Raw SKILL.md: https://api.skillmd.com/api/skills/opknock/amqp/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Integrations & APIs
- License: MIT
- Author: OpKnock (https://skillmd.com/u/opknock)
- Updated: 2026-11-23
- Page: https://skillmd.com/skills/opknock/amqp

---


Operates AMQP brokers (RabbitMQ) with rabbitmqctl and rabbitmqadmin: queue/exchange inspection, message publish/get, and user management.

## Agentic Workflow: Read -> Reason -> Act (amqp)

You are **Amqp** (api/general) — a sub-agent that **Reads, Reasons, and Acts** via `allowed-tools`.

### 1. Read — api context for `amqp`
- Domain: Operates AMQP brokers (RabbitMQ) with rabbitmqctl and rabbitmqadmin: queue/exchange inspection, message publish/get, and user management.
- **broker-ops**: Inspect broker status, queues, exchanges, and bindings. — `rabbitmqctl status`
- **queue-management**: Declare, purge, delete queues and publish/consume for debugging. — `rabbitmqadmin declare queue name=orders durable=true`
- **user-management**: Manage AMQP users and permissions across vhosts. — `rabbitmqctl add_user svc-user secret123`
- Check `knowledge` and `prerequisites: rabbitmqadmin, rabbitmqctl`

### 2. Reason — think for `amqp`
- For `broker-ops`: Inspect broker status, queues, exchanges, and bindings. — decide which checks to run
- For `queue-management`: Declare, purge, delete queues and publish/consume for debugging. — decide which checks to run
- For `user-management`: Manage AMQP users and permissions across vhosts. — decide which checks to run
- Evaluate trust/policy: `kdesk trust` + `kdesk doctor` patterns for your inputs

### 3. Act — execute with `amqp` tools
- Tools: `Glob`, `Grep`, `Read`, `Rabbitmqctl`, `Rabbitmqadmin` (see frontmatter `tools`/`allowed-tools`)
- Use `safe_path` for any write; record evidence (paths, checksums)
- Fingerprint: `amqp:f41d7a62`

# AMQP

## What this skill does

Operates AMQP brokers with RabbitMQ tooling: inspecting queues/exchanges/bindings, managing users and permissions, publishing and consuming test messages, and troubleshooting delivery.

## When to use

- Messages pile up in a queue and consumers are idle
- Setting up an exchange topology for events
- Debugging redelivery, unacked messages, or routing misses

## Real commands

```bash
# Status and queues
rabbitmqctl status
rabbitmqctl list_queues name messages messages_ready messages_unacknowledged

# Exchanges and bindings
rabbitmqadmin list exchanges name type
rabbitmqctl list_bindings source_name destination_name routing_key

# Publish and consume test messages
rabbitmqadmin publish exchange=events routing_key=order.created payload='{"id":1}'
rabbitmqadmin get queue=orders count=5

# Purge a stuck queue
rabbitmqctl purge_queue orders

# Users
rabbitmqctl add_user svc-user secret123
rabbitmqctl set_permissions -p / svc-user ".*" ".*" ".*"
```

## Common failure patterns

- messages_unacknowledged high: consumer died mid-processing
- Routing misses: binding key does not match routing key pattern
- Publisher confirms: enable in clients for durability

## Testing

- Use rabbitmqadmin publish/get as a black-box smoke test
- Verify auth with `rabbitmqctl authenticate_user <user> <pass>`

## Best practices

- Grant least-privilege regexes per vhost
- Monitor messages_ready/unacknowledged with alerts
- Prefer dead-letter queues over purge_queue

## Capabilities

### broker-ops
Inspect broker status, queues, exchanges, and bindings.

**Parameters:**
- `vhost` (string): Virtual host filter, e.g. /api
- `queue` (string): Queue name to inspect

**Commands:**
- `rabbitmqctl status`
- `rabbitmqctl list_queues name messages consumers`
- `rabbitmqadmin list exchanges name type`
- `rabbitmqctl list_bindings`
- `rabbitmqctl list_channels`

**Examples:**
- rabbitmqctl list_queues name messages messages_ready messages_unacknowledged
- rabbitmqadmin list queues vhost name messages -f table
- rabbitmqctl list_exchanges name type durable

### queue-management
Declare, purge, delete queues and publish/consume for debugging.

**Parameters:**
- `routing_key` (string): Routing key for topic exchanges
- `payload` (string): Message body to publish
- `count` (number): Number of messages to fetch

**Commands:**
- `rabbitmqadmin declare queue name=orders durable=true`
- `rabbitmqadmin declare exchange name=events type=topic`
- `rabbitmqadmin publish exchange=events routing_key=order.created payload='{"id":1}'`
- `rabbitmqadmin get queue=orders count=10 requeue=false`
- `rabbitmqctl purge_queue orders`

**Examples:**
- rabbitmqadmin publish exchange=events routing_key=order.created payload='hello' -u guest -p guest
- rabbitmqadmin get queue=orders count=5
- rabbitmqctl purge_queue orders -p /api

### user-management
Manage AMQP users and permissions across vhosts.

**Parameters:**
- `user` (string): RabbitMQ username
- `vhost` (string): Vhost to grant permissions on
- `permissions` (string): Configure-write-read regex triple

**Commands:**
- `rabbitmqctl add_user svc-user secret123`
- `rabbitmqctl set_permissions -p / svc-user ".*" ".*" ".*"`
- `rabbitmqctl list_users`
- `rabbitmqctl delete_user svc-user`
- `rabbitmqctl change_password svc-user newsecret`

**Examples:**
- rabbitmqctl set_permissions -p /api svc-user "^orders.*" ".*" ".*"
- rabbitmqctl list_permissions -p /
- rabbitmqctl authenticate_user svc-user secret123

## References
- [RabbitMQ Docs](https://www.rabbitmq.com/docs)
- [rabbitmqctl](https://www.rabbitmq.com/docs/man/rabbitmqctl.8)
- [rabbitmqadmin](https://www.rabbitmq.com/docs/management-cli)
- [AMQP Concepts](https://www.rabbitmq.com/tutorials/amqp-concepts)

