Portal Community

What SubscriptionRegistry Does

While SubscriptionManager handles per-server subscription routing, SubscriptionRegistry provides a cross-server enumeration view. It tracks:

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.