1
Kafkaサーバーポーリングのコンシューマー/クライアント(KAFKA 0.10.0.0)はありますか?Kafkaサーバーのポーリングに代わって
KafkaConsumer<String, String> consumer = new KafkaConsumer<>(props);
consumer.subscribe(Arrays.asList("foo", "bar"));
while (true) {
ConsumerRecords<String, String> records = consumer.poll(100);
for (ConsumerRecord<String, String> record : records)
System.out.printf("offset = %d, key = %s, value = %s", record.offset(), record.key(), record.value());
}
なぜこの質問をしますか?ポーリングはあなたに何か問題を提起していますか? –
実際に私の要件は、消費者のための残りのAPIを実装することです。それが継続的にポーリングされている場合、私は消費者からメッセージを得ることができませんでした。 – gsc0441
ConfluentのRESTプロキシを使用しないのはなぜですか? https://github.com/confluentinc/kafka-restおよびhttp://docs.confluent.io/3.0.0/kafka-rest/docs/およびhttp://www.confluent.io/blog/a-comprehensive -open-source-rest-proxy-for-kafka/ –