Exemplo n.º 1
0
        public static AdditionalMessageData GenerateDataWithColumnValue(QueueProducerConfiguration configuration,
                                                                        int columnValue)
        {
            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);
            }


            data.AdditionalMetaData.Add(new AdditionalMetaData <int>("OrderID", columnValue));


            return(data);
        }
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 static AdditionalMessageData GenerateData(QueueProducerConfiguration configuration)
        {
            if (configuration.Options().EnableMessageExpiration ||
                configuration.Options().EnableDelayedProcessing)
            {
                var data = new AdditionalMessageData();

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

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

                return(data);
            }

            return(new AdditionalMessageData());
        }
Exemplo n.º 4
0
 public static void Verify(string queueName, string connectionString, QueueProducerConfiguration queueProducerConfiguration, long messageCount, string route, ICreationScope scope)
 {
     new VerifyQueueData(queueName, queueProducerConfiguration.Options()).Verify(messageCount, route);
 }
 public static void Verify(QueueConnection queueConnection, QueueProducerConfiguration queueProducerConfiguration, long messageCount, ICreationScope scope)
 {
     new VerifyQueueData(queueConnection, queueProducerConfiguration.Options()).Verify(messageCount, null);
 }