Created
November 15, 2020 12:57
-
-
Save wullemsb/0906ee8c0245688b4c2a31272cd2075e to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Create a producer that can be used to send messages to kafka that have no key and a value of type PageViewEvent | |
using var producer = new ProducerBuilder<Null, PageViewEvent>(config) | |
.Build(); | |
//Construct a message to send (generic type must match what was used above when creating the producer) | |
var message = new Message<Null, PageViewEvent> | |
{ | |
Value = new PageViewEvent{ pageUrl=$"http://kafkaexample/{value}"} | |
}; | |
await producer.ProduceAsync("kafka-topic-name", message) ; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment