Convert Data to AVRO format: Enable this setting to serialize your data using Avro and send it to the specified Kafka topic.
Schema ID: Enter the schema ID for the schema list.
Schema: Enter the schema corresponding to the above-mentioned ID.
Enable multiple topic support for event types and event names: Enable this setting to deliver your events to multiple Kafka topics.
Map event type to topic: You can use this setting to send a particular event type (identify, group, page, screen, alias) to a specific Kafka topic.
Map Track events to topic: You can use this setting to map a particular track event to a specific Kafka topic.
If this setting is disabled, RudderStack sends all events to the Kafka topic specified in the Topic Name setting. Also, if you configure only a few event types or specific track events with the above setting, RudderStack sends the rest of the events to the topic defined in the Topic Name setting.
Sending events to Kafka topics
You can send your events to a specific Kafka topic by configuring the Topic Name dashboard setting.
Alternatively, you can send your events to a Kafka topic by specifying the topic name in the integrations object:
The mappings specified in the integrations object take precedence over the dashboard settings.
RudderStack also supports sending events to multiple Kafka topics. To do so, enable the Enable multiple topic support for event types and event names dashboard setting and configure the mappings:
Serializing data using Avro
RudderStack lets you serialize your data using Avro and send it to a specific Kafka topic by leveraging the goavro package.
To use this feature, you need to pass the schemaId in your event’s integrations object, as shown in the below event payload:
RudderStack uses the userId in the event as the partition key of the message.
If userId is not present in payload, then RudderStack uses anonymousId instead.
So, if you have a multi-partitioned topic, then the records of the same userId (or anonymousId in absence of userId) will always go to the same partition.
FAQ
Does my Kafka server require client authentication?
If you have enabled 2-way SSL, that is, your server requires client authentication, then you need to have the CA certificate and put that in the truststore of your server.
How can I enable the 2-way SSL in Kafka and connect to RudderStack?
Follow the below steps to make use of Java’s keytool utility to enable two-way SSL in Kafka and connect to RudderStack:
Generate a CA that is a public-private key pair and a certificate by running the command below. Enter the contents of this certificate in the RudderStack dashboard under the CA certificate setting.
Step 6: Add the RudderStack CA certificate to your truststore
Add the above RudderStack CA certificate to your truststore by using the certificate’s location in the following command:
keytool -keystore kafka.server.truststore.jks -alias CARootRudder -import -file ca-cert-rudder
// here ca-cert-rudder is the RudderStack CA certificate
How can I connect to RudderStack if my Kafka server is running in a Kubernetes cluster?
You will need to expose one public address to which RudderStack can connect. It is recommended to use SSL for that.
You should allow only the authenticated clients to this exposed address.
If you use PLAINTEXT for your internal services within your cluster, you might already have the address. Open this address with SSL. You need to update advertised.listeners in your server.properties, as shown in the below example:
# Hostname and port the broker will advertise to producers and consumers.
# here the INTERNAL listener is your cluster kafka service host for kafka server
# and the EXTERNAL listener is the public loadbalancer for kafka server
advertised.listeners=INTERNAL://kafka-0.kafka-headless.kafka-test-1.svc.cluster.local:9092,EXTERNAL://ab7e36e84991c11ea8a930ebf847c1ef-555780507.us-east-1.elb.amazonaws.com:19092
listener.security.protocol.map=INTERNAL:PLAINTEXT,EXTERNAL:SSL
Does RudderStack support SASL_PLAINTEXT authentication?
RudderStack does not support SASL_PLAINTEXT authentication. You can use SASL_SSL instead. The official Kafka documentation recommends using SASL with SSL in production.
Why is the connection between Kafka and Zookeeper is failing for SASL?
You can try configuring your Zookeeper with SASL_SSL to resolve this issue.
This site uses cookies to improve your experience while you navigate through the website. Out of
these
cookies, the cookies that are categorized as necessary are stored on your browser as they are as
essential
for the working of basic functionalities of the website. We also use third-party cookies that
help
us
analyze and understand how you use this website. These cookies will be stored in your browser
only
with
your
consent. You also have the option to opt-out of these cookies. But opting out of some of these
cookies
may
have an effect on your browsing experience.
Necessary
Always Enabled
Necessary cookies are absolutely essential for the website to function properly. This
category only includes cookies that ensures basic functionalities and security
features of the website. These cookies do not store any personal information.
This site uses cookies to improve your experience. If you want to
learn more about cookies and why we use them, visit our cookie
policy. We'll assume you're ok with this, but you can opt-out if you wish Cookie Settings.