Support Questions

Find answers, ask questions, and share your expertise

How to consume kafka messages from a specific offset in nifi ConsumeKafka processors?

avatar
Master Collaborator

Hello Experts,

I am using Apache Nifi 1.25 now and have a requirement to consume data from a specific offset of a topic partition.

I see in Nifi ConsumeKafka processor to configure only "earliest" or "latest" but not specific offset number, is there any way to achieve this ?

 

Any info/suggestion would be appreciated.

 

Thanks,

Mahendra

1 ACCEPTED SOLUTION

avatar
Master Collaborator

Not possible, there is a reason for that if we allow to add a property to set an initial offset, every time that processor was stopped and started we would again start at that configured offset, with console consumer, you only pass the initial offset on the first execution

then subsequent executions use the last stored offset in Kafka, which is not the case here with the processor.
Thus only two options are "earliest" or "latest".
 
Thank you
 

View solution in original post

1 REPLY 1

avatar
Master Collaborator

Not possible, there is a reason for that if we allow to add a property to set an initial offset, every time that processor was stopped and started we would again start at that configured offset, with console consumer, you only pass the initial offset on the first execution

then subsequent executions use the last stored offset in Kafka, which is not the case here with the processor.
Thus only two options are "earliest" or "latest".
 
Thank you