rust-rdkafka icon indicating copy to clipboard operation
rust-rdkafka copied to clipboard

Add member assignments parsing

Open messense opened this issue 4 years ago • 7 comments

messense avatar Dec 02 '19 10:12 messense

Hi, @messense, thanks for the PR! I'm afraid I don't think that this Rust wrapper of librdkafka is the correct place for this code. It seems like something that would be better handled by librdkafka itself. I've opened https://github.com/edenhill/librdkafka/issues/2643 to discuss.

I'm going to hold off on reviewing this PR until upstream responds!

benesch avatar Dec 02 '19 14:12 benesch

Hi @messense, sorry for the long delay. It looks like upstream, sadly, does not want to maintain this code, so I suppose we can take it here. It will need a test, though. If you can provide one, that would be great. Otherwise I'll try to get to it myself eventually.

benesch avatar May 15 '20 23:05 benesch

Hi, do you still plan to merge this PR? It would be awesome to be able to access the topics consumed by a group

ianFar96 avatar May 26 '23 22:05 ianFar96

Merging this PR is blocked on someone having time to write a test. If you are up for it, that would be great.

benesch avatar May 27 '23 18:05 benesch

I started playing with rust a few weeks ago so I'm not feeling 100% confident about this. I'll give it a try and see what comes out of it. For the time being I can confirm that the proposed solution works as expected :+1:

ianFar96 avatar May 27 '23 22:05 ianFar96

Hi, I expanded the test_group_membership test with this:

assert_eq!(consumer_member.assignment().unwrap().len(), 1);

let assignment_topic = &consumer_member.assignment().unwrap()[0];
assert_eq!(
    assignment_topic,
    &MemberAssignment {
        partitions: vec![0, 1, 2],
        topic: topic_name
    }
);

I hope it's enough, if it is how should I proceed? I don't have permissions to push on this branch, should I fork the fork and open another one?

ianFar96 avatar May 28 '23 08:05 ianFar96

Yeah, that's probably good enough! A new PR sounds good.

benesch avatar May 28 '23 15:05 benesch