예제 #1
0
        public static SimpleMessage CreateSimpleMessage(int messagePayloadLength, int processingTime)
        {
            var message = new SimpleMessage
            {
                Message = RandomString.Create(messagePayloadLength), ProcessingTime = processingTime
            };

            return(message);
        }
예제 #2
0
        public static SimpleMessage CreateSimpleExpiredMessage()
        {
            var message = new SimpleMessage
            {
                Message        = RandomString.Create(100),
                ProcessingTime = 100
            };

            return(message);
        }
예제 #3
0
        public static IEnumerable <SimpleMessage> CreateSimpleMessageRetryError(int messagePayloadLength, bool failAtEnd)
        {
            var message = new SimpleMessage
            {
                Message        = RandomString.Create(messagePayloadLength),
                ProcessingTime = 100,
                Error          = failAtEnd ? ErrorTypes.RetryableErrorFail : ErrorTypes.RetryableError,
            };

            yield return(message);
        }
예제 #4
0
        public static IEnumerable <SimpleMessage> CreateSimpleMessageError(int messagePayloadLength, int processingTime)
        {
            var message = new SimpleMessage
            {
                Message        = RandomString.Create(messagePayloadLength),
                ProcessingTime = processingTime,
                Error          = ErrorTypes.Error
            };

            yield return(message);
        }
예제 #5
0
 public static async Task<List<IQueueOutputMessage>> RunAsync(IProducerQueue<SimpleMessage> queue, SimpleMessage message, IAdditionalMessageData data)
 {
     var returnData = new List<IQueueOutputMessage>();
     Log.Logger.Information("Sending...");
     returnData.Add(await queue.SendAsync(message, data));
     Log.Logger.Information("Done");
     return returnData;
 }
예제 #6
0
 public static IEnumerable<IQueueOutputMessage> Run(IProducerQueue<SimpleMessage> queue, SimpleMessage message, IAdditionalMessageData data)
 {
     Log.Logger.Information("Sending...");
     yield return queue.Send(message, data);
     Log.Logger.Information("Done");
 }