SubscriptionReplayTracker
Tracks active subscriptions for connectors that handle reconnection internally. After reconnection, provides cloned subscriptions with From = null (online-only, no history re-request).
Properties
public int Count { get; }
value = subscriptionReplayTracker.Count
Number of currently tracked subscriptions.
Methods
public void Clear()
subscriptionReplayTracker.Clear()
Clear all tracked subscriptions. Call on full reset/disconnect.
public IEnumerable<ISubscriptionMessage> GetSubscriptionsForReplay()
result = subscriptionReplayTracker.GetSubscriptionsForReplay()
Get all active subscriptions for replay after an internal reconnect. Returns clones with From = null under the original transaction IDs so the reconnect stays transparent to code above the adapter — external subscribers keep receiving data under the txId they originally subscribed with.
Returns: Cloned subscription messages ready to be re-sent.
public void Process(ISubscriptionMessage message)
subscriptionReplayTracker.Process(message)
Track or untrack a subscription based on IsSubscribe.
- message
- Subscription message.
public void Track(ISubscriptionMessage message)
subscriptionReplayTracker.Track(message)
Track a subscription. Call when the adapter receives a subscribe message.
- message
- Subscription message (IsSubscribe must be true).
public bool Untrack(long originalTransactionId)
result = subscriptionReplayTracker.Untrack(originalTransactionId)
Stop tracking a subscription. Call when the adapter receives an unsubscribe message.
- originalTransactionId
- Original transaction ID of the subscription to remove.
Returns: if the subscription was found and removed.