public void Test_DefaultNotReadOnly()
        {
            var configuration = new RedisQueueTransportOptions(new SntpTimeConfiguration(),
                                                               new DelayedProcessingConfiguration());

            Assert.False(configuration.IsReadOnly);
        }
Beispiel #2
0
        /// <summary>
        /// Initializes a new instance of the <see cref="GetMessageIdFactory"/> class.
        /// </summary>
        /// <param name="container">The container.</param>
        /// <param name="options">The options.</param>
        public GetMessageIdFactory(IContainerFactory container, RedisQueueTransportOptions options)
        {
            Guard.NotNull(() => container, container);
            Guard.NotNull(() => options, options);

            _container = container;
            _options   = options;
        }
        /// <summary>
        /// Initializes a new instance of the <see cref="UnixTimeFactory"/> class.
        /// </summary>
        /// <param name="container">The container.</param>
        /// <param name="options">The options.</param>
        public UnixTimeFactory(IContainerFactory container, RedisQueueTransportOptions options)
        {
            Guard.NotNull(() => container, container);
            Guard.NotNull(() => options, options);

            _container = container;
            _options = options;
        }
        public void Set_Readonly()
        {
            var configuration = new RedisQueueTransportOptions(new SntpTimeConfiguration(),
                                                               new DelayedProcessingConfiguration());

            configuration.SetReadOnly();
            Assert.True(configuration.IsReadOnly);
        }
Beispiel #5
0
        /// <summary>
        /// Initializes a new instance of the <see cref="ClearExpiredMessagesCommandHandler" /> class.
        /// </summary>
        /// <param name="clearExpiredMessagesLua">The clear expired messages.</param>
        /// <param name="unixTimeFactory">The unix time factory.</param>
        /// <param name="options">The options.</param>
        public ClearExpiredMessagesCommandHandler(ClearExpiredMessagesLua clearExpiredMessagesLua,
                                                  IUnixTimeFactory unixTimeFactory,
                                                  RedisQueueTransportOptions options)
        {
            Guard.NotNull(() => clearExpiredMessagesLua, clearExpiredMessagesLua);
            Guard.NotNull(() => unixTimeFactory, unixTimeFactory);
            Guard.NotNull(() => options, options);

            _clearExpiredMessagesLua = clearExpiredMessagesLua;
            _unixTimeFactory         = unixTimeFactory;
            _options = options;
        }
Beispiel #6
0
 public GetErrorRecordsToDeleteQueryHandler(IRedisConnection connection,
                                            IUnixTimeFactory timeFactory,
                                            IMessageErrorConfiguration errorConfiguration,
                                            RedisNames names,
                                            RedisQueueTransportOptions options)
 {
     _connection         = connection;
     _names              = names;
     _errorConfiguration = errorConfiguration;
     _options            = options;
     _unixTime           = timeFactory;
 }
        /// <summary>
        /// Initializes a new instance of the <see cref="MoveDelayedRecordsCommandHandler" /> class.
        /// </summary>
        /// <param name="moveDelayedToPendingLua">The move delayed to pending lua.</param>
        /// <param name="unixTimeFactory">The unix time factory.</param>
        /// <param name="options">The options.</param>
        public MoveDelayedRecordsCommandHandler(
            MoveDelayedToPendingLua moveDelayedToPendingLua,
            IUnixTimeFactory unixTimeFactory,
            RedisQueueTransportOptions options)
        {
            Guard.NotNull(() => moveDelayedToPendingLua, moveDelayedToPendingLua);
            Guard.NotNull(() => unixTimeFactory, unixTimeFactory);
            Guard.NotNull(() => options, options);

            _moveDelayedToPendingLua = moveDelayedToPendingLua;
            _unixTimeFactory         = unixTimeFactory;
            _options = options;
        }
Beispiel #8
0
        /// <summary>
        /// Initializes a new instance of the <see cref="MoveDelayedRecordsCommandHandler" /> class.
        /// </summary>
        /// <param name="moveDelayedToPendingLua">The move delayed to pending lua.</param>
        /// <param name="unixTimeFactory">The unix time factory.</param>
        /// <param name="options">The options.</param>
        /// <param name="queueContext">The queue context.</param>
        public MoveDelayedRecordsCommandHandler(
            MoveDelayedToPendingLua moveDelayedToPendingLua,
            IUnixTimeFactory unixTimeFactory,
            RedisQueueTransportOptions options,
            QueueContext queueContext)
        {
            Guard.NotNull(() => moveDelayedToPendingLua, moveDelayedToPendingLua);
            Guard.NotNull(() => unixTimeFactory, unixTimeFactory);
            Guard.NotNull(() => options, options);
            Guard.NotNull(() => queueContext, queueContext);

            _moveDelayedToPendingLua = moveDelayedToPendingLua;
            _unixTimeFactory         = unixTimeFactory;
            _options  = options;
            _rpcQueue = queueContext.Context == QueueContexts.RpcQueue;
        }
        /// <summary>
        /// Initializes a new instance of the <see cref="RollbackMessageCommandHandler" /> class.
        /// </summary>
        /// <param name="configuration">The configuration.</param>
        /// <param name="resetHeartbeatLua">The reset heartbeat lua.</param>
        /// <param name="unixTimeFactory">The unix time factory.</param>
        /// <param name="options">The options.</param>
        /// <param name="queueContext">The queue context.</param>
        public ResetHeartBeatCommandHandler(IHeartBeatConfiguration configuration,
                                            ResetHeartbeatLua resetHeartbeatLua,
                                            IUnixTimeFactory unixTimeFactory,
                                            RedisQueueTransportOptions options,
                                            QueueContext queueContext)
        {
            Guard.NotNull(() => configuration, configuration);
            Guard.NotNull(() => resetHeartbeatLua, resetHeartbeatLua);
            Guard.NotNull(() => unixTimeFactory, unixTimeFactory);
            Guard.NotNull(() => options, options);
            Guard.NotNull(() => queueContext, queueContext);

            _configuration     = configuration;
            _resetHeartbeatLua = resetHeartbeatLua;
            _unixTimeFactory   = unixTimeFactory;
            _options           = options;
        }
        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);
        }