|
@@ -31,7 +31,7 @@ func TestSimpleProducer(t *testing.T) {
|
|
|
pr.AddTopicPartition("my_topic", 0, NoError)
|
|
|
mb2.Returns(pr)
|
|
|
|
|
|
- client, err := NewClient("client_id", []string{mb1.Addr()}, &ClientConfig{MetadataRetries: 1, WaitForElection: 250 * time.Millisecond})
|
|
|
+ client, err := NewClient("client_id", []string{mb1.Addr()}, nil)
|
|
|
if err != nil {
|
|
|
t.Fatal(err)
|
|
|
}
|
|
@@ -68,7 +68,7 @@ func TestSimpleSyncProducer(t *testing.T) {
|
|
|
mb2.Returns(pr)
|
|
|
}
|
|
|
|
|
|
- client, err := NewClient("client_id", []string{mb1.Addr()}, &ClientConfig{MetadataRetries: 1, WaitForElection: 250 * time.Millisecond})
|
|
|
+ client, err := NewClient("client_id", []string{mb1.Addr()}, nil)
|
|
|
if err != nil {
|
|
|
t.Fatal(err)
|
|
|
}
|
|
@@ -102,7 +102,7 @@ func TestMultipleFlushes(t *testing.T) {
|
|
|
mb2.Returns(pr)
|
|
|
mb2.Returns(pr) // yes, twice.
|
|
|
|
|
|
- client, err := NewClient("client_id", []string{mb1.Addr()}, &ClientConfig{MetadataRetries: 1, WaitForElection: 250 * time.Millisecond})
|
|
|
+ client, err := NewClient("client_id", []string{mb1.Addr()}, nil)
|
|
|
if err != nil {
|
|
|
t.Fatal(err)
|
|
|
}
|
|
@@ -148,7 +148,7 @@ func TestMultipleProducer(t *testing.T) {
|
|
|
pr2.AddTopicPartition("topic_c", 0, NoError)
|
|
|
mb3.Returns(pr2)
|
|
|
|
|
|
- client, err := NewClient("client_id", []string{mb1.Addr()}, &ClientConfig{MetadataRetries: 1, WaitForElection: 250 * time.Millisecond})
|
|
|
+ client, err := NewClient("client_id", []string{mb1.Addr()}, nil)
|
|
|
if err != nil {
|
|
|
t.Fatal(err)
|
|
|
}
|
|
@@ -235,7 +235,7 @@ func TestFailureRetry(t *testing.T) {
|
|
|
/* AddTopicPartition("topic_c", 0, 1, NoError). */
|
|
|
/* AddTopicPartition("topic_b", 0, 1, NoError) */
|
|
|
|
|
|
- client, err := NewClient("client_id", []string{mb1.Addr()}, &ClientConfig{MetadataRetries: 1, WaitForElection: 250 * time.Millisecond})
|
|
|
+ client, err := NewClient("client_id", []string{mb1.Addr()}, nil)
|
|
|
if err != nil {
|
|
|
t.Fatal(err)
|
|
|
}
|
|
@@ -302,7 +302,7 @@ func assertNoMessages(t *testing.T, ch chan error) {
|
|
|
}
|
|
|
|
|
|
func ExampleProducer() {
|
|
|
- client, err := NewClient("client_id", []string{"localhost:9092"}, &ClientConfig{MetadataRetries: 1, WaitForElection: 250 * time.Millisecond})
|
|
|
+ client, err := NewClient("client_id", []string{"localhost:9092"}, NewClientConfig())
|
|
|
if err != nil {
|
|
|
panic(err)
|
|
|
} else {
|