Skip to content
Learn › Get data in › Connectors: open the docs menu

Import Apache Kafka topic messages into Mammoth

The Apache Kafka connector reads messages from a topic on your Kafka cluster and saves them in Mammoth as a dataset. Open it from Data Library > New dataset > Connectors and search for Apache Kafka. Project Admins create the connection; Project Editors can start datasets from a connection the project already has. Which connectors you can add depends on your plan.

What you can bring in from Kafka

  • Messages from one topic, picked from the topics Mammoth finds on the cluster.
  • Each message's value, plus columns for Kafka Offset, Kafka Partition, Kafka Timestamp and Kafka Topic.

Before you connect Kafka

You need:

  • The cluster's bootstrap servers, reachable from the internet.
  • Its security protocol, and a SASL username and password if it uses SASL.
  • Mammoth's IP address allowed through your firewall for every bootstrap server. The connection form shows the address. See Allow Mammoth through your firewall.

Connect Apache Kafka to Mammoth

  1. Go to the Data Library, click New dataset, and choose Connectors.
  2. Search for Apache Kafka and click its tile. The connector workspace opens with the Chat showing. See Connect a database or app for the shared steps.
  3. Enter the connection details below and connect.
FieldWhat to enter
Bootstrap ServersThe broker addresses, comma-separated, such as broker1:9092,broker2:9092
Security ProtocolDefault PLAINTEXT. Use the protocol your cluster requires (see below)
Username (SASL only)SASL username, if your cluster uses SASL
Password (SASL only)SASL password, if your cluster uses SASL
Display NameOptional label for this connection in Mammoth
Security protocolWhen to use it
PLAINTEXTThe cluster needs no sign-in
SASL_PLAINTEXTUsername and password sign-in without TLS
SASL_SSLUsername and password sign-in over TLS

With either SASL protocol, Mammoth signs in with the SASL PLAIN mechanism.

Choose the Kafka topic, offset and message limit

The Kafka connector's own setup form asks for these settings:

SettingWhat it doesDefault
TopicThe topic to read, picked from the topics Mammoth finds on the cluster
Consumer Group IDThe consumer group Mammoth reads asmammoth-consumer
Offset ResetEarliest (all messages) reads from the start of the topic; Latest (new messages only) reads only new messagesEarliest (all messages)
Max Messages Per RunThe most messages Mammoth reads in one run10000

In the connector workspace, you can tell the chat which topic you want.

Refresh Kafka data and choose an update method

After you save, a Kafka dataset's Update method offers two options:

Update methodWhat it does
Replace all dataRebuilds the dataset from the messages read on every refresh
Add to existing dataAdds the messages read on each refresh to the rows you already have

Kafka refreshes don't use a key column. To read new messages on a schedule, use a Dataset Refresh automation.

Kafka limits

  • One run reads at most the Max Messages Per Run value (default 10000).

Troubleshoot Kafka connections

SymptomLikely causeFix
"Failed to connect to Kafka broker. Please check your connection details."Mammoth can't reach a brokerCheck Mammoth's IP address can reach every bootstrap server, and the addresses are right
"Authentication failed. Please check your username and password."SASL details don't matchCheck Security Protocol and the SASL username and password match the cluster's settings
A message says the topic wasn't found and lists available topicsThe topic name is wrongPick a topic from the list Mammoth shows
Was this page helpful?

Something wrong? support@mammoth.io