Skip to main content

Read messages

Read new messages from one or more topics as a consumer group, so the next read carries on where this one stopped. Needs a REST Proxy that supports consumer instances (self-managed Confluent REST Proxy).

Command in the Kafka toolkit · id ooa.kafka/read_messages · 12 inputs (2 required), 4 outputs

Inputs​

InputTypeRequiredDefaultWhat it is
Endpoint addressStringNoKafka REST Proxy address, e.g. https://pkc-12345.us-east-1.aws.confluent.cloud:443 or http://kafka-rest.internal:8082.
TopicsListYesTopics to read, e.g. ["orders"].
Consumer groupStringYesReader group name. Agents with the same group share the work and never get the same message twice.
Maximum messagesNumberNo100Stop once this many messages have arrived. The last batch is kept whole, so a few more can come back.
Wait (seconds)NumberNo10Stop when no new message arrives within this time.
Value formatStringNojsonRead values as JSON or as plain text.
Start fromStringNoearliestFor a new group only: start at the oldest message kept (earliest) or only new messages (latest).
Mark as readBooleanNotrueRemember what was read so the group does not read it again.
API keyStringNoAPI key or user name, used with api_secret.
API secretCredentialNoAPI secret or password from the vault.
Access tokenCredentialNoBearer token from the vault, used instead of an API key and secret.
CSV fileFileNoAlso save the messages read to this CSV file (topic, partition, offset, key, value), replacing it; no file when empty (G6).

Outputs​

OutputTypeWhat it is
tableTableColumns: topic, partition, offset, key, value. JSON values are shown as text.
messagesListEach message as a dictionary; JSON values stay structured.
countNumberNumber of messages read.
csv_fileFileThe CSV file written; empty when csv_file was not given (G6).