protected void DoRestoreConsumers(ITransport transport, SessionState sessionState)
{
// Restore the session's consumers but possibly in pull only (prefetch 0 state) till
// recovery completes.
ConnectionState connectionState = connectionStates[sessionState.Info.SessionId.ParentId];
bool connectionInterruptionProcessingComplete =
connectionState.ConnectionInterruptProcessingComplete;
// Restore the session's consumers
foreach(ConsumerState consumerState in sessionState.ConsumerStates)
{
ConsumerInfo infoToSend = consumerState.Info;
if(!connectionInterruptionProcessingComplete && infoToSend.PrefetchSize > 0 && transport.WireFormat.Version > 5)
{
infoToSend = consumerState.Info.Clone() as ConsumerInfo;
connectionState.RecoveringPullConsumers.Add(infoToSend.ConsumerId, consumerState.Info);
infoToSend.PrefetchSize = 0;
if(Tracer.IsDebugEnabled)
{
Tracer.Debug("restore consumer: " + infoToSend.ConsumerId +
" in pull mode pending recovery, overriding prefetch: " +
consumerState.Info.PrefetchSize);
}
}
if(Tracer.IsDebugEnabled)
{
Tracer.Debug("restore consumer: " + infoToSend.ConsumerId);
}
transport.Oneway(infoToSend);
}
}