MCPcopy Create free account
hub / github.com/IBM/sarama / javaConsumerArgs

Function javaConsumerArgs

functional_java_interop_test.go:294–307  ·  view source on GitHub ↗
(topic string, startOffset int64, count int)

Source from the content-addressed store, hash-verified

292}
293
294func 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.

Callers 1

consumeWithJavaFunction · 0.85

Calls 1

kafkaVersionAtLeastFunction · 0.85

Tested by

no test coverage detected