EdgeStream
SubscriptionRegistry
SubscriptionRegistry provides a global view of all active subscriptions across all servers — the data source for the SubscribersMonitor observability component.
What SubscriptionRegistry Does
While SubscriptionManager handles per-server subscription routing, SubscriptionRegistry provides a cross-server enumeration view. It tracks:
- All active subscriptions across all registered servers
- Per-subscription delivery counts and last delivery timestamp
- Topic-level statistics (how many subscribers per topic pattern)
- The callback name for each subscriber (for human-readable display)
Primary Use: SubscribersMonitor
The SubscribersMonitor React component reads from SubscriptionRegistry to display a live view of what is subscribed:
// SubscribersMonitor reads registry entries
// Each entry shows:
{
id: 'sub-a1b2c3d4',
serverId: 'bas',
topic: 'workflow.execution.*',
callbackName: 'handleWorkflowEvent', // function name if named function
active: true,
deliveryCount: 1423,
lastDeliveredAt: new Date('2026-05-25T09:00:00Z'),
errorCount: 2,
}
Accessing Registry Data
import { SubscriptionRegistry } from 'edge-stream-js';
// Get all active subscriptions
const registry = new SubscriptionRegistry();
const all = registry.getAll();
// Get subscriptions for a specific topic
const workflowSubs = registry.getByTopic('workflow.*');
// Get count per topic pattern
const counts = registry.getTopicCounts();
// → { 'workflow.execution.*': 3, 'agent.chat.*': 1, 'hil.*': 2 }
Using SubscribersMonitor
// In admin/dev panel
import { SubscribersMonitor } from 'observability-react';
function AdminPanel() {
return (
<SubscribersMonitor
showTopicBreakdown={true}
showDeliveryCounts={true}
filterByServer="bas"
refreshIntervalMs={2000}
/>
);
}
Registry vs. Manager
SubscriptionManager owns the actual callbacks and performs delivery. SubscriptionRegistry is read-only from the outside — it provides a view for monitoring tools. You never register subscriptions through the registry directly.