Skip to content

Browse messages

GET
/api/v1/clusters/{id}/topics/{topic}/messages
curl --request GET \
--url 'http://localhost:8080/api/v1/clusters/example/topics/example/messages?from=latest&limit=50' \
--cookie brokerium_session=<brokerium_session>

Role: viewer. Keys, values and header values that are not UTF-8 are returned base64-encoded. The limit is split evenly between the partitions read. Pass next or previous of a response as cursor with from=after or from=before to read the following or the preceding page of every partition.

id
required
string
topic
required
string
partition
integer format: int32

One partition; all partitions by default. Ignored with a cursor.

from
string
default: latest
Allowed values: latest earliest offset timestamp after before
cursor
string

Offsets per partition (0:120,1:98) for from=after and from=before.

offset
integer format: int64

Start offset when from=offset.

timestamp
integer format: int64

Start time in Unix milliseconds when from=timestamp.

limit
integer
default: 50 >= 1 <= 500

Messages.

Media typeapplication/json
object
messages
Array<object>
object
partition
integer format: int32
offset
integer format: int64
timestamp
string format: date-time
key
string | null
value
string | null
headers
Array<object>
object
key
required
string
value
required
string
encoding

Omitted for text.

string
Allowed values: utf8 base64
keyEncoding
string
Allowed values: utf8 base64
valueEncoding
string
Allowed values: utf8 base64
next

Cursor of the following page; null when every partition was read to its end.

string | null
previous

Cursor of the preceding page; null at the start of every partition.

string | null

Example

{
"messages": [
{
"headers": [
{
"encoding": "utf8"
}
],
"keyEncoding": "utf8",
"valueEncoding": "utf8"
}
]
}

Apache®, Apache Kafka® and Kafka® are either registered trademarks or trademarks of the Apache Software Foundation in the United States and/or other countries. Brokerium is not affiliated with, endorsed by, or sponsored by the Apache Software Foundation.