private static async Task SendMessages(IDestination destination, IReceiptBehavior receiptBehavior, IStompTransaction transaction) { var bodyOutgoingMessage = new BodyOutgoingMessage(File.ReadAllBytes(@"Example.xml")).WithPersistence(); //.WithTransaction(transaction); for (int i = 0; i < 10000; i++) { await destination.SendAsync(bodyOutgoingMessage, receiptBehavior); } await transaction.Commit(); Console.WriteLine("Done sending"); }
private async Task SendNotification <T>(IDestination <T> destination, T option, Dictionary <string, object> itemData, Type itemType) where T : BaseOption { if (NotifyOnItem(option, itemType)) { try { await destination.SendAsync( option, itemData) .ConfigureAwait(false); } catch (Exception e) { _logger.LogError(e, "Unable to send webhook."); } } }
public Task SendAsync(IOutgoingMessage message, IReceiptBehavior receiptBehavior) { return(_destination.SendAsync(message, receiptBehavior)); }