Area: Ingestion
Sub-Area: Messaging
Applies to: OSS + Cloud
Issue
Kafka ingestion fails validation, finds no topics, or shows no schema information from Schema Registry. The most common cause is a recipe with settings in the wrong place. The Kafka source rejects keys it doesn't define, so a misplaced key stops the recipe before it connects.
You Might Be Asking
- How do I ingest Kafka topics into DataHub?
- Why isn't schema information showing for my topics?
- Where do SASL settings go in a Kafka recipe?
- What permissions does the Kafka user need?
Cause
- Connection settings must sit under
config.connection. This includesbootstrap,schema_registry_url,schema_registry_config,client_timeout_secondsandconsumer_config. Puttingschema_registry_urlorschema_registry_configat the top level ofconfigis wrong. - SASL settings are not separate keys such as
sasl_mechanism,sasl_username,sasl_passwordorsecurity_protocol. They are librdkafka keys insideconnection.consumer_config:security.protocol,sasl.mechanism,sasl.usernameandsasl.password. - Schema Registry has its own API credentials, set in
schema_registry_configasbasic.auth.user.info. They are separate from the Kafka cluster API key. -
topic_patternsdefaults to allow.*and deny^_.*, so topics that start with an underscore are skipped unless you change the pattern.
Solution
- Configure the Kafka source with SASL and Schema Registry. Replace the placeholders with your values.
source:
type: kafka
config:
connection:
bootstrap: "kafka-broker1:9092,kafka-broker2:9092"
consumer_config:
security.protocol: "SASL_SSL"
sasl.mechanism: "PLAIN"
sasl.username: "<kafka-username>"
sasl.password: "<kafka-password>"
schema_registry_url: "https://schema-registry:8081"
schema_registry_config:
basic.auth.user.info: "<sr-user>:<sr-password>"
- For Confluent Cloud, use the cluster API key for SASL and a separate Schema Registry key for
basic.auth.user.info.
source:
type: kafka
config:
connection:
bootstrap: "pkc-xxxxx.us-east-1.aws.confluent.cloud:9092"
consumer_config:
security.protocol: "SASL_SSL"
sasl.mechanism: "PLAIN"
sasl.username: "<cluster-api-key>"
sasl.password: "<cluster-api-secret>"
schema_registry_url: "https://psrc-xxxxx.us-east-1.aws.confluent.cloud"
schema_registry_config:
basic.auth.user.info: "<sr-api-key>:<sr-api-secret>"
See Connecting to Confluent Cloud.
-
Grant the cluster API key this ACL: Topic Name
*, PermissionALLOW, OperationDESCRIBE, Pattern TypeLITERAL. A broker ACL does not give access to Schema Registry. Schema Registry access comes from theschema_registry_configcredentials in step 2. -
Filter topics with
topic_patterns. It sits directly underconfig.
source:
type: kafka
config:
topic_patterns:
allow: ['^prod\..*', '^analytics\..*']
deny: ['.*\.test$', '.*\.tmp$']
- To extract Kafka Connect lineage, run a separate
kafka-connectsource.
source:
type: kafka-connect
config:
connect_uri: "http://kafka-connect:8083"
username: "<connect-user>"
password: "<connect-password>"
If you run ingestion from the DataHub Cloud UI, make these changes in the recipe. No server setting is involved.
Related Documentation
Tags: kafka, schema-registry, topics, messaging, streaming, confluent, avro, kafka-connect, sasl