brodex v0.0.1 Brodex.MessageSet View Source
Represents a Kafka message set.
Wrapper of :brod.message_set.
Link to this section Summary
Functions
Converts a record/0 into a Brodex.MessageSet.
Link to this section Types
Link to this type
record()
View Sourcerecord() ::
{:kafka_message_set, topic :: Brodex.topic(), partition :: Brodex.partition(),
high_wm_offset :: integer(),
messages :: [Brodex.record()] | {:incomplete_batch, Brodex.int32()}}
Link to this type
t()
View Sourcet() :: %Brodex.MessageSet{
high_wm_offset: integer(),
messages: [Brodex.Message.t()] | {:incomplete_batch, Brodex.int32()},
partition: Brodex.partition(),
topic: Brodex.topic()
}
Link to this section Functions
Converts a record/0 into a Brodex.MessageSet.
Examples
iex> Brodex.MessageSet.from_record(
...> {:kafka_message_set, "my_topic", 0, 33,
...> [
...> {:kafka_message, 31, "", "a", :create, 1_564_023_091_657, []},
...> {:kafka_message, 32, "", "b", :create, 1_564_023_091_894, []}
...> ]}
...> )
%Brodex.MessageSet{
high_wm_offset: 33,
messages: [
%Brodex.Message{
headers: [],
key: "",
offset: 31,
ts: 1_564_023_091_657,
ts_type: :create,
value: "a"
},
%Brodex.Message{
headers: [],
key: "",
offset: 32,
ts: 1_564_023_091_894,
ts_type: :create,
value: "b"
}
],
partition: 0,
topic: "my_topic"
}