parseResponse method

  1. @override
GroupOffsetCommitResponse parseResponse(
  1. List<int> bytes
)
override

Implementation

@override
GroupOffsetCommitResponse parseResponse(List<int> bytes) {
  final response = super.parseResponse(bytes);
  if (response.topics.length != 1 ||
      response.topics.single.name != topic ||
      response.topics.single.partitions.length != nextOffsets.length) {
    throw const FormatException(
        'Member OffsetCommit response does not match request');
  }
  final seen = <int>{};
  for (final partition in response.topics.single.partitions) {
    if (!nextOffsets.containsKey(partition.partitionIndex) ||
        !seen.add(partition.partitionIndex)) {
      throw const FormatException(
          'Unexpected or duplicate member commit partition');
    }
  }
  return response;
}