stuntman / providers / activemq

ActiveMQ

An ActiveMQ Classic broker over OpenWire, with transactions, durable subscriptions, selectors, the scheduler and dead letters.

Stands in for

  • ActiveMQ Classic (OpenWire 10)
  • Apache.NMS.ActiveMQ 1.8 and 2.x
  • Java activemq-client

Everything ActiveMQ gives you

  1. 01

    Every message, with its state

    Scheduled, pending, delivered, acked, dead_letter, expired, rolled_back or discarded, with the redelivery count.

  2. 02

    Local and XA transactions

    Sends stay invisible until commit; rollback redelivers. XA prepare, two-phase commit and recover from any connection.

  3. 03

    Durable subscriptions

    A subscription name and client ID keep copies while the consumer is offline; a new topic or selector replaces it.

  4. 04

    JMS selectors

    The SQL-92 subset on headers and properties: IN, LIKE, BETWEEN, IS NULL, arithmetic. A bad one gets InvalidSelectorException.

  5. 05

    Scheduler

    AMQ_SCHEDULED_DELAY, PERIOD with REPEAT, and CRON on the environment's clock; BROWSE and REMOVE over JMS work too.

  6. 06

    Dead letters as ActiveMQ does

    Poisoned, past max_redeliveries or expired persistent messages go to ActiveMQ.DLQ, or one DLQ per destination.

  7. 07

    Consumers like a real broker

    Prefetch, pull, ack modes, browsers, noLocal, exclusive and priority consumers, wildcards and message groups.

  8. 08

    Advisories

    Connection, consumer, producer, destination, expired and DLQ advisories with the real payloads, while someone listens.

  9. 09

    Wire format as asked

    Loose or tight encoding, with or without the marshal cache, compressed bodies and blob messages.

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 and their states

Messages and their states: the ActiveMQ screen in Stuntman
1Counts by state

Scheduled, pending, delivered, acked, dead-letter and expired for the destination.

1 of 5
2Scheduled by cron

AMQ_SCHEDULED_CRON on the environment clock; advance_clock brings it forward.

2 of 5
3Inside a transaction

Delivered in a transaction that is still open: the ack takes effect only on commit.

3 of 5
4Redelivery count

Redelivered 7 times, past max_redeliveries: the message went to the DLQ.

4 of 5
5Moved to ActiveMQ.DLQ

The original keeps its state and points at its copy in the dead-letter queue.

5 of 5
  1. Counts by state

    Scheduled, pending, delivered, acked, dead-letter and expired for the destination.

  2. Scheduled by cron

    AMQ_SCHEDULED_CRON on the environment clock; advance_clock brings it forward.

  3. Inside a transaction

    Delivered in a transaction that is still open: the ack takes effect only on commit.

  4. Redelivery count

    Redelivered 7 times, past max_redeliveries: the message went to the DLQ.

  5. Moved to ActiveMQ.DLQ

    The original keeps its state and points at its copy in the dead-letter queue.

Send as the partner, then break the broker

Send as the partner, then break the broker: the ActiveMQ screen in Stuntman
1Send a message

Text, properties and correlation id, dispatched to the app's consumers as the partner would.

1 of 5
2Refuse login

Every login fails with a SecurityException.

2 of 5
3Redeliver next 2

The next 2 acks are lost; those messages come again with a higher redelivery count.

3 of 5
4Fail next commit

The commit fails with TransactionRolledBackException, or an XAException for XA.

4 of 5
5Users

User names and passwords; empty lets anyone log in.

5 of 5
  1. Send a message

    Text, properties and correlation id, dispatched to the app's consumers as the partner would.

  2. Refuse login

    Every login fails with a SecurityException.

  3. Redeliver next 2

    The next 2 acks are lost; those messages come again with a higher redelivery count.

  4. Fail next commit

    The commit fails with TransactionRolledBackException, or an XAException for XA.

  5. Users

    User names and passwords; empty lets anyone log in.

Consumers, durable subscriptions, transactions

Consumers, durable subscriptions, transactions: the ActiveMQ screen in Stuntman
1Selector

The consumer only gets messages whose properties match region = 'north'.

1 of 5
2Wire format

What the client negotiated: tight encoding with the marshal cache, or loose.

2 of 5
3Kept while offline

A durable subscription holds 12 messages until its client comes back.

3 of 5
4Prepared XA

Phase one done; recover lists it from any connection until commit or rollback.

4 of 5
5Committed

Local transactions with their sends and acks.

5 of 5
  1. Selector

    The consumer only gets messages whose properties match region = 'north'.

  2. Wire format

    What the client negotiated: tight encoding with the marshal cache, or loose.

  3. Kept while offline

    A durable subscription holds 12 messages until its client comes back.

  4. Prepared XA

    Phase one done; recover lists it from any connection until commit or rollback.

  5. Committed

    Local transactions with their sends and acks.

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.

  • Login refused

    Every login fails with a SecurityException

    set_activemq {refuse_login: true}
  • Connection dropped

    The broker closes the connection after N dispatched messages

    set_activemq {drop_after: 3}
  • Slow dispatch

    A delay before each dispatch

    set_activemq {slow_dispatch: "2s"}
  • Lost acks

    The next N acks are lost; those messages come again

    set_activemq {redeliver: 2}
  • Commit fails

    The next N commits fail and roll back (XAException for XA)

    set_activemq {fail_commits: 1}
  • Fast dead-lettering

    Messages go to the DLQ after fewer redeliveries

    set_activemq {max_redeliveries: 2}
  • One DLQ per destination

    ActiveMQ.DLQ.Queue.<name> instead of ActiveMQ.DLQ

    set_activemq {individual_dlq: true}
  • Expired message

    JMSExpiration passes; persistent ones go to the DLQ

    activemq_send {ttl: "1m"} + advance_clock
  • Scheduled job cancelled

    A delayed, repeating or cron message never goes out

    cancel_activemq_scheduled

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

Check that our position consumer rolls back cleanly when a commit fails.

set_activemq{"fail_commits": 1}
→ ok the next commit fails with TransactionRolledBackException
activemq_send{"destination": "queue://positions", "text": "{\"position\": \"POS-1043\"}"}
wait_for_activemq_ack{"destination": "queue://positions", "seq": 51}
→ ok seq 51 acked on attempt 2: one rollback, redelivered, then committed

MCP tools

  • list_activemq_destinationsQueues, topics, consumers, durable subscriptions, transactions
  • list_activemq_messagesMessages newest first, with their state
  • activemq_sendSend as the partner: properties, priority, delay, ttl, cron
  • set_activemqUsers and broker behaviour: refuse, drop, redeliver, fail commits
  • cancel_activemq_scheduledCancel scheduled messages before they go out
  • wait_for_activemq_ackWait until the app acked
  • advance_clockMove the environment's clock: scheduled and expiring messages follow

The same over HTTP

  • GET/api/activemq/destinations
  • GET/api/activemq/messages
  • POST/api/activemq/messages
  • PUT/api/activemq/settings
  • GET/api/activemq/wait-ack