rabbitmq-development
Skill275 starsChanged 53 days agoApache-2.0View on GitHub
Best practices and guidelines for RabbitMQ message queue development with AMQP protocol
In this repository264 other files it gives its agents.
- accessibility-a11ySkill
- alpine-jsSkill
- analytics-data-analysisSkill
- android-developmentSkill
- angular-developmentSkill
- angularSkill
- anime-jsSkill
- anthropic-claude-developmentSkill
- api-developmentSkill
- apollo-graphqlSkill
- aspnet-coreSkill
- astroSkill
- auth0-authenticationSkill
- autogen-developmentSkill
- automl-hyperparameter-optimizationSkill
- aws-developmentSkill
- azureSkill
- backend-developmentSkill
- bash-scriptingSkill
- beautifulsoup-parsingSkill
- bitbucket-workflowSkill
- blazorSkill
- blender-python-addonSkill
- blockchainSkill
- bootstrapSkill
- business-central-developmentSkill
- cheerio-parsingSkill
- chrome-extension-developmentSkill
- ci-cd-best-practicesSkill
- clean-architectureSkill
- clean-codeSkill
- clerk-authenticationSkill
- cloudflare-developmentSkill
- computer-vision-opencvSkill
- convexSkill
- cppSkill
- c-sharpSkill
- cssSkill
- cypressSkill
- data-analysis-jupyterSkill
- data-analystSkill
- data-jupyter-pythonSkill
- deep-learning-pythonSkill
- deep-learning-pytorchSkill
- deep-learningSkill
- deno-typescriptSkill
- design-systemsSkill
- devopsSkill
- django-pythonSkill
- django-rest-api-developmentSkill
- dockerSkill
- dotnetSkill
- drizzle-ormSkill
- drupal-developmentSkill
- elasticsearch-best-practicesSkill
- electron-developmentSkill
- elixirSkill
- embedded-stm32Skill
- esbuild-bundlerSkill
- ethereumSkill
- The first 60 shown.
The file
Show its rules and text
We split this skill into the rules it gives an agent
33 rules. About 0 are common, 31 are distinctive, and 2 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈31
Distinctive · estimate
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 18
Leave NO todos, placeholders, or missing pieces in the implementation
- Distinctive: line 46
Keep queue sizes small - large queues put heavy load on RAM usage
- Distinctive: line 49
Use TTL (Time-To-Live) to automatically remove old messages
- Distinctive: line 64
Use for queues requiring durability and fault tolerance
- Distinctive: line 69
Use transient messages for fastest throughput when durability isn't required
- Distinctive: line 72
Use multiple queues for better throughput on multi-core systems
- Distinctive: line 88
Create channels per thread/operation, not per message
- Distinctive: line 99
Start with a moderate value (50-100) and tune based on metrics
- Distinctive: line 105
Consider manual acknowledgment mode first as a rule of thumb
- Very specific: line 113
Use content_type to indicate payload format
- Distinctive: line 119
Use publisher confirms for reliable publishing
- Distinctive: line 122
Consider message size - large messages impact performance
- Distinctive: line 134
Don't requeue failed messages to the same queue indefinitely
- Distinctive: line 144
Use exponential backoff for reconnection attempts
- Distinctive: line 151
Use quorum queues for replicated, durable queues
- Very specific: line 156
Use ha-mode policy for classic queue mirroring
- Distinctive: line 157
Prefer quorum queues over mirrored classic queues for new deployments
- Distinctive: line 163
Use strong passwords and rotate regularly
- Distinctive: line 164
Consider LDAP or OAuth2 integration for enterprise deployments
- Distinctive: line 166
Use separate credentials per application/service
- Distinctive: line 172
Use permission patterns to restrict access to specific resources
- Distinctive: line 187
Use HTTP API for programmatic monitoring
- Distinctive: line 202
Test message serialization/deserialization
- Distinctive: line 203
Verify exchange and queue declarations
- Distinctive: line 207
Use containerized RabbitMQ for tests
- Distinctive: line 208
Test failure scenarios (connection loss, broker restart)
- Distinctive: line 209
Verify message acknowledgment behavior
- Distinctive: line 217
Use prefetch to ensure fair distribution
- Distinctive: line 222
Use fanout exchange for broadcasting
- Distinctive: line 224
Consider topic exchange for filtered subscriptions
- Distinctive: line 228
Use correlation_id to match requests and responses
- Distinctive: line 229
Create exclusive reply queue per client
- Distinctive: line 234
Use exchanges for event distribution
≈ “Common” is an estimate: at least 1 in 5 of the 408,460 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
RabbitMQ Development
You are an expert in RabbitMQ and AMQP (Advanced Message Queuing Protocol) development. Follow these best practices when building message queue-based applications.
Core Principles
- RabbitMQ is a message broker that receives messages from publishers and routes them to consumers
- AMQP 0-9-1 is the most commonly used protocol - an application layer protocol transmitting data in binary format
- Design for reliability, scalability, and fault tolerance
- Leave NO todos, placeholders, or missing pieces in the implementation
Architecture Components
Exchanges
- Direct Exchange: Routes based on exact routing key match - use for unicast routing
- Fanout Exchange: Routes to all bound queues regardless of routing key - use for broadcast
- Topic Exchange: Routes based on wildcard pattern matching - use for multicast routing
- Headers Exchange: Routes based on message header attributes - use for complex routing logic
Queues
- Queues store messages until consumed
- Can be durable (survives broker restart) or transient (in-memory only)
- Metadata of durable queues is stored on disk
- Metadata of transient queues is stored in memory when possible
Bindings
- Connect exchanges to queues with routing rules
- Binding keys determine which messages reach which queues
- Multiple bindings can connect the same exchange to multiple queues
Queue Management Best Practices
Queue Size
- Keep queue sizes small - large queues put heavy load on RAM usage
- RabbitMQ flushes messages to disk when RAM is constrained, impacting performance
- Monitor queue depth and implement backpressure mechanisms
- Use TTL (Time-To-Live) to automatically remove old messages
Queue Types
Classic Queues
- Traditional RabbitMQ queue implementation
- Good for most use cases
- Supports all features (lazy queues, priorities, etc.)
Quorum Queues (Recommended)
- Introduced in RabbitMQ 3.8
- Replicated queue type for high availability and data safety
- Declare with
x-queue-type: quorum - Use for queues requiring durability and fault tolerance
- Cannot be set via policy - must be declared by client
Performance Optimization
- Use transient messages for fastest throughput when durability isn't required
- Persistent messages are written to disk immediately, affecting throughput
- Queues are single-threaded - one queue handles up to ~50,000 messages
- Use multiple queues for better throughput on multi-core systems
- Have as many queues as cores on the underlying nodes
Connection and Channel Management
Connections
- Each connection uses approximately 100 KB of RAM (more with TLS)
- Thousands of connections can burden the server significantly
- Implement connection pooling in your applications
- Reuse connections where possible
Channels
- Channels are lightweight connections multiplexing a single TCP connection
- Publishing and consuming happens over channels
- Create channels per thread/operation, not per message
- Close channels when no longer needed to free resources
Prefetch and Consumer Configuration
Prefetch (QoS)
- Prefetch defines how many unacknowledged messages a consumer receives at once
- Setting prefetch optimizes consumer throughput
- Low prefetch (1-10): Fair distribution, good for slow consumers
- High prefetch (100+): Better throughput, risk of uneven distribution
- Start with a moderate value (50-100) and tune based on metrics
Acknowledgments
- Auto-ack: Higher throughput, least guarantees on failures
- Manual-ack: Lower throughput, better reliability
- Consider manual acknowledgment mode first as a rule of thumb
- Acknowledge promptly after processing to release server resources
Message Handling
Message Properties
- Set
delivery_mode=2for persistent messages (survives broker restart) - Use
content_typeto indicate payload format - Include
correlation_idfor request/response patterns - Set
expirationfor time-sensitive messages
Publishing Best Practices
- Use publisher confirms for reliable publishing
- Handle returned messages (mandatory flag) appropriately
- Batch messages when possible for better throughput
- Consider message size - large messages impact performance
Error Handling
Dead Letter Exchanges
- Configure DLX for handling failed messages
- Messages routed to DLX when: rejected with requeue=false, TTL expires, queue length exceeded
- Process dead-lettered messages separately for analysis and retry
Retry Queues Pattern
- Don't requeue failed messages to the same queue indefinitely
- Risk of self-inflicted DoS attack with continuous retry loops
- Implement retry queues with increasing delays
- Forward problematic messages to a "timeout" queue
- Example delays: 1s, 5s, 30s, then dead letter
Circuit Breaker
- Implement circuit breaker pattern for downstream failures
- Prevent queue buildup when consumers can't process messages
- Use exponential backoff for reconnection attempts
High Availability
Clustering
- Deploy RabbitMQ in a cluster for high availability
- Use quorum queues for replicated, durable queues
- Configure appropriate number of replicas
Mirroring (Classic Queues)
- Use
ha-modepolicy for classic queue mirroring - Prefer quorum queues over mirrored classic queues for new deployments
Security
Authentication
- Use strong passwords and rotate regularly
- Consider LDAP or OAuth2 integration for enterprise deployments
- Enable TLS for encrypted connections
- Use separate credentials per application/service
Authorization
- Implement vhost-based isolation for multi-tenant scenarios
- Grant minimum necessary permissions (configure, write, read)
- Use permission patterns to restrict access to specific resources
Monitoring and Observability
Key Metrics
- Queue depth (messages ready, messages unacknowledged)
- Message rates (publish, deliver, acknowledge)
- Connection and channel counts
- Memory and disk usage
- Consumer utilization
Management Plugin
- Enable the management plugin for monitoring UI
- Use HTTP API for programmatic monitoring
- Export metrics to Prometheus/Grafana
Alerts
- Alert on queue depth exceeding thresholds
- Monitor memory and disk alarms
- Track consumer disconnections
- Watch for message rate anomalies
Testing
Unit Testing
- Mock RabbitMQ client for isolated testing
- Test message serialization/deserialization
- Verify exchange and queue declarations
Integration Testing
- Use containerized RabbitMQ for tests
- Test failure scenarios (connection loss, broker restart)
- Verify message acknowledgment behavior
- Load test with realistic message rates
Common Patterns
Work Queues (Task Distribution)
- Multiple consumers on single queue for load distribution
- Use prefetch to ensure fair distribution
- Acknowledge after task completion
Publish/Subscribe
- Use fanout exchange for broadcasting
- Each subscriber gets its own queue bound to the exchange
- Consider topic exchange for filtered subscriptions
RPC (Request/Response)
- Use correlation_id to match requests and responses
- Create exclusive reply queue per client
- Implement timeouts for pending requests
Event Sourcing
- Use exchanges for event distribution
- Multiple services can independently consume events
- Maintain event ordering within partitions
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

