Example #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");
        }
Example #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.");
         }
     }
 }
Example #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");

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