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

This module handles FindCoordinator request & response parsing. Request is built using Kayrock protocol, response is parsed to native KafkaEx structs.

Supported Versions

  • V0: Basic group coordinator discovery
    • Request: group_id
    • Response: error_code, coordinator (node_id, host, port)
  • V1: Extended coordinator discovery with type support
    • Request: coordinator_key, coordinator_type (0=group, 1=transaction)
    • Response: Adds throttle_time_ms, error_message
  • V2: No changes vs V1 (pure version bump)
    • Request: Same as V1 (key, key_type)
    • Response: Same as V1
  • V3: Flexible version (KIP-482)
    • Request: Compact string encoding, +tagged_fields
    • Response: Compact string encoding, +tagged_fields
    • Domain-relevant fields identical to V1/V2

All known versions (V0-V3) have explicit defimpl implementations. An Any fallback is retained for forward compatibility with unknown future Kayrock versions.

Usage

FindCoordinator is primarily used to discover which broker is the coordinator for a consumer group (type=0) or transaction (type=1).