Topics
Producer

POST /topics/{topicname}

Changed on

Sends one or more records to a given topic, optionally specifying a partition, key, or both.

Request

  • The document declares no server URL.
  • Auth
    none declared

Query parameters

asyncboolean

Ignore metadata as result of the sending operation, not returning them to the client. If not specified it is false, metadata returned.

Request body

Example request

{
  "records": [
    {
      "key": "key1",
      "value": "value1"
    },
    {
      "value": "value2",
      "partition": 1
    },
    {
      "value": "value3"
    }
  ]
}

Response

Records sent successfully.

Example response

{
  "offsets": [
    {
      "partition": 92,
      "offset": 98
    },
    {
      "error_code": 404,
      "message": "Topic my-topic not present in metadata after 60000 ms."
    },
    {
      "partition": 65,
      "offset": 91
    }
  ]
}

Changes

    • breaking

      removed subschema #1 subschema #2 subschema #3 from the // request property oneOf list (media type: application/vnd.kafka.json.v2+json)

    • breaking

      removed subschema #1 subschema #2 subschema #3 from the // request property oneOf list (media type: application/vnd.kafka.binary.v2+json)

    • breaking

      removed subschema #1 subschema #2 subschema #3 from the // request property oneOf list (media type: application/vnd.kafka.text.v2+json)

    • breaking

      removed subschema #1 subschema #2 subschema #3 subschema #4 from the // request property oneOf list (media type: application/vnd.kafka.json.v2+json)

    • breaking

      removed subschema #1 subschema #2 subschema #3 subschema #4 from the // request property oneOf list (media type: application/vnd.kafka.binary.v2+json)

    • breaking

      removed subschema #1 subschema #2 subschema #3 subschema #4 from the // request property oneOf list (media type: application/vnd.kafka.text.v2+json)

    • info

      added subschema #1 subschema #2 subschema #3 to the // request property oneOf list (media type: application/vnd.kafka.json.v2+json)

    • info

      added subschema #1 subschema #2 subschema #3 to the // request property oneOf list (media type: application/vnd.kafka.binary.v2+json)

    • info

      added subschema #1 subschema #2 subschema #3 to the // request property oneOf list (media type: application/vnd.kafka.text.v2+json)

    • info

      added subschema #1 subschema #2 subschema #3 subschema #4 to the // request property oneOf list (media type: application/vnd.kafka.json.v2+json)

    • info

      added subschema #1 subschema #2 subschema #3 subschema #4 to the // request property oneOf list (media type: application/vnd.kafka.binary.v2+json)

    • info

      added subschema #1 subschema #2 subschema #3 subschema #4 to the // request property oneOf list (media type: application/vnd.kafka.text.v2+json)

    • breaking

      the request property // became not nullable (media type: application/vnd.kafka.json.v2+json)

    • breaking

      the request property // became not nullable (media type: application/vnd.kafka.binary.v2+json)

    • breaking

      the request property // became not nullable (media type: application/vnd.kafka.text.v2+json)

    • info

      request property // list-of-types was widened by adding types null to media type application/vnd.kafka.binary.v2+json

    • info

      request property // list-of-types was widened by adding types null to media type application/vnd.kafka.json.v2+json

    • info

      request property // list-of-types was widened by adding types null to media type application/vnd.kafka.text.v2+json

    • info

      added the optional property /// to the response with the status

    • info

      added the optional property to the response with the status

    • info

      added the optional property to the response with the status