Skip to content

Instantly share code, notes, and snippets.

@awswithdotnet
Created March 8, 2022 20:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save awswithdotnet/776e262fe665ec7e5a14d82a3c0614cc to your computer and use it in GitHub Desktop.
Save awswithdotnet/776e262fe665ec7e5a14d82a3c0614cc to your computer and use it in GitHub Desktop.
kafka KafkaMessageProducer Partial 7
_producer = new ProducerBuilder<String, String>(config).Build();
_producer.Produce(_topic, new Message<string, string> { Key = Guid.NewGuid().ToString(), Value = "New Message: " + DateTime.Now.ToString() }, deliveryReportHandler);
_producer.Flush(TimeSpan.FromSeconds(_flushTime));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment