static void UsingKafka() { try { var order = OrderExtensions.Create(); KafkaHelper.Produce(order.CreateMessage(Topics.OrderCreated)); } catch (Exception ex) { Console.WriteLine(ex.Message); } }
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); } }