Kafka basics#

This guide shows you how create a kafka topic

Create a new kafka topic#

To create a new Kafka topic you need to follow these steps:

  • Go to the repo https://github.com/TinkaTech/docker-kafka-topics and clone it

  • Create a new branch from the master

  • Create a file for the new topic configuration in the topics directory; use the same name as the topic name

  • Open the PR and get the approvals (example: here

  • Merge the PR

  • Run the parameterized-seed job from CI -> here. For the parameter, use the name of the repo which is docker-kafka-topics (make sure that you don’t have any extra white spaces)

  • To finally create the topic you have to run the next jobs (for the parameter use the name of the new topic that you want to create):

How to easy send a message to a topic in dev#

To send a message to a kafka topic in dev you can use the blaze-kafka-rest-service. Example:

curl --location --request POST 'https://blaze-kafka-rest-service.trusted.nl.lacent.dev.tinka.host/topics/topic-name' \
--header 'Accept: application/vnd.kafka.v2+json' \
--header 'Content-Type: application/vnd.kafka.json.v2+json' \
--data-raw '{
    "records": [
        {
            "key": "key_for_message",
            "value": {
                "field_1": "1237923202",
                "field_2": "1237923202"
            }
        }
    ]
}'