Le Proces

This commit is contained in:
Marc-Eric Martel
2023-11-03 19:47:35 -04:00
parent 842045ec4f
commit b111ddda53
29 changed files with 2030 additions and 1618 deletions

View File

@@ -4,18 +4,23 @@ class Program
{
static void Main(string[] args)
{
string mess = "";
while (mess != "quit") {
var config = new ProducerConfig
{
BootstrapServers = "localhost:9092"
};
using var producer = new ProducerBuilder<Null, string>(config).Build();
Console.Write("Enter message (type 'quit' to quit: ");
mess = Console.ReadLine();
var topic = "test-topic";
var message = new Message<Null, string> { Value = "Hello, Kafka!" };
var message = new Message<Null, string> { Value = mess };
producer.Produce(topic, message, deliveryReport => {
Console.WriteLine(deliveryReport.Message.Value);
});
producer.Flush(new TimeSpan(0,0,30));
}
}
}