Skip to content

Commit

Permalink
Docs: update readme 0.1.1
Browse files Browse the repository at this point in the history
  • Loading branch information
asheswook committed Jun 10, 2024
1 parent 183d6b1 commit 674c274
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,23 +28,20 @@ import (
func main() {
wg := &sync.WaitGroup{}

brokers := []string{"localhost:9092", "localhost:9093", "localhost:9094"}
origin := qstreamer.NewTopic("origin-topic", 3) // Topic name and partition
brokers := []string{"localhost:9092"}
origin := qstreamer.Topic("origin-topic", 3) // Topic name and partition

// Serializer that converts the message to the message to be produced.
// In this case, the message is not converted, so it is a pass-through serializer.
serializer := qstreamer.NewPassThroughSerializer()

destination1 := qstreamer.NewTopic("destination-topic-1", 5) // Topic name and partition
destination2 := qstreamer.NewTopic("destination-topic-2", 3)
destination1 := qstreamer.Topic("destination-topic-1", 5) // Topic name and partition

streamer := qstreamer.NewTopicStreamer(brokers, origin)

cfg := qstreamer.NewStreamConfig(serializer, destination1)
streamer.AddConfig(cfg)

cfg = qstreamer.NewStreamConfig(serializer, destination2)
streamer.AddConfig(cfg)

streamer.Run() // Non-blocking
defer streamer.Stop()
Expand Down

0 comments on commit 674c274

Please sign in to comment.