Shahab,
So, after a few searches, it just makes sense to paste it here. To Commit,
do something like this:
OffsetCommitRequest request = new OffsetCommitRequest(StringgroupId,
Map<TopicAndPartition, OffsetAndMetadata> requestInfo, int correlationId,
String clientId, short versionId);
simpleConsumer.commitOffsets(request);


I am leaving the full constructor header so you know the data typesÅ  And
some code to read the offsets:
OffsetFetchRequest request = new OffsetFetchRequest(String groupId,
List<TopicAndPartition> requestInfo, short versionId, int correlationId,
String clientId);
Map<TopicAndPartition,OffsetMetadataAndError> offsets=
simpleConsumer.fetchOffsets(request).offsets();

Please read the java docs for the offsetCommit and OffsetFetch for what
each of their parameters mean.  But its relatively straightforward.
-Erik



On 8/28/15, 3:07 AM, "shahab" <shahab.mok...@gmail.com> wrote:

>Hi,
>
>I do appreciate  if someone point me to  any java example showing how one
>can implement offset commit  using Simple Consumer API? I have not found
>any !
>
>
>best,
>/Shahab

Reply via email to