Skip to content

Kafka Source

The Kafka source subscribes to one or more Apache Kafka topics using a consumer group, making it easy to build event-driven pipelines that react to messages in real time.

If brokers is not set in the source block, the engine falls back to the root-level kafka configuration. This lets you define broker addresses once and share them across multiple channels.

source:
type: kafka
brokers:
- kafka-1.internal:9093
- kafka-2.internal:9093
- kafka-3.internal:9093
topic: ehr.adt.events
group_id: intuware-adt-consumer
offset: earliest
auth:
mechanism: SASL_SSL
username: ${KAFKA_USER}
password: ${KAFKA_PASSWORD}
tls:
ca_file: ./certs/kafka-ca.crt
PropertyTypeRequiredDefaultDescription
brokersstring[]NoList of Kafka broker addresses. Falls back to the root-level kafka.brokers if omitted.
topicstringYesKafka topic to subscribe to.
group_idstringNoConsumer group ID. When set, Kafka tracks offsets and distributes partitions across group members.
offsetstringNolatestStarting offset when no committed offset exists: earliest or latest.
authobjectNoSASL authentication configuration.
tlsobjectNoTLS settings for encrypted broker connections.

Set auth.mechanism to one of the supported SASL mechanisms:

MechanismDescription
SASL_PLAINPlain username / password (use with TLS).
SCRAM-SHA-256Challenge-response with SHA-256.
SCRAM-SHA-512Challenge-response with SHA-512.
SASL_SSLSASL authentication over a TLS connection.
auth:
mechanism: SCRAM-SHA-512
username: ${KAFKA_USER}
password: ${KAFKA_PASSWORD}

Consume ADT events from Kafka and push them to a FHIR server:

channel.yaml
channel:
name: kafka-adt-to-fhir
description: Stream ADT events from Kafka into the FHIR repository
kafka:
brokers:
- kafka-1.internal:9093
- kafka-2.internal:9093
- kafka-3.internal:9093
source:
type: kafka
topic: ehr.adt.events
group_id: intuware-adt-consumer
offset: earliest
auth:
mechanism: SASL_SSL
username: ${KAFKA_USER}
password: ${KAFKA_PASSWORD}
tls:
ca_file: ./certs/kafka-ca.crt
transformer:
type: typescript
file: ./transforms/adt-to-fhir.ts
destination:
type: http
url: https://fhir.hospital.org/r4/Bundle
method: POST
headers:
Content-Type: application/fhir+json