View Source brod_kafka_request (brod v4.1.0)
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().
-spec delete_topics(vsn() | conn(), [topic()], pos_integer()) -> kpro:req().
Link to this function
fetch(Pid, Topic, Partition, Offset, WaitTime, MinBytes, MaxBytes, IsolationLevel)
View Source-spec fetch(conn(), topic(), partition(), offset(), kpro:wait(), kpro:count(), kpro:count(), kpro:isolation_level()) -> kpro:req().
brod_kafka_apis:pick_version/2
to resolve version.
-spec join_group(conn(), kpro:struct()) -> kpro:req().
join_group
request.
list_groups
request.
-spec list_offsets(conn(), topic(), partition(), brod:offset_time()) -> kpro:req().
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.
-spec offset_commit(conn(), kpro:struct()) -> kpro:req().
offset_commit
request.
-spec offset_fetch(conn(), brod:group_id(), Topics) -> kpro:req() when Topics :: [{topic(), [partition()]}].
Link to this function
produce(MaybePid, Topic, Partition, BatchInput, RequiredAcks, AckTimeout, Compression)
View Source-spec produce(conn() | vsn(), topic(), partition(), kpro:batch_input(), integer(), integer(), brod:compression()) -> kpro:req().
brod_kafka_apis:pick_version/2
to resolve version.
-spec sync_group(conn(), kpro:struct()) -> kpro:req().
sync_group
request.