Beispiel #1
0
        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");
        }
Beispiel #2
0
 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.");
         }
     }
 }
Beispiel #3
0
        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");

        }
Beispiel #4
0
 public Task SendAsync(IOutgoingMessage message, IReceiptBehavior receiptBehavior)
 {
     return(_destination.SendAsync(message, receiptBehavior));
 }