stuntman / providers / event hubs
Event Hubs
An Azure Event Hubs namespace the official SDKs talk to over AMQP: partitions, consumer groups, owner levels, checkpoints and throttling on cue, with a Kafka endpoint too.
Stands in for
- Azure Event Hubs (AMQP 1.0, emulator mode)
- The Event Hubs Kafka endpoint ($ConnectionString)
- Pub/Sub import topics from Event Hubs
Everything Event Hubs gives you
- 01
Partitions like the service
A partition key goes where the service sends it (lookup3 hash); no key, round-robin; a batch lands in one partition.
- 02
Read from anywhere
Receivers start at the beginning, @latest, after an offset or sequence number, or at an enqueued time.
- 03
Consumer groups
$Default plus the groups you create; at most 5 receivers per partition and group, as in Azure.
- 04
Owner levels
A receiver with a higher epoch takes the partition; the older one is disconnected with link stolen.
- 05
Checkpoints you can see
BlobCheckpointStore blobs in a Stuntman Storage account show next to each partition's reader.
- 06
Management answers
get_eventhub_properties and get_partition_properties: begin and last sequence number, last offset, empty.
- 07
Retention on the clock
Events older than the hub's retention go when you move the environment clock; begin sequence moves on.
- 08
Kafka endpoint
Kafka clients log in with $ConnectionString and read and write the same partitions as AMQP clients.
- 09
Feeds Pub/Sub
A Pub/Sub import topic naming the hub reads it: partition key as ordering key, properties as attributes.
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.
A hub: its partitions and every event with who sent it

The namespace's event hubs with partitions, consumer groups and events kept.
AMQP on the Service Bus port, and Kafka through Streams' port.
Begin and last sequence number of each partition; click one to see only its events.
Sequence number, byte offset and the key that picked the partition.
The app over AMQP or Kafka apart from you and the agent.
- Hubs
The namespace's event hubs with partitions, consumer groups and events kept.
- Two doors
AMQP on the Service Bus port, and Kafka through Streams' port.
- Partitions
Begin and last sequence number of each partition; click one to see only its events.
- Partition key
Sequence number, byte offset and the key that picked the partition.
- Who sent it
The app over AMQP or Kafka apart from you and the agent.
Send, provoke, and the readers of each partition

Body, properties, a partition key or a partition, as another producer would.
The next sends answer com.microsoft:server-busy; the SDKs send again.
Readers lose their partition as if a higher epoch came.
Each receiver reading now, its epoch and the last sequence number sent.
The app's BlobCheckpointStore checkpoint, amber when it trails the reader.
- Send events
Body, properties, a partition key or a partition, as another producer would.
- Server busy
The next sends answer com.microsoft:server-busy; the SDKs send again.
- Steal owner
Readers lose their partition as if a higher epoch came.
- Owner level
Each receiver reading now, its epoch and the last sequence number sent.
- Checkpoint behind
The app's BlobCheckpointStore checkpoint, amber when it trails the reader.
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.
Server busyThe next N sends and management requests answer com.microsoft:server-busy
set_eventhubs server_busyQuota exceededThe next N sends are rejected with QuotaExceeded
set_eventhubs quota_exceededSlow sendsEach send waits before it is accepted
set_eventhubs slow_sendsEntity not foundA hub answers not found to links and management
set_eventhubs not_foundPartition owner stolenReaders of a hub are disconnected with amqp:link:stolen
set_eventhubs steal_ownerHigher epochA second receiver with a higher owner level takes the partition
a receiver with owner_levelConnection dropEvery connection of the namespace closes; the SDKs reconnect
set_eventhubs drop_connectionsWrong keyWith any_key off, tokens not signed by a policy key get 401
set_eventhubs any_key falseEvents expireEvents older than the hub's retention go
advance_clock
Why not the real sandbox
No Azure subscription
No namespace to provision or pay for; hubs exist the moment create_eventhub runs.
Throttling when you want
ServerBusy and QuotaExceeded on the next send, not when a real namespace happens to hit its limit.
Epochs you can watch
See which receiver owns each partition and its checkpoint, instead of guessing from logs.
Days pass in seconds
Retention runs on the environment clock: test what expired events do without waiting a day.
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.
Check that our order consumer survives a throttled Event Hubs and resumes from its checkpoint.
MCP tools
list_eventhubsNamespaces, hubs, partitions, readers and checkpointscreate_eventhubA hub with partitions, consumer groups and retentionlist_eventhub_eventsEvents with sequence number, offset and partition keyeventhub_sendSend as another producerset_eventhubsServer busy, quota, slow sends, not found, steal owner, dropwait_for_eventhub_eventWait for the app's eventadvance_clockMove time: retention
The same over HTTP
- GET
/api/eventhubs - POST
/api/eventhubs/{namespace}/hubs - GET
/api/eventhubs/{namespace}/{hub}/events - POST
/api/eventhubs/{namespace}/{hub}/events - PUT
/api/eventhubs/{namespace}/settings - GET
/api/eventhubs/{namespace}/{hub}/wait
- AMQP on :5673 (TLS :5671); the Kafka endpoint is plaintext on Streams' :9092.
- Create hubs first: a host that names no Event Hubs namespace becomes a Service Bus one.