(topic string, startOffset int64, count int)
| 292 | } |
| 293 | |
| 294 | func javaConsumerArgs(topic string, startOffset int64, count int) []string { |
| 295 | args := make([]string, 0, 12) |
| 296 | if kafkaVersionAtLeast("0.10.0") { |
| 297 | args = append(args, "--bootstrap-server", brokerAddr) |
| 298 | } else { |
| 299 | args = append(args, "--zookeeper", zookeeperAddr) |
| 300 | } |
| 301 | return append(args, |
| 302 | "--topic", topic, |
| 303 | "--partition", "0", |
| 304 | "--offset", fmt.Sprint(startOffset), |
| 305 | "--max-messages", fmt.Sprint(count), |
| 306 | ) |
| 307 | } |
| 308 | |
| 309 | // produceKeyedWithJava produces key:value messages via the Java console producer, |
| 310 | // which uses the DefaultPartitioner (murmur2) when a key is present. |
no test coverage detected