New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fetching group topic offsets does not work #95
Comments
it seems to me you're hitting a compatibility issue between different protocol versions. this library uses since update: hm, seems like this won't work so easily. using |
Indeed, |
Does this mean committing won't work either? |
Well, committing offsets from within However, if your java clients are using However, the story around offset management got even a bit more complicated with kafka 0.9 with the group membership API (are your java clients using BTW: I already had a change to do some proof-of-concept work on this issue and learned that kafka 0.9 will sometimes not provide "old" offsets. It appears to keep offsets only for a defined period of time. If you had a consumer which was inactive for let's say 2 days, it might then tell you there's no committed offsets for that consumer (even though it did some commits; i'm still not 100% sure where the problem lies.) If you want to build a resilient lag monitor for a kafka 0.9 instance, it'd probably be better to directly read the |
Ah, I see. Currently, we do not use the Reading from the |
i'm sorry, i haven't seen the format documented (but i haven't searched extensively). however, i'm sure you can find it in one of the two mentioned projects; i'm not much familiar with scala, but this seems to be the place where kafka-manager starts reading/processing the topic. |
@dead10ck i just pushed my partial efforts to the branch you'd need to locally checkout the branch
|
@xitep awesome, thank you! However, I am currently on vacation, so I won't be able to test this until next week. I will definitely give it a go next week though! |
just a minor update: i'm dropping the branch use kafka::client::{KafkaClient, GroupOffsetStorage};
...
let mut client = KafkaClient::new(vec!["localhost:9092"]);
// ~ this is new and will switch the fetch/commit group offset functionality
// to protocol v1
// ~ the default is GroupOffsetStorage::Zookeeper for backwards compatibility
client.set_group_offset_storage(GroupOffsetStorage::Kafka);
try!(client.load_metadata_all());
... Having that said, the public API should be set in this branch; but there's still some work left to do. Nevertheless, I'll be glad if you had a chance to try it out and provide some feedback. |
@xitep that branch appears to be working perfectly :) it is now fetching offsets correctly from Kafka itself on my 0.9 broker |
that sounds good :) thank you for testing! i still need to handle two more error cases which can occur and can/should be transparently handled by |
Available in |
Published on crates.io. |
I'm trying to use this lib to calculate the offset lag for a particular group ID. It seems able to fetch topic metadata though
KafkaClient::fetch_offsets
just fine, but when specifying a group withKafkaClient::fetch_group_topic_offsets
, it returns anUnknownTopicOrPartition
error in the resulting offset entry.this prints out
These are active Kafka (v0.9) topics that are known to be working with the official Java library, and have committed offsets. It's also worth mentioning that when I create a
Consumer
and poll messages on the same group ID, it does not find a committed offset for the group, even though it does have one--it falls back to the offset specified by the fallback option.The text was updated successfully, but these errors were encountered: