Module kpro_brokers

Data Types

config()

config() = kpro_connection:config()

connection()

connection() = kpro:connection()

coordinator_type()

coordinator_type() = kpro:coordinator_type()

endpoint()

endpoint() = kpro:endpoint()

group_id()

group_id() = kpro:group_id()

partition()

partition() = kpro:partition()

topic()

topic() = kpro:topic()

transactional_id()

transactional_id() = kpro:transactional_id()

Function Index

connect_any/2Connect to any of the endpoints in the given list.
connect_controller/3Conect to the controller broker of the kafka cluster.
connect_coordinator/3Connect group or transaction coordinator.
connect_partition_leader/5Connect partition leader.
discover_coordinator/4Discover group or transactional coordinator.
discover_partition_leader/4Discover partition leader endpoint.
get_api_versions/1Qury API version ranges using the given kpro_connection pid.
get_api_vsn_range/2Get API version range.
with_connection/3Evaluate given function with a connection to any of the nodes in in the given endpoints.

Function Details

connect_any/2

connect_any(Endpoints0::[endpoint()], Config::config()) -> {ok, connection()} | {error, any()}

Connect to any of the endpoints in the given list.

connect_controller/3

connect_controller(Bootstrap::connection() | [endpoint()], Config::config(), Opts::#{timeout => timeout()}) -> {ok, connection()} | {error, any()}

Conect to the controller broker of the kafka cluster.

connect_coordinator/3

connect_coordinator(Bootstrap::connection() | [endpoint()], Config::config(), Args::#{type => kpro:coordinator_type(), id => binary(), timeout => timeout()}) -> {ok, connection()} | {error, any()}

Connect group or transaction coordinator. If the first arg is not a connection pid but a list of bootstrapping endpoints, it will frist try to connect to any of the nodes NOTE: 'txn' type only applicable to kafka 0.11 or later

connect_partition_leader/5

connect_partition_leader(Bootstrap::connection() | [endpoint()], Config::config(), Topic::topic(), Partition::partition(), Opts::#{timeout => timeout()}) -> {ok, connection()} | {error, any()}

Connect partition leader. If the fist arg is not an already established metadata connection but a bootstrapping endpoint list, this function will first try to establish a temp connection to any of the bootstrapping endpoints. Then send metadata request to discover partition leader broker Finally connect to the leader broker.

discover_coordinator/4

discover_coordinator(Connection::connection(), Type::coordinator_type(), Id::group_id() | transactional_id(), Timeout::timeout()) -> {ok, endpoint()} | {error, any()}

Discover group or transactional coordinator.

discover_partition_leader/4

discover_partition_leader(Connection::connection(), Topic::topic(), Partition::partition(), Timeout::timeout()) -> {ok, endpoint()} | {error, any()}

Discover partition leader endpoint.

get_api_versions/1

get_api_versions(Connection::connection()) -> {ok, kpro:vsn_ranges()} | {error, any()}

Qury API version ranges using the given kpro_connection pid. The return value is an intersection of queried version ranges and version ranges supported in THIS library.

get_api_vsn_range/2

get_api_vsn_range(Connection::connection(), API::kpro:api()) -> {ok, kpro:vsn_range()} | {error, any()}

Get API version range.

with_connection/3

with_connection(Endpoints::[endpoint()], Config::config(), Fun::fun((connection()) -> Return)) -> Return

Evaluate given function with a connection to any of the nodes in in the given endpoints. Raise a 'throw' exception if failed to connect all endpoints.


Generated by EDoc