Skip to Content
Topic Consumers

Topic Consumers

Use topic consumer mode to read topic records directly from a terminal.

Flags

OptionDescription
--consumeEnable topic consumer mode.
--topic <TOPIC>Topic name (required with --consume).
--group <GROUP_ID>Consumer group (offsets committed when set).
--from <earliest|latest|OFFSET>Start position; supports numeric offset.
--consume-limit <N>Maximum messages before exit.
--consume-timeout <SECONDS>Stop after idle window.

--consume takes precedence over --file and --command.

Examples

BASH
# Read newest events and keep runningkalam --consume --topic blog.summarizer --from latest # Replay from earliest with bounded runkalam --consume --topic blog.summarizer --group summarizer-agent --from earliest --consume-limit 50 --consume-timeout 60

Interactive command

SQL
\consume blog.summarizer --group summarizer-agent --from earliest --limit 25 --timeout 45

SQL alternative

For explicit offset control, use SQL:

SQL
CREATE TOPIC app.new_messages PARTITIONS 4;ALTER TOPIC app.new_messages ADD SOURCE app.messages ON INSERT WITH (payload = 'full');CONSUME FROM app.new_messages GROUP 'worker-1' FROM EARLIEST LIMIT 100;ACK app.new_messages GROUP 'worker-1' UPTO OFFSET 99;

--consume and \consume are convenience shells around topic consumption. Use CONSUME FROM and ACK when scripting.

Last updated on