Skip to main content
The Kafka source connector pulls messages from Kafka topics and persists the messages to Pulsar topics. For more information about connectors, see Connector Overview. This document introduces how to get started with creating a Kafka source connector and get it up and running.
This connector is available as a built-in connector on StreamNative Cloud.

Quick start

Prerequisites

The prerequisites for connecting an Kafka source connector to external systems include: Apache Kafka: Ensure you have a running Kafka instance. You can follow the official Kafka Quickstart guide to set up a Kafka instance if you don’t have one already.

1. Create a connector

The following command shows how to use pulsarctl to create a builtin connector. If you want to create a non-builtin connector, you need to replace --source-type kafka with --archive /path/to/pulsar-io-kafka.nar. You can find the button to download the nar package at the beginning of the document.
If you are a StreamNative Cloud user, you need set up your environment first.
The --source-config is the minimum necessary configuration for starting this connector, and it is a JSON string. You need to substitute the relevant parameters with your own. If you want to configure more parameters, see Configuration Properties for reference.
You can also choose to use a variety of other tools to create a connector:

2. Send messages to the Kafka topic

You can send the message using the command line:

3. Check the data on Pulsar topic

You can consume the data from the Pulsar topic using the command:
If everything is set up correctly, you should see the message “hello pulsar” in the Pulsar consumer.

Configuration Properties

This table outlines the properties of a Kafka source connector.