Skip to content

Subscribing to a feed

Wire a subscription once, then deliver directlyCreation path for a reader; later subscribers in the group can join it. MONGOOSE / RUNTIME ARCHITECTURE Wire a subscription once, then deliver directly Creation path for a reader; later subscribers in the group can join it. Processor Group agent Flow manager Feed publisher 1. Subscribe: feed and callback key 2. Get mapping agent for this group 3. Attach target queue 4. Return queue reader and strategy Register processor 6. Subscribe source key 7. Source receives subscription Removal retires an empty reader; source unsubscribe waits until no group reads that subscription key.

The processor is wired to its group's event feed. A subscription callback asks the group for the feed/callback reader. EventFlowManager.getMappingAgent creates that reader, creates or reuses the feed/group queue and adds it to the publisher. The group registers the processor with the reader and asks the source to subscribe.

Another processor in the same group may join the existing reader. On removal, the group removes that processor's registration first. Only an empty reader is retired. The source is unsubscribed when the reader count for that subscription reaches zero across groups.

Subscription callbacks and reader mutations must respect group ownership. During normal runtime these occur on the group thread; calling a running processor directly from another thread bypasses this protection.