Skip to content

Instantly share code, notes, and snippets.

@agavra
Created November 15, 2023 17:28
Show Gist options
  • Select an option

  • Save agavra/e05e2d58de7d6ce31c4d1c302ea03fac to your computer and use it in GitHub Desktop.

Select an option

Save agavra/e05e2d58de7d6ce31c4d1c302ea03fac to your computer and use it in GitHub Desktop.
Snippet from ConsumerPartitionAssignor
public interface ConsumerPartitionAssignor {
/**
* Return serialized data that will be included in the {@link Subscription} sent to the leader
* and can be leveraged in {@link #assign(Cluster, GroupSubscription)} ((e.g. local host/rack information)
*/
default ByteBuffer subscriptionUserData(Set<String> topics) {
return null;
}
/**
* Perform the group assignment given the member subscriptions and current cluster metadata.
*/
GroupAssignment assign(Cluster metadata, GroupSubscription groupSubscription);
/**
* Callback which is invoked when a group member receives its assignment from the leader.
*/
default void onAssignment(Assignment assignment, ConsumerGroupMetadata metadata) {
}
...
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment