Help › Explore a database

Produce a message to a Kafka topic

Write a message to a Kafka topic with a key, a value and headers, choose its partition or let the key choose it, and see where it was written.

Querlyn 0.1.0 is not released yet. This help describes it ahead of release.

To write a message to a topic, open Produce to … from the topic: choose Produce… in its topic tab, right-click the topic in the sidebar, or use Query › Produce Message….

Write the message

FieldWhat to write
PartitionAutomatic (by key), or one partition.
KeyThe message's key, as text. Empty sends no key.
ValueThe message's value, as text. When it starts with { or [, the dialog says whether it is valid JSON; it is sent as written either way.
HeadersOne header per line, written name: value.

Two headers, for example:

trace-id: 4bf92f3577b34da6
source: querlyn

Choose Produce. The dialog says where the message went, such as "Written to partition 3 at offset 41,204.", and stays open for the next one; choose Close when you are done. A topic tab on the topic shows the message the next time it reads, or at once while it follows.

Which partition a message goes to

  • With a key, the key chooses the partition the same way Kafka's own Java client does, so a message lands where your applications would put it.
  • Without a key, messages take turns over the partitions.
  • A chosen partition is used as it is.

Every message is written with acks=all: the dialog reports it written only once every replica in sync has it.

When it asks first

On a Production connection, Querlyn asks before each message is written. The question has three answers:

  • Produce writes this message, and the next one asks again.
  • Produce and Don't Ask Again writes this message, and the next messages to this connection are written without the question until Querlyn quits. Where Touch ID confirms Production changes, it confirms this answer too. The Produce dialog then says that it does not ask, with Ask Again beside it to bring the question back. Nothing else stops asking: deleting topics or records, resetting offsets and every other change still ask, and other connections are not affected. The choice is never saved.
  • Cancel writes nothing.

A read-only connection refuses to produce at all. See Manage topics.

What it does not do

  • Send a message without a value (a tombstone, which deletes a key from a compacted topic): an empty Value is sent as an empty value.
  • Encode values for a Schema Registry (Avro, Protobuf or JSON Schema).
  • Write several messages at once, or write in a transaction.

Help for Querlyn 0.1.0. All help topics