View Source brod_kafka_request (brod v4.4.0)
Helper functions for building request messages.
Summary
Functions
Make a create_topics request.
Make a delete_topics request.
Make a fetch request, If the first arg is a connection pid, call brod_kafka_apis:pick_version/2
to resolve version.
Make a join_group
request.
Make a list_groups
request.
Make a list_offsets
request message for offset resolution. In kafka protocol, -2 and -1 are semantic 'time' to request for 'earliest' and 'latest' offsets. In brod implementation, -2, -1, 'earliest' and 'latest' are semantic 'offset', this is why often a variable named Offset is used as the Time argument.
Make a metadata request.
Make a offset_commit
request.
Make a offset fetch request. NOTE: empty topics list only works for kafka 0.10.2.0 or later
Make a produce request, If the first arg is a connection pid, call brod_kafka_apis:pick_version/2
to resolve version.
Make a sync_group
request.
Types
-type api() :: brod_kafka_apis:api().
-type conn() :: kpro:connection().
-type offset() :: brod:offset().
-type partition() :: brod:partition().
-type topic() :: brod:topic().
-type topic_config() :: kpro:struct().
-type vsn() :: brod_kafka_apis:vsn().
Functions
-spec create_topics(vsn() | conn(), [topic_config()], #{timeout => kpro:int32(), validate_only => boolean()}) -> kpro:req().
Make a create_topics request.
-spec delete_topics(vsn() | conn(), [topic()], pos_integer()) -> kpro:req().
Make a delete_topics request.
-spec fetch(conn(), topic(), partition(), offset(), kpro:wait(), kpro:count(), kpro:count(), kpro:isolation_level()) -> kpro:req().
Make a fetch request, If the first arg is a connection pid, call brod_kafka_apis:pick_version/2
to resolve version.
-spec join_group(conn(), kpro:struct()) -> kpro:req().
Make a join_group
request.
Make a list_groups
request.
-spec list_offsets(conn(), topic(), partition(), brod:offset_time()) -> kpro:req().
Make a list_offsets
request message for offset resolution. In kafka protocol, -2 and -1 are semantic 'time' to request for 'earliest' and 'latest' offsets. In brod implementation, -2, -1, 'earliest' and 'latest' are semantic 'offset', this is why often a variable named Offset is used as the Time argument.
Make a metadata request.
-spec offset_commit(conn(), kpro:struct()) -> kpro:req().
Make a offset_commit
request.
-spec offset_fetch(conn(), brod:group_id(), Topics) -> kpro:req() when Topics :: [{topic(), [partition()]}].
Make a offset fetch request. NOTE: empty topics list only works for kafka 0.10.2.0 or later
-spec produce(conn() | vsn(), topic(), partition(), kpro:batch_input(), integer(), integer(), brod:compression()) -> kpro:req().
Make a produce request, If the first arg is a connection pid, call brod_kafka_apis:pick_version/2
to resolve version.
-spec sync_group(conn(), kpro:struct()) -> kpro:req().
Make a sync_group
request.