View Source brod_kafka_request (brod v3.17.0)

Helper functions for building request messages.

Link to this section Summary

Functions

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.

Link to this section Types

Link to this section Functions

Link to this function

create_topics(Connection, TopicConfigs, RequestConfigs)

View Source
-spec create_topics(vsn() | conn(),
              [topic_config()],
              #{timeout => kpro:int32(), validate_only => boolean()}) ->
                 kpro:req().
Make a create_topics request.
Link to this function

delete_topics(Connection, Topics, Timeout)

View Source
-spec delete_topics(vsn() | conn(), [topic()], pos_integer()) -> kpro:req().
Make a delete_topics request.
Link to this function

fetch(Pid, Topic, Partition, Offset, WaitTime, MinBytes, MaxBytes, IsolationLevel)

View Source
Make a fetch request, If the first arg is a connection pid, call brod_kafka_apis:pick_version/2 to resolve version.
Link to this function

join_group(Conn, Fields)

View Source
-spec join_group(conn(), kpro:struct()) -> kpro:req().
Make a join_group request.
-spec list_groups(conn()) -> kpro:req().
Make a list_groups request.
Link to this function

list_offsets(Connection, Topic, Partition, TimeOrSemanticOffset)

View Source
-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.
Link to this function

metadata(Connection, Topics)

View Source
-spec metadata(vsn() | conn(), all | [topic()]) -> kpro:req().
Make a metadata request.
Link to this function

offset_commit(Conn, Fields)

View Source
-spec offset_commit(conn(), kpro:struct()) -> kpro:req().
Make a offset_commit request.
Link to this function

offset_fetch(Connection, GroupId, Topics)

View Source
-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
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().
Make a produce request, If the first arg is a connection pid, call brod_kafka_apis:pick_version/2 to resolve version.
Link to this function

sync_group(Conn, Fields)

View Source
-spec sync_group(conn(), kpro:struct()) -> kpro:req().
Make a sync_group request.