View Source KafkaEx.Protocol.Kayrock.SyncGroup.RequestHelpers (kafka_ex v1.0.0-rc.1)

Shared helper functions for building SyncGroup requests across all versions.

Summary

Functions

Builds a SyncGroup request by populating the request template with extracted fields. This is shared logic between V0-V2 requests as they have identical structure.

Builds a SyncGroup V3+ request by populating the request template with common fields plus group_instance_id for static membership (KIP-345).

Extracts common fields from request options and transforms group assignments.

Functions

Link to this function

build_request_from_template(request_template, opts)

View Source
@spec build_request_from_template(map(), Keyword.t()) :: map()

Builds a SyncGroup request by populating the request template with extracted fields. This is shared logic between V0-V2 requests as they have identical structure.

Link to this function

build_v3_plus_request(request_template, opts)

View Source
@spec build_v3_plus_request(map(), Keyword.t()) :: map()

Builds a SyncGroup V3+ request by populating the request template with common fields plus group_instance_id for static membership (KIP-345).

V3 adds group_instance_id: :nullable_string. V4 is the flexible version (KIP-482) with the same logical fields -- Kayrock handles compact encoding.

Link to this function

extract_common_fields(opts)

View Source
@spec extract_common_fields(Keyword.t()) :: %{
  group_id: String.t(),
  generation_id: integer(),
  member_id: String.t(),
  group_assignment: [map()]
}

Extracts common fields from request options and transforms group assignments.