Skip to content

Add an interface for sending structs automatically to the consumer group coordinator #978

Closed
@jeffwidman

Description

@jeffwidman

Currently, there is no convenient way to send a low-level struct to the Kafka broker that's the coordinator for a particular consumer group. We have to manually send a GroupCoordinatorRequest to retrieve the broker ID that's currently the coordinator, then send structs to that broker. Slightly inconvenient, but not horrible.

However, sometimes the group coordinator broker crashes, so this code needs to have the retry logic in place to catch the exception, identify the new GroupCoordinator, and switch to that. It gets painful pretty quickly because we have to keep track of which exceptions are retriable and which are fatal.

It'd be better if this logic was all encapsulated in a single interface somewhere where I can give the consumer group name and the struct.

The function signature seems pretty simple:

send_to_consumer_group_coordinator(consumer_group_name='my-consumer', request=structRequest)

However, I'm not sure where exactly this should go... KafkaClient, the new Admin client, or somewhere else?

@dpkp if you can advise on the design, I'm happy to take a stab at initial implementation... I do think the first few releases of this should warn that it's a beta API subject to change.

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