Example #1
0
        /// <summary>
        /// BaseQueueTask constructor
        /// </summary>
        /// <param name="changedQueueManager">
        /// for use with testing
        /// </param>
        /// <param name="queueCode">queue code for this base queue task</param>
        protected BaseQueueTask(QueueCodeType queueCode, QueueManager changedQueueManager = null)
        {
            // DbDrivenQueueProcessor can be swap out for another type of processor
            queueManager = changedQueueManager ?? new QueueManager(new DbDrivenQueueProcessor());
            
            // Reset queue items on initialize
            queueManager.ResetStaleQueueItems();

            // specific queue type that task will be handling
            queueCodeType = queueCode;

            // default retry settings if none specified
            if (RetryIntervalSettings == null)
            {
                RetryIntervalSettings = new ServiceTaskRetryInterval
                                            {
                                                Interval = DEFAULT_INTERVAL,
                                                RetryCount = DEFAULT_RETRY_COUNT
                                            };
            }

            retryQueueItems = new ConcurrentDictionary<int, IQueueItem>();
            retriesLeft = new ConcurrentDictionary<int, int>();
            nextRetryTime = new ConcurrentDictionary<int, DateTime>();
        }
Example #2
0
 /// <summary>
 /// BaseSettlementQueueTask constructor
 /// </summary>
 protected BaseSettlementQueueTask(QueueCodeType queueCode) : base(queueCode)
 {
     // DbDrivenQueueProcessor can be swap out for another type of processor
     settlementManager = new SettlementManager();
     serviceManager = new SettlementServiceManager(FileConfiguration.ReadAppSetting<string>(SETTLEMENT_SERVICE_CONFIG_NAME));
 }