Apache.NMS.ActiveMQ.State.ConnectionStateTracker.ConnectionInterruptProcessingComplete C# (CSharp) Method

ConnectionInterruptProcessingComplete() public method

public ConnectionInterruptProcessingComplete ( ITransport transport, ConnectionId connectionId ) : void
transport ITransport
connectionId Apache.NMS.ActiveMQ.Commands.ConnectionId
return void
        public void ConnectionInterruptProcessingComplete(ITransport transport, ConnectionId connectionId)
        {
            ConnectionState connectionState = connectionStates[connectionId];
            if(connectionState != null)
            {
                connectionState.ConnectionInterruptProcessingComplete = true;

                Dictionary<ConsumerId, ConsumerInfo> stalledConsumers = connectionState.RecoveringPullConsumers;
                foreach(KeyValuePair<ConsumerId, ConsumerInfo> entry in stalledConsumers)
                {
                    ConsumerControl control = new ConsumerControl();
                    control.ConsumerId = entry.Key;
                    control.Prefetch = entry.Value.PrefetchSize;
                    control.Destination = entry.Value.Destination;
                    try
                    {
                        if(Tracer.IsDebugEnabled)
                        {
                            Tracer.Debug("restored recovering consumer: " + control.ConsumerId +
                                         " with: " + control.Prefetch);
                        }
                        transport.Oneway(control);
                    }
                    catch(Exception ex)
                    {
                        if(Tracer.IsDebugEnabled)
                        {
                            Tracer.Debug("Failed to submit control for consumer: " + control.ConsumerId +
                                         " with: " + control.Prefetch + "Error: " + ex.Message);
                        }
                    }
                }
                stalledConsumers.Clear();
            }
        }