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).
db.subscribe): pass a pattern (* for any id, or a specific id), an optional entity filter, and a callback. Every matching write fires your callback.db.subscribeShared): multiple subscribers join a named consumer group.
operation (create/update/delete), entity, id, and the new data.
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
Subscribe below (defaults: pattern *, any entity). The subscription appears in the Active panel.Create in the Trigger Events card. The Event log on the right shows the event your subscription just received.Update then Delete on the same entity — you'll see three events (create → update → delete), all tagged with your subscription's short id.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.Each action fires a change event. Matching subscriptions receive it instantly.
No record created yet.
No subscriptions yet — subscribe using the card above.
Run all tests clears all subscriptions and runs this workflow, reporting pass/fail for each step:
pattern=*, no entity filter)test_items → expect one eventspecific_entity → writes to other_entity should not fire; writes to specific_entity should