Skip to content

[Enhancement] For Kafka .8.2+ Provide Way to Cache and work with Offset Coordinators Similar to BrokerRouter #40

@chadsowald

Description

@chadsowald

Hi. I'm using this library and it has been very helpful. Thank you!

I'm using it and testing against both Kafka .8.1.1 and .8.2-beta with 3 Kafka nodes clustered. While I'm able to get offset management working in both cases, I have to do so differently depending on the Kafka version I'm targeting. Specifically, the new Offset Coordinator concept (https://cwiki.apache.org/confluence/display/KAFKA/A+Guide+To+The+Kafka+Protocol) doesn't allow us to always issue different request types the same way.

In .8.1.1, for any request I can do:

BrokerRouter.SelectBrokerRoute(....).SendAsync(...request)

But, in .8.2-beta I can do the same for everything except OffsetFetch and OffsetCommit, where I have to do:

OffsetCoordinatorConnection.Send(...request)

where I had to create and manage the OffsetCoordinatorConnection (IKafkaConnection), basically repeating what the BrokerRouter already does.

I couldn't use the BrokerRouter to discover the connection for those request types because the leader for a group/topic/partition and the offset coordinator for that same group/topic/partition are not necessarily the same broker, but BrokerRouter.SelectBrokerRoute only ever selects the leader.

As such, I will have to implement my own caching (and refreshing) for these offset coordinators that basically is the same caching you do in Broker Router.

I wanted to share my experience because I suspect you are already aware of these differences, but I wasn't sure what plans you might have to address them. I see that some of your offset management integration tests are ignored for likely these reasons.

Thank you!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions