stuntman / providers / service bus and rabbitmq

Service Bus and RabbitMQ

An AMQP broker that answers as Azure Service Bus or RabbitMQ and shows every message with its deliveries, locks and consumers.

Stands in for

  • Azure Service Bus (AMQP 1.0)
  • RabbitMQ (AMQP)
  • RabbitMQ management API

Everything Service Bus and RabbitMQ gives you

  1. 01

    Every message, every delivery

    Published, delivered, abandoned, completed or dead-lettered: each message keeps its history and properties.

  2. 02

    Queues, topics, subscriptions

    Namespaces with queues and topics; Service Bus subscriptions or RabbitMQ bindings fan out what is published.

  3. 03

    Consumers and their locks

    Who is receiving, receive mode, prefetch, the locks held now and what each consumer completed today.

  4. 04

    Rules for deliveries

    When op, entity and subject match: lose the lock, duplicate, hold, drop or dead-letter, the first N or a share.

  5. 05

    Dead-letter and resubmit

    See why a message was dead-lettered, move one there by hand, or put them all back on their queue.

  6. 06

    Publish as a partner

    publish puts a message on a queue or topic with subject, properties, session or schedule; it is marked as yours.

  7. 07

    RabbitMQ management API

    MassTransit and provisioning scripts create vhosts, queues, exchanges and bindings on :15672 before they connect.

  8. 08

    Namespace-wide trouble

    Refuse connections, time out, reject the key, answer ServerBusy, cap the throughput or turn off auto-create.

The screens

Each number is a control or a reading on the real screen. Everything you can click there, your agent can do with a tool.

Messages with their delivery history

Messages with their delivery history: the Service Bus and RabbitMQ screen in Stuntman
1Both brokers

Service Bus and RabbitMQ namespaces side by side, with queues, topics and subscriptions.

1 of 5
2Counts by state

Active, scheduled, locked and dead-letter for the entity.

2 of 5
3Next delivery

Lose the lock, duplicate, hold, drop or dead-letter the next delivery, once.

3 of 5
4Locked

Which consumer holds the lock and how long it has left.

4 of 5
5Delivery history

Published, delivered, abandoned with the handler's error, then completed on attempt 2.

5 of 5
  1. Both brokers

    Service Bus and RabbitMQ namespaces side by side, with queues, topics and subscriptions.

  2. Counts by state

    Active, scheduled, locked and dead-letter for the entity.

  3. Next delivery

    Lose the lock, duplicate, hold, drop or dead-letter the next delivery, once.

  4. Locked

    Which consumer holds the lock and how long it has left.

  5. Delivery history

    Published, delivered, abandoned with the handler's error, then completed on attempt 2.

Consumers, and how to knock them over

Consumers, and how to knock them over: the Service Bus and RabbitMQ screen in Stuntman
1Receiving now

Each connection with prefetch and receive mode; names come from the AMQP client id.

1 of 5
2Disconnected

Consumers that left in the last day, and why.

2 of 5
3Disconnect it

A forced detach (or CONNECTION_FORCED on RabbitMQ) tests the app's reconnect logic.

3 of 5
4Expire its locks

Its next complete fails with MessageLockLost and the messages come again.

4 of 5
5Locks held

The messages this consumer has locked and the time left on each.

5 of 5
  1. Receiving now

    Each connection with prefetch and receive mode; names come from the AMQP client id.

  2. Disconnected

    Consumers that left in the last day, and why.

  3. Disconnect it

    A forced detach (or CONNECTION_FORCED on RabbitMQ) tests the app's reconnect logic.

  4. Expire its locks

    Its next complete fails with MessageLockLost and the messages come again.

  5. Locks held

    The messages this consumer has locked and the time left on each.

A rule, tried on real traffic before you save

A rule, tried on real traffic before you save: the Service Bus and RabbitMQ screen in Stuntman
1When

Operation, namespace, entity and subject; more conditions on properties, session, size or sender.

1 of 5
2Instead

What happens to the matching delivery: here the lock is lost and the message comes again.

2 of 5
3How often

The first N, every time, or a random share of deliveries.

3 of 5
4Try it

How many of the last 50 deliveries would match, and which ones.

4 of 5
5What the app will see

Lock lost after 30 s and redelivered, then back to normal.

5 of 5
  1. When

    Operation, namespace, entity and subject; more conditions on properties, session, size or sender.

  2. Instead

    What happens to the matching delivery: here the lock is lost and the message comes again.

  3. How often

    The first N, every time, or a random share of deliveries.

  4. Try it

    How many of the last 50 deliveries would match, and which ones.

  5. What the app will see

    Lock lost after 30 s and redelivered, then back to normal.

Break it on purpose

The failures you need to test, exactly when you ask: from the screen or by a tool call, each one shown on the timeline with who caused it.

  • Lost lock

    The next delivery loses its lock and comes again

    set_next_delivery {behavior: lose_lock}
  • Duplicate delivery

    The same message is delivered twice

    set_next_delivery {behavior: duplicate}
  • Held, dropped or out of order

    Delivery waits 30 s, never comes, or overtakes another

    set_next_delivery hold | drop | out_of_order
  • Dead-lettered on arrival

    The message goes straight to the dead-letter queue

    set_next_delivery {behavior: dead_letter}
  • MessageLockLost on complete

    Locks a consumer holds expire now

    expire_consumer_locks
  • Forced disconnect

    amqp:link:detach-forced or CONNECTION_FORCED

    disconnect_consumer
  • Namespace down

    Connections refused, time out, 401 or ServerBusy

    set_namespace_reachability
  • Throttled

    ServerBusy over N messages a second, or every send

    set_throughput
  • Rotated key

    Senders still on the old key get 401

    rotate_policy_key
  • Missing entity

    Queues the app did not declare answer 404

    set_auto_create {on: false}
  • Rule on deliveries

    Any of the above for matching messages, first N or a share

    create_rule {service: azure-service-bus}

Why not the real sandbox

Your AI agent drives it

Claude Code, Codex or any MCP client connects to /mcp (or calls /api over plain HTTP), sets the stand-in up, breaks it on cue and reads what your app did.

you

Make sure the order worker handles a lost lock without processing the order twice.

set_next_delivery{"namespace": "acme-bus-stg", "entity": "orders-created", "behavior": "lose_lock"}
→ ok the next message on orders-created loses its lock once
get_queue_message{"namespace": "acme-bus-stg", "entity": "orders-created", "seq": 1047}
→ ok delivered to acme-worker-1, lock lost, redelivered; completed once on attempt 2

MCP tools

  • list_namespacesNamespaces, entities, counts per state, connection string
  • list_queue_messagesMessages of a queue, topic or subscription
  • get_queue_messageOne message with its delivery history
  • publishPublish a message as a test
  • list_consumersConnections receiving from an entity
  • expire_consumer_locksThe consumer's next complete fails with MessageLockLost
  • set_namespace_reachabilityRefuse, time out, 401 or busy
  • resubmitPut dead-lettered messages back on their queue
  • create_ruleLose locks, duplicate, hold or drop matching deliveries

The same over HTTP

  • GET/api/messaging/namespaces
  • GET/api/messaging/{namespace}/{entity}/messages
  • POST/api/messaging/{namespace}/{entity}/messages
  • POST/api/messaging/{namespace}/consumers/{id}/expire-locks
  • PUT/api/messaging/{namespace}/reachability