Configuration for a queue that produces messages
Inheritance: QueueConfigurationSend, IReadonly, ISetReadonly
Exemplo n.º 1
0
 public static void Verify(string queueName, string connectionString, QueueProducerConfiguration queueProducerConfiguration, long messageCount)
 {
     using (var verify = new VerifyQueueData(queueName, queueProducerConfiguration, connectionString))
     {
         verify.Verify(messageCount, 0, null);
     }
 }
Exemplo n.º 2
0
        public static AdditionalMessageData GenerateData(QueueProducerConfiguration configuration)
        {
            if (configuration.Options().EnableMessageExpiration ||
                configuration.Options().EnableDelayedProcessing ||
                configuration.Options().EnablePriority ||
                configuration.Options().AdditionalColumns.Count > 0)
            {
                var data = new AdditionalMessageData();

                if (configuration.Options().EnableMessageExpiration)
                    data.SetExpiration(TimeSpan.FromSeconds(1));

                if (configuration.Options().EnableDelayedProcessing)
                    data.SetDelay(TimeSpan.FromSeconds(5));

                if (configuration.Options().EnablePriority)
                    data.SetPriority(5);

                if (configuration.Options().AdditionalColumns.Count > 0)
                {
                    data.AdditionalMetaData.Add(new AdditionalMetaData<int>("OrderID", 123));
                }

                return data;
            }

            return null;
        }
Exemplo n.º 3
0
 public VerifyQueueData(string queueName, QueueProducerConfiguration configuration, string connectionString)
 {
     _configuration = configuration;
     var connection = new BaseConnectionInformation(queueName, connectionString);
     _redisNames = new RedisNames(connection);
     _connection = new RedisConnection(connection);
 }
Exemplo n.º 4
0
 public static void NoVerification(string queueName, string connectionString, QueueProducerConfiguration queueProducerConfiguration, long messageCount)
 {
     
 }
Exemplo n.º 5
0
 public static void Verify(string queueName, string connectionString, QueueProducerConfiguration queueProducerConfiguration, long messageCount)
 {
     new VerifyQueueData(queueName, queueProducerConfiguration.Options()).Verify(messageCount, null);
 }
Exemplo n.º 6
0
        public static AdditionalMessageData GenerateData(QueueProducerConfiguration configuration)
        {
            if (configuration.GetMessageExpiration().HasValue ||
                configuration.GetMessageDelay().HasValue)
            {
                var data = new AdditionalMessageData();

                // ReSharper disable once PossibleInvalidOperationException
                if (configuration.GetMessageExpiration().HasValue && configuration.GetMessageExpiration().Value)
                    data.SetExpiration(TimeSpan.FromSeconds(1));

                // ReSharper disable once PossibleInvalidOperationException
                if (configuration.GetMessageDelay().HasValue && configuration.GetMessageDelay().Value)
                    data.SetDelay(TimeSpan.FromSeconds(5));

                return data;
            }

            return null;
        }
Exemplo n.º 7
0
 public static AdditionalMessageData GenerateDelayExpiredData(QueueProducerConfiguration configuration)
 {
     configuration.SetMessageDelay(true);
     configuration.SetMessageExpiration(true);
     return GenerateData(configuration);
 }