produce_message
Publish up to 20 new messages with keys, values and headers to existing Kafka topics, encoding to registry schemas when needed. Set confirm to true to write.
Instructions
Write 1 to 20 new messages in one call through items, to existing topics on this or another configured cluster. The caller supplies the key, value and headers, so unlike copy_message this can write content no producer ever sent. Writing one message is an items array of length one.
Every message carries provenance headers naming this tool, the time and the principal, so a fabricated message stays distinguishable from a genuine one.
Nothing is written unless confirm is true; one confirm covers the whole batch, and writing is not atomic because Kafka cannot retract a record produced before a later item failed. Results follow items order, each carrying index with result or error.
A produced message cannot be deleted: it stays until retention removes it, and any consumer reading the topic will process it. The destination must be writable and requires Kafka write permission; the endpoint you call may itself be read-only.
Omit partition unless the exact partition matters. The key decides placement, and naming a partition puts a keyed message where its key does not hash to, which breaks ordering for that key.
A topic whose consumers read Avro, Protobuf or JSON Schema needs value_schema: give the value as JSON and it is encoded to the destination registry's schema, refused with the offending field when it does not fit. A topic with a format configured in topic_formats is encoded to it without being asked. Check get_message or sample_messages first: a schema_id on the existing messages means the topic needs value_schema, and writing plain JSON there breaks its consumers.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| items | Yes | The messages to write, 1 to 20 of them. Writing one message is an array of length one. Two identical items mean two messages, which is allowed: appending the same payload twice is a real request. | |
| confirm | No | Optional. When false or omitted, nothing is written and the response shows the messages that would be produced. Must be true to actually write them. One confirm covers the whole batch. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| atomic | Yes | ||
| failed | Yes | ||
| applied | Yes | ||
| results | Yes | ||
| succeeded | Yes |