Esempio n. 1
0
 static void UsingKafka()
 {
     try
     {
         var order = OrderExtensions.Create();
         KafkaHelper.Produce(order.CreateMessage(Topics.OrderCreated));
     }
     catch (Exception ex)
     {
         Console.WriteLine(ex.Message);
     }
 }
Esempio n. 2
0
 private static void Process(OrderMessage orderMessage)
 {
     try
     {
         Console.WriteLine($"Processing order {orderMessage.Order.OrderId}");
         orderMessage.Order.Ship();
         KafkaHelper.Produce(orderMessage.Order.CreateMessage(Topics.OrderShipped));
     }
     catch (Exception ex)
     {
         Console.WriteLine(ex.Message);
     }
 }