Skip to content
DevOps AI ToolKit
Newsletter
All prompts
AI for RabbitMQ Difficulty: Advanced ClaudeChatGPTCursor

RabbitMQ KEDA Consumer Autoscaling Design Prompt

Design a KEDA-driven autoscaler that scales RabbitMQ consumer deployments on queue depth without thrashing, starving prefetch, or breaking message ordering.

Target user
Platform engineers running RabbitMQ consumers on Kubernetes
Difficulty
Advanced
Tools
Claude, ChatGPT, Cursor

The prompt

You are a senior platform engineer who runs high-throughput RabbitMQ consumers on Kubernetes and has tuned KEDA ScaledObjects to track queue depth without oscillation.

I will provide:
- The queue(s) to scale, their type (classic, quorum, stream), and typical vs. peak depth
- Current consumer Deployment spec (replicas, prefetch/QoS, ack mode, processing time per message)
- RabbitMQ topology (cluster size, connection/channel limits, management endpoint or AMQP)
- SLOs (max acceptable queue latency, cost ceiling on replica count)

Your job:

1. **Choose the trigger metric** — decide between the `rabbitmq` KEDA scaler modes `queueLength` (ready messages) and `messageRate` (publish/deliver rate via the management API), and explain why unacked messages must be excluded so prefetch backlog doesn't inflate the metric and cause runaway scaling.

2. **Set the ScaledObject math** — compute `value` (target messages per replica) from processing time and prefetch so N replicas drain the SLO backlog; show the full ScaledObject YAML including `pollingInterval`, `cooldownPeriod`, `minReplicaCount`, `maxReplicaCount`, and the trigger `metadata` (host or management protocol, queueName, vhost, mode, value).

3. **Prevent thrashing** — tune `cooldownPeriod`, HPA `stabilizationWindowSeconds`, and scale-up/down policies so a bursty publisher doesn't flap replicas; explain the interaction between KEDA's ScaledObject and the underlying HPA behavior block.

4. **Protect the broker** — cap `maxReplicaCount` against connection/channel/FD limits, recommend per-consumer channel and prefetch settings, and warn where scale-out multiplies connection churn.

5. **Handle ordering and drain** — flag when scaling breaks per-key ordering (use single-active-consumer or a stream with one consumer), and design graceful shutdown (`terminationGracePeriodSeconds`, stop consuming + ack in-flight) so scale-down never loses or double-processes messages.

6. **Secure the trigger** — store the management/AMQP credentials in a TriggerAuthentication + Secret, never inline in the ScaledObject.

Output as: (a) trigger-metric decision with rationale, (b) complete ScaledObject + TriggerAuthentication YAML, (c) anti-thrash tuning table, (d) broker-limit safety check, (e) drain/ordering checklist.

Show the queue-depth-to-replica math explicitly so the target value can be re-derived when processing time changes.

Run this prompt with AI

Test it, get an AI-improved version, or compare models — live in the Prompt Workspace. No copy-paste.

Related prompts

More RabbitMQ prompts & error guides

Browse every RabbitMQ prompt and troubleshooting guide in one place.

Free download · 368-page PDF

Reading prompts? Get all 500 in one free PDF

500 battle-tested, copy-paste AI prompts engineered by a senior systems engineer — every one with fill-in placeholders and safety/back-out notes. Drop your email and it's yours.

  • 500 prompts: Linux · Kubernetes · Terraform · OpenStack · GitLab · Docker · Monitoring · Incident Response
  • Instant PDF download — yours free, forever
  • Plus one practical AI-workflow email a week (no spam)

Single opt-in · unsubscribe anytime · no spam.