Package kafka.api

Examples of kafka.api.MultiFetchResponse


      for(int i=0 ; i < numParts; i++)
      {
        FetchRequest req = new FetchRequest(topic, i, offset, fetchSize);
        list.add(req);
      }
      MultiFetchResponse response = simpleConsumer.multifetch(list);
      if(response.hasNext())
      {
        ByteBufferMessageSet messages = response.next();
        offset+= messages.validBytes();
        bytesRec.getAndAdd(messages.sizeInBytes());
       
        Iterator<Message> it =  messages.iterator();
        while(it.hasNext())
View Full Code Here


      List<FetchRequest> array = new ArrayList<FetchRequest>();
      array.add(fetchRequest);

      tempTime = System.currentTimeMillis();
      MultiFetchResponse response = _consumer.multifetch(array);
      requestTime += (System.currentTimeMillis() - tempTime);

      while (response.hasNext()) {
        ByteBufferMessageSet messages = response.next();

        // check error codes
        _toContinue = checkErrorCode(messages, input);
        if (!_toContinue)
          break;
View Full Code Here

    req = new FetchRequest(KafkaProperties.topic2, 0, 0L, 100);
    List<FetchRequest> list = new ArrayList<FetchRequest>();
    list.add(req);
    req = new FetchRequest(KafkaProperties.topic3, 0, 0L, 100);
    list.add(req);
    MultiFetchResponse response = simpleConsumer.multifetch(list);
    int fetchReq = 0;
    while(response.hasNext())
    {
      System.out.println("Response from fetch request no: " + ++fetchReq);
      messageSet = response.next();
      printMessages(messageSet);
    }
  }
View Full Code Here

TOP

Related Classes of kafka.api.MultiFetchResponse

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.