Package kafka.api

Examples of kafka.api.FetchRequestBuilder


    for (int i = 0; i < MAX_KAFKA_FETCH_RETRIES; ++i) {
      if (consumer == null) {
          findLeader();
      }

      FetchRequest req = new FetchRequestBuilder()
        .clientId(clientName)
        .addFetch(topic, partition, fetchOffset, BUFFER_SIZE_BYTES)
        .maxWait(fetchTimeoutMs)
        .build();
      FetchResponse fetchResponse = consumer.fetch(req);
View Full Code Here


    consumer = new SimpleConsumer(broker.getHost(), broker.getPort(), config.socketTimeoutMs,config.socketReceiveBufferBytes, config.clientId);
  }
 
  public ByteBufferMessageSet fetchMessages(int partition, long offset) throws IOException {
    String topic = config.topic;
    FetchRequest req = new FetchRequestBuilder()
        .clientId(config.clientId)
        .addFetch(topic, partition, offset, config.fetchMaxBytes)
        .maxWait(config.fetchWaitMaxMs)
        .build();
    FetchResponse fetchResponse = null;
View Full Code Here

TOP

Related Classes of kafka.api.FetchRequestBuilder

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.