Subscriptions — reactive change events

Register a callback and MQDB calls it every time a matching record is created, updated, or deleted. Subscriptions can be basic (every matching event goes to every subscriber) or shared via a consumer group (broadcast to all members, or load-balanced to just one).

How it works

flowchart LR
    C["db.create / update / delete"] --> E[ChangeEvent]
    E --> B1[Basic sub A]
    E --> B2[Basic sub B]
    E --> GB[Shared group
broadcast mode] E --> GL[Shared group
load-balanced mode] GB --> M1[Member 1] GB --> M2[Member 2] GB --> M3[Member 3] GL --> W1[Member 1] GL -. or .-> W2[Member 2] GL -. or .-> W3[Member 3] style E fill:#e3f2fd,stroke:#1565c0 style GB fill:#f3e5f5,stroke:#7b1fa2 style GL fill:#f3e5f5,stroke:#7b1fa2

Try it — a four-step tour

  1. Click Subscribe below (defaults: pattern *, any entity). The subscription appears in the Active panel.
  2. Click Create in the Trigger Events card. The Event log on the right shows the event your subscription just received.
  3. Click Update then Delete on the same entity — you'll see three events (create → update → delete), all tagged with your subscription's short id.
  4. Create a shared subscription in the second card with mode load-balanced, then open a second tab and do the same — events round-robin between the tabs. Switch to broadcast and both tabs receive every event.

Create a subscription

Basic subscription

Shared subscription (consumer group)

Trigger events

Each action fires a change event. Matching subscriptions receive it instantly.

No record created yet.

Consumer groups

Subscription info

Active subscriptions 0

No subscriptions yet — subscribe using the card above.

Event log 0 events

Waiting for events…

Automated test suite

Run all tests clears all subscriptions and runs this workflow, reporting pass/fail for each step:

  1. Subscribe to every event (pattern=*, no entity filter)
  2. Create a record in test_items → expect one event
  3. Update it → expect one event
  4. Delete it → expect one event
  5. Unsubscribe → expect no further events when another record is created
  6. Subscribe with entity filter specific_entity → writes to other_entity should not fire; writes to specific_entity should
Click a test button above to run.

Log