Class SubscriptionReplayTracker
- Namespace
- StockSharp.Messages
- Assembly
- StockSharp.Messages.dll
Tracks active subscriptions for connectors that handle reconnection internally. After reconnection, provides cloned subscriptions with From = null (online-only, no history re-request).
public class SubscriptionReplayTracker
- Inheritance
-
SubscriptionReplayTracker
- Inherited Members
- Extension Methods
Remarks
Designed for connectors like FIX and IMEX that reconnect TCP internally without going through the pipeline's OfflineMessageAdapter. Multi-channel adapters (e.g. IMEX Trade/Risk) use one tracker per logical channel so each reconnect replays only the subscriptions for that channel.
Constructors
SubscriptionReplayTracker()
public SubscriptionReplayTracker()
Properties
Count
Number of currently tracked subscriptions.
public int Count { get; }
Property Value
Methods
Clear()
Clear all tracked subscriptions. Call on full reset/disconnect.
public void Clear()
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.
public IEnumerable<ISubscriptionMessage> GetSubscriptionsForReplay()
Returns
- IEnumerable<ISubscriptionMessage>
Cloned subscription messages ready to be re-sent.
Process(ISubscriptionMessage)
Track or untrack a subscription based on IsSubscribe.
public void Process(ISubscriptionMessage message)
Parameters
messageISubscriptionMessageSubscription message.
Track(ISubscriptionMessage)
Track a subscription. Call when the adapter receives a subscribe message.
public void Track(ISubscriptionMessage message)
Parameters
messageISubscriptionMessageSubscription message (IsSubscribe must be true).
Untrack(long)
Stop tracking a subscription. Call when the adapter receives an unsubscribe message.
public bool Untrack(long originalTransactionId)
Parameters
originalTransactionIdlongOriginal transaction ID of the subscription to remove.