Просмотр исходного кода

Merge pull request #68 from JnBrymn/example-fix

Fixed Producer and Consumer examples.
Willem van Bergen 11 лет назад
Родитель
Сommit
43437da69d
2 измененных файлов с 2 добавлено и 2 удалено
  1. 1 1
      consumer_test.go
  2. 1 1
      producer_test.go

+ 1 - 1
consumer_test.go

@@ -121,7 +121,7 @@ func ExampleConsumer() {
 	}
 	defer client.Close()
 
-	consumer, err := NewConsumer(client, "my_topic", 0, "my_consumer_group", nil)
+	consumer, err := NewConsumer(client, "my_topic", 0, "my_consumer_group", &ConsumerConfig{MaxWaitTime: 200})
 	if err != nil {
 		panic(err)
 	} else {

+ 1 - 1
producer_test.go

@@ -313,7 +313,7 @@ func ExampleProducer() {
 	}
 	defer client.Close()
 
-	producer, err := NewProducer(client, &ProducerConfig{RequiredAcks: WaitForLocal})
+	producer, err := NewProducer(client, &ProducerConfig{RequiredAcks: WaitForLocal, MaxBufferedBytes: 1024, MaxBufferTime: 1000})
 	if err != nil {
 		panic(err)
 	}