public static SimpleMessage CreateSimpleMessage(int messagePayloadLength, int processingTime) { var message = new SimpleMessage { Message = RandomString.Create(messagePayloadLength), ProcessingTime = processingTime }; return(message); }
public static SimpleMessage CreateSimpleExpiredMessage() { var message = new SimpleMessage { Message = RandomString.Create(100), ProcessingTime = 100 }; return(message); }
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); }
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); }
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; }
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"); }