Ejemplo n.º 1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="RedisQueueTransportOptions"/> class.
        /// </summary>
        /// <param name="sntpTimeConfiguration">The SNTP time configuration.</param>
        /// <param name="delayedProcessingConfiguration">The delayed processing configuration.</param>
        public RedisQueueTransportOptions(SntpTimeConfiguration sntpTimeConfiguration,
                                          DelayedProcessingConfiguration delayedProcessingConfiguration)
        {
            Guard.NotNull(() => sntpTimeConfiguration, sntpTimeConfiguration);
            Guard.NotNull(() => delayedProcessingConfiguration, delayedProcessingConfiguration);

            _clearExpiredMessagesBatchLimit = 50;
            _moveDelayedMessagesBatchLimit  = 50;
            _resetHeartBeatBatchLimit       = 50;
            DelayedProcessingConfiguration  = delayedProcessingConfiguration;
            SntpTimeConfiguration           = sntpTimeConfiguration;
        }
        public void Create_Default()
        {
            var sntpTime = new SntpTimeConfiguration();
            var delay    = new DelayedProcessingConfiguration();
            var test     = new RedisQueueTransportOptions(sntpTime,
                                                          delay);

            Assert.Equal(sntpTime, test.SntpTimeConfiguration);
            Assert.Equal(delay, test.DelayedProcessingConfiguration);

            test.ClearExpiredMessagesBatchLimit = 1000;
            Assert.Equal(1000, test.ClearExpiredMessagesBatchLimit);

            test.MessageIdLocation = MessageIdLocations.Custom;
            Assert.Equal(MessageIdLocations.Custom, test.MessageIdLocation);

            test.MoveDelayedMessagesBatchLimit = 1000;
            Assert.Equal(1000, test.MoveDelayedMessagesBatchLimit);

            test.TimeServer = TimeLocations.Custom;
            Assert.Equal(TimeLocations.Custom, test.TimeServer);
        }