
Azure Event Hubs is a fully managed event streaming platform for ingesting and processing high volumes of real-time events. It provides partitioned event streams, consumer groups, configurable retention, Event Hubs Capture, and integrations with services such as Azure Functions and Stream Analytics. In the Standard, Premium, and Dedicated tiers, Event Hubs also exposes a Kafka protocol endpoint, so existing Kafka producers and consumers can connect with configuration changes instead of code changes. Apache Kafka is an open source distributed event streaming platform designed for high-throughput, fault-tolerant messaging with persistent storage and event replay. Kafka Connect is a Kafka component for scalably and reliably streaming data between Kafka and external systems through reusable connectors. Strimzi provides Kubernetes operators that deploy and manage Kafka clusters through custom resources defined by Custom Resource Definitions (CRDs). Together, these tools offer a self-hosted alternative to Azure Event Hubs with greater control over infrastructure, destinations, and data transformations.
This article explains how to deploy Apache Kafka with Strimzi on Kubernetes as an alternative to Azure Event Hubs. It covers installing the Strimzi operator, deploying a Kafka cluster in Kafka Raft (KRaft) mode, and configuring Kafka Connect with an S3 sink connector for Object Storage. It also covers stream transformations with Single Message Transforms (SMTs), authentication and encryption, monitoring with Prometheus and Grafana, and migration from Azure Event Hubs.
A self-hosted Kafka and Kafka Connect deployment provides a counterpart for most Azure Event Hubs components, although some mappings are approximate. Azure Event Hubs exposes a Kafka-compatible protocol endpoint alongside Advanced Message Queuing Protocol and HTTPS endpoints, and its core concepts align with Kafka: an event hub corresponds to a Kafka topic, and both platforms use partitions, consumer groups, and offsets.
The Kafka with Strimzi architecture consists of:
KafkaTopic and KafkaUser resources.Before you begin, you need to:
The Strimzi Cluster Operator watches Strimzi custom resources and automatically creates and manages the underlying Kubernetes resources, such as StrimziPodSets, Services, and ConfigMaps. This article uses Strimzi 1.3.1, which serves only the kafka.strimzi.io/v1 API and requires Kubernetes 1.32 or later.
Add the Strimzi Helm repository.
Update the Helm repository cache.
Create a dedicated namespace for Kafka resources.
Install the Strimzi Kafka operator. The --version flag pins the operator and its CRDs to Strimzi 1.3.1, which matches the kafka.strimzi.io/v1 manifests used throughout this article. By default, the operator watches only the namespace it is installed in, which is where every resource in this article runs.
Verify that the operator pod is running.
The output displays a pod named strimzi-cluster-operator-* with status Running.
Verify that the CRDs are installed.
The output lists CRDs including kafkas.kafka.strimzi.io, kafkanodepools.kafka.strimzi.io, kafkatopics.kafka.strimzi.io, kafkaconnects.kafka.strimzi.io, and kafkausers.kafka.strimzi.io.
In KRaft mode, Kafka manages its own metadata quorum and does not depend on ZooKeeper. Strimzi models this with KafkaNodePool resources, each of which defines a group of nodes that act as brokers, controllers, or both. KRaft mode with node pools is the only deployment mode in Strimzi 1.x, so the Kafka resource needs no annotations to enable it.
Create the KafkaNodePool manifest for the controller and broker nodes.
Add the following configuration.
Save and close the file.
In this configuration:
controller pool: Three nodes that participate in the KRaft quorum for metadata management.broker pool: Three nodes that store topic partitions and serve client traffic.roles: Defines whether each node acts as a controller, broker, or both. Use separate controller and broker roles in production, because Kafka does not recommend combined nodes for critical deployments.storage.type: persistent-claim: Uses persistent volume claims to keep data across pod restarts. The sizes above (40 GB for controllers, 50 GB for brokers) meet common block storage minimum volume sizes. Increase the broker volumes to match your topic retention and partition footprint.resources: Sets CPU and memory per node. In the v1 API, node resources belong in the KafkaNodePool resource rather than in the Kafka resource.Apply the KafkaNodePool manifest.
Create the Kafka cluster manifest.
Add the following configuration.
Save and close the file.
In this configuration:
version: 4.3.2: Runs Apache Kafka 4.3.2, the default Kafka version in Strimzi 1.3.1. When metadataVersion is omitted, Strimzi uses the default KRaft metadata version for the configured Kafka version.listeners: Defines the ports and protocols that clients use to connect to the brokers. This configuration creates a plaintext listener on port 9092 and a Transport Layer Security (TLS) encrypted listener on port 9093. Both are internal listeners, which are reachable only from inside the Kubernetes cluster, and neither authenticates clients. The Set Up Authentication and Encryption section replaces both with an authenticated listener.min.insync.replicas: 2: Requires at least two in-sync replicas, including the partition leader, to acknowledge a write when the producer uses acks=all. If fewer replicas are in sync, the brokers reject those writes.entityOperator: Deploys the Entity Operator, which runs the Topic Operator and User Operator that manage KafkaTopic and KafkaUser resources.Apply the Kafka cluster manifest.
Monitor the cluster deployment progress.
Wait until the READY column shows True. This can take several minutes while Strimzi provisions the StrimziPodSets and waits for all pods to become ready. Press Ctrl + C to stop watching.
Verify that all Kafka pods are running.
The output displays three controller pods, three broker pods, and entity operator pods, all with status Running.
Kafka organizes and durably stores messages in topics. Each topic is split into partitions, which Kafka distributes and replicates across the brokers. Sink connectors consume from these topics, so create the topics before you configure the connectors.
Create the KafkaTopic manifest for the main data ingestion topic.
Add the following configuration.
Save and close the file.
In this configuration:
partitions: 12: Creates 12 partitions for parallel processing. Choose a partition count based on expected throughput and consumer parallelism.replicas: 3: Sets the replication factor to 3, so each partition has a leader replica and two follower replicas spread across all three brokers for fault tolerance.retention.ms: 604800000: Retains messages for 7 days (604800000 milliseconds).cleanup.policy: delete: Discards old log segments after they exceed the retention period, instead of compacting the topic by key.segment.bytes: 1073741824: Sets the maximum log segment file size to 1 GB. Kafka applies retention one segment at a time, so larger segments mean fewer files but less granular retention.Apply the topic manifest.
Create additional topics for different data streams.
Add the following configuration.
Save and close the file.
Apply the additional topics.
Verify that all topics are created.
The output lists the events, logs, and metrics topics with their partition and replica counts.
Kafka Connect provides a framework for running connectors that stream data between Kafka and external systems. Strimzi builds a custom Connect image that includes the S3 sink connector plugin and runs the Connect workers that a KafkaConnect resource defines.
This article uses the Confluent S3 Sink Connector, which is distributed under the Confluent Community License, not an open source license. The license permits self-hosted use but prohibits offering the connector as a competing managed service. If your organization requires an Apache-2.0 licensed connector, use the Aiven S3 Sink Connector (io.aiven.kafka.connect.s3.AivenKafkaConnectS3SinkConnector) instead. It uses different configuration keys, so adapt the connector configuration in this article to its documentation.
Create a Kubernetes Secret that holds your container registry credentials. Strimzi uses this Secret to push the custom Connect image, and the cluster's worker nodes use it to pull the image. Replace REGISTRY_HOSTNAME, REGISTRY_USERNAME, and REGISTRY_PASSWORD with values from your container registry, such as the hostname, username, and API key from the Overview tab. Set REGISTRY_HOSTNAME to the registry host only, such as ams.vultrcr.com, without the https:// scheme and without the registry name path. The registry name belongs in the image path in a later step, not in the server value.
Create the KafkaConnect manifest with the S3 sink connector plugin.
Add the following configuration, replacing REGISTRY_HOSTNAME with your registry hostname and REGISTRY_NAMESPACE with your registry name or project path.
Save and close the file.
In this configuration:
annotations.strimzi.io/use-connector-resources: Enables managing connectors through KafkaConnector resources instead of the Kafka Connect REST API.version: 4.3.2: Runs Kafka Connect from the same Kafka release as the brokers.replicas: 2: Deploys two Connect workers for high availability and load distribution.bootstrapServers: Points to the Kafka cluster's internal bootstrap service.groupId, offsetStorageTopic, configStorageTopic, statusStorageTopic: Set the Connect cluster's group ID and the internal topics that store connector offsets, configurations, and status. The v1 API requires these fields and rejects the equivalent group.id and *.storage.topic keys under config.template.pod.imagePullSecrets: Lets the worker pods pull the built image from the private container registry.build: Builds a custom Connect image with the S3 sink connector plugin and pushes it to the configured container registry. Strimzi 1.3.1 runs the build with Buildah. The sha512sum field makes the build fail if the downloaded archive does not match the published connector version 12.1.16.Apply the KafkaConnect manifest.
Monitor the build and deployment progress.
Wait until the READY column shows True. The initial build may take several minutes. Press Ctrl + C to stop watching.
Verify that the Connect worker pods are running.
The output displays two Connect worker pods with status Running.
Check the available connector plugins. Strimzi records the plugins that the Connect workers load in the status of the KafkaConnect resource.
The output includes io.confluent.connect.s3.S3SinkConnector, confirming that the S3 plugin is installed.
A sink connector reads records from Kafka topics and writes them to an external system. The S3 sink connector writes them to S3-compatible object storage. Storing credentials in a Kubernetes Secret and non-sensitive settings (bucket name, region, endpoint) in a ConfigMap keeps the connector manifests free of environment-specific values.
Create a Kubernetes Secret with object storage credentials. Replace OBJECT_STORAGE_ACCESS_KEY and OBJECT_STORAGE_SECRET_KEY with your S3-compatible access credentials.
Create a Kubernetes ConfigMap with the bucket and endpoint settings. Replace OBJECT_STORAGE_BUCKET, OBJECT_STORAGE_REGION, and OBJECT_STORAGE_ENDPOINT with values from your object storage provider. Set OBJECT_STORAGE_ENDPOINT to the hostname only, without https://.
Open the KafkaConnect manifest to expose the Secret and ConfigMap values as environment variables on the Connect worker pods.
Add the following connectContainer block under the existing spec.template block, at the same indentation as the pod block already present there.
Save and close the file.
The Strimzi operator injects each value as an environment variable into the Connect worker container. Connector configurations reference these variables with the ${strimzienv:VAR_NAME} syntax. Strimzi registers the strimzienv config provider on every Connect worker, backed by the Apache Kafka org.apache.kafka.common.config.provider.EnvVarConfigProvider class.
Apply the updated KafkaConnect configuration.
Wait for the Connect cluster to roll the worker pods.
Create the S3 sink connector manifest. Later sections edit this same file to add transformations and tune batching, so a single connector archives each record once.
Add the following configuration.
Save and close the file.
In this configuration:
tasksMax: 3: Allows the connector to run up to three tasks, which split the topic partitions between them for parallel processing.s3.bucket.name, s3.region, store.url: Resolved at runtime from the S3_BUCKET, S3_REGION, and S3_ENDPOINT environment variables sourced from the s3-config ConfigMap.aws.access.key.id, aws.secret.access.key: Resolved at runtime from the AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY environment variables sourced from the s3-credentials Secret.format.class: Writes records as JSON files. Alternatives include AvroFormat and ParquetFormat.partitioner.class: TimeBasedPartitioner: Organizes files into time-based directories. The connector uses its default Wallclock timestamp extractor, so directories reflect the time the connector processes each record.path.format: Creates directories like year=2026/month=06/day=15/hour=14.flush.size: 1000: Commits a file after it accumulates 1,000 records.rotate.interval.ms: 600000: Commits a file when the timestamps of its records, as reported by the timestamp extractor, span more than 10 minutes, regardless of record count.behavior.on.null.values: ignore: Skips tombstone records, which have a null value and mark a key for deletion.Apply the S3 sink connector.
Verify that the connector is running.
The output shows the s3-sink-events connector with READY status True.
Check the connector status for any errors.
The Status section shows the connector and each of its tasks in the RUNNING state.
Kafka Connect can deliver the same topics to destinations other than Object Storage, replacing the Azure Functions or Logic Apps that commonly forward Event Hubs data to search indexes and databases. Each destination follows the same pattern as the S3 sink: add the connector plugin to spec.build.plugins in kafka-connect.yaml, store credentials in a Secret exposed through spec.template.connectContainer.env, and create a KafkaConnector that references them with ${strimzienv:VAR_NAME}. For search, use the Confluent Elasticsearch Sink Connector or the Apache-2.0 Aiven OpenSearch Sink Connector. For relational databases, use the Confluent JDBC Sink Connector or the Apache-2.0 Aiven JDBC Connector. The Confluent connectors use the same Confluent Community License as the S3 sink.
SMTs apply lightweight, stateless modifications to one record at a time as it passes through a connector, similar to stateless transformations that an Azure Function triggered by Event Hubs performs. This section adds a transformation chain to the existing s3-sink-events connector rather than creating a second connector that would archive the same records again.
Open the S3 sink connector manifest.
Add the following keys to the end of the existing spec.config block, at the same indentation as topics.
Save and close the file.
Kafka Connect applies the transforms in the order listed in transforms:
filterNull: Drops records that match the isNullValue predicate, which uses RecordIsTombstone to identify Kafka tombstone records. It runs first so that the later transforms never receive a null value.addTimestamp: Inserts a record_timestamp field that holds the Kafka record timestamp in milliseconds.addSource: Inserts a static source field set to kafka-connect for downstream lineage.maskSensitive: Replaces the values of the email and ssn fields with [REDACTED] to prevent personally identifiable information from reaching the sink. Records that lack these fields receive them with a null value.These transforms expect each record value to be a JSON object. A record with any other value fails the connector task until you configure error handling in the next section.
Apply the updated connector.
Strimzi updates the running connector in place. The connector writes the records it processes after the update with the new fields.
Tune connector flush intervals and batch sizes to balance latency and throughput, similar to configuring Event Hubs Capture time and size windows. This section tunes the same s3-sink-events connector, extends it to the logs and metrics topics, and routes records that fail to a dead-letter queue, a separate topic that stores records the connector cannot process.
Create the dead-letter queue topic manifest. Creating the topic in advance lets Strimzi manage its replication and retention settings, and the connector does not need permission to create the topic after you enable authorization.
Add the following configuration.
Save and close the file. The retention.ms value keeps failed records for 30 days.
Apply the dead-letter queue topic.
Open the S3 sink connector manifest.
Change spec.tasksMax to 6 and replace the existing topics, flush.size, rotate.interval.ms, and s3.part.size values in spec.config with the following.
Add the following keys to the end of the existing spec.config block.
Save and close the file.
In this configuration:
topics: events,logs,metrics: Archives all three ingestion topics with one connector. Each topic is written under its own directory below kafka-events/.flush.size: 10000: Commits a file after it accumulates 10,000 records.rotate.interval.ms: 900000: Commits a file when the timestamps of its records span more than 15 minutes.rotate.schedule.interval.ms: 3600000: Commits open files every hour of wall-clock time, even when no new records arrive.s3.part.size: 26214400: Uses 25 MB parts for multipart uploads.s3.part.retries, s3.retry.backoff.ms: Retry failed S3 requests up to three times with a 200 ms initial backoff.errors.tolerance: all: Skips records that fail conversion or transformation instead of failing the connector task.errors.deadletterqueue.topic.name: Routes failed records to the dlq-s3-sink topic for later analysis.Apply the updated connector.
Verify that the connector is ready.
The READY column shows True and the Max Tasks column shows 6.
Configure SASL authentication with SCRAM and TLS encryption to secure Kafka communication, replacing the SAS and Microsoft Entra ID-based authentication and authorization in Azure Event Hubs. SCRAM is a SASL mechanism that authenticates clients with a username and password without sending the password in plaintext, and ACLs define which operations each user can perform on topics, consumer groups, and other resources. Enable the Kafka authorizer on the cluster so that Kafka enforces the ACL rules in each KafkaUser, then remove the unauthenticated listeners.
Open the Kafka cluster manifest to add a TLS-protected SASL listener and enable authorization.
Add an authorization block under spec.kafka, at the same indentation as the existing listeners and config keys.
Add the following sasl listener entry to the existing spec.kafka.listeners list, below the tls entry.
Save and close the file.
In this configuration:
authorization.type: simple: Enables Kafka's built-in ACL authorizer. Without this block, the User Operator rejects any KafkaUser that declares ACL rules.sasl listener: Adds a TLS-encrypted listener on port 9094 that authenticates clients with SCRAM-SHA-512 credentials.Apply the updated Kafka cluster configuration.
The output displays kafka.kafka.strimzi.io/kafka-cluster configured.
Wait for the rolling update to finish.
Create the KafkaUser manifest.
Add the following configuration.
Save and close the file.
The connect- prefix ACLs on topics and consumer groups cover the Connect cluster's internal topics, its connect-cluster group, and the consumer group that Kafka Connect creates for each sink connector, named after the connector (for example, connect-s3-sink-events). The operations list is the only form the v1 API accepts.
Apply the KafkaUser.
Verify that the user is ready.
The output shows True under the READY column after the User Operator reconciles the user and generates a connect-user Secret with its credentials.
To connect a client that runs outside the cluster, retrieve the plaintext SCRAM password from the generated Secret with kubectl get secret connect-user -n kafka -o jsonpath='{.data.password}' | base64 -d. In-cluster components such as KafkaConnect read the password directly from the Secret, so you do not need this value elsewhere in this article.
Open the KafkaConnect manifest to switch Connect to SASL authentication.
Change the existing spec.bootstrapServers value from port 9092 to the SASL listener on port 9094.
Add the following tls and authentication blocks under spec, at the same indentation as bootstrapServers.
Save and close the file.
Apply the updated KafkaConnect configuration.
The output displays kafkaconnect.kafka.strimzi.io/kafka-connect configured.
Wait for the worker pods to roll onto the new SASL/TLS configuration.
If the command times out, run kubectl get pods -n kafka -l strimzi.io/cluster=kafka-connect to check whether the worker pods are still restarting before you troubleshoot further.
Open the Kafka cluster manifest to remove the unauthenticated listeners. After you enable simple authorization, clients that connect to the plain or tls listener have no identity, and Kafka rejects their requests because no ACL grants them access. Removing these listeners closes ports that no longer serve any client.
Delete the plain and tls entries from the spec.kafka.listeners list, so that only the sasl entry remains.
Save and close the file.
Apply the updated Kafka cluster configuration.
The output displays kafka.kafka.strimzi.io/kafka-cluster configured.
Wait for the rolling update to finish.
From this point, every client must connect to port 9094 with SCRAM-SHA-512 credentials over TLS. Strimzi's own components, such as the Entity Operator, use a separate internal replication listener and are not affected.
Prometheus, an open source monitoring system, scrapes and stores the Kafka, Kafka Connect, and consumer lag metrics that Strimzi exposes, and Grafana visualizes them, replacing Azure Monitor metrics for Event Hubs. Kafka Exporter adds consumer lag metrics. Consumer lag is the difference between the latest offset in a partition and the last offset that a consumer group committed for that partition.
Download the Strimzi 1.3.1 example metrics file for Kafka. It contains example Strimzi resources and a ConfigMap with the rules that the Prometheus JMX Exporter uses to convert Kafka's Java Management Extensions (JMX) metrics into Prometheus format.
The command saves kafka-metrics.yaml in the current directory.
Download the example metrics file for Kafka Connect. It contains the same kind of ConfigMap with the JMX Exporter rules for Kafka Connect.
The command saves kafka-connect-metrics.yaml in the current directory.
Apply only the ConfigMaps from the downloaded files. The -l app=strimzi selector matches the kafka-metrics and connect-metrics ConfigMaps and skips the example Kafka, KafkaNodePool, and KafkaConnect resources in the same files.
Verify that both ConfigMaps exist.
The output lists both ConfigMaps. Confirm that the command did not create a my-cluster or my-connect-cluster resource by running kubectl get kafka,kafkaconnect -n kafka, which lists only kafka-cluster and kafka-connect.
Open the Kafka cluster manifest to enable the metrics exporter and Kafka Exporter.
Add the following metricsConfig block under spec.kafka, at the same indentation as listeners.
Add the following kafkaExporter block under spec, at the same indentation as entityOperator.
Save and close the file.
In this configuration:
metricsConfig: Runs the Prometheus JMX Exporter in each broker and controller pod with the rules from the kafka-metrics ConfigMap.kafkaExporter: Deploys Kafka Exporter, which reports consumer group offsets and lag for every topic and group that matches topicRegex and groupRegex. Narrow the expressions to reduce metric volume on clusters with many topics.Apply the updated Kafka cluster configuration.
The output displays kafka.kafka.strimzi.io/kafka-cluster configured.
Wait for the rolling update to finish.
The command reports that kafka.kafka.strimzi.io/kafka-cluster met the Ready condition after the brokers and controllers restart with the metrics exporter and the Kafka Exporter pod starts.
Open the KafkaConnect manifest to enable Connect metrics.
Add the following metricsConfig block under spec, at the same indentation as bootstrapServers.
Save and close the file.
Apply the updated KafkaConnect configuration.
The output displays kafkaconnect.kafka.strimzi.io/kafka-connect configured.
Wait for the worker pods to roll.
Strimzi now exposes Prometheus metrics on port 9404 of each broker, controller, Connect worker, and Kafka Exporter pod. The next steps deploy the Prometheus Operator and create a PodMonitor that scrapes those endpoints directly, because the pods expose this port but the Kafka Services do not. The PodMonitor resource depends on the monitoring.coreos.com/v1 CRD that the Prometheus Operator installs.
Add the Prometheus Community Helm repository.
Update the Helm repository cache.
Install the kube-prometheus-stack. Replace GRAFANA_ADMIN_PASSWORD with a strong password for the Grafana admin user.
The podMonitorSelectorNilUsesHelmValues=false setting allows Prometheus to discover PodMonitor resources outside the Helm release, including the Kafka PodMonitor you create in the next steps.
Wait for the Grafana pod to become ready.
The output reports that the Grafana pod met the Ready condition.
Wait for the Prometheus pod to become ready.
If Grafana remains in Error or CrashLoopBackOff, inspect the pod with kubectl describe pod -l app.kubernetes.io/name=grafana -n monitoring and increase memory limits or add a node with more capacity.
Create the PodMonitor manifest that tells Prometheus to scrape Kafka metrics. A PodMonitor is required instead of a ServiceMonitor because Strimzi exposes the tcp-prometheus metrics port directly on the pods. The headless *-kafka-brokers Service it generates does not include that port.
Add the following configuration.
Save and close the file.
The matchExpressions selector matches the broker, controller, and Kafka Exporter pods that belong to the Kafka resource, and the worker pods that belong to the KafkaConnect resource.
Apply the PodMonitor.
Verify that the PodMonitor exists.
The output lists the kafka-resources-metrics PodMonitor.
Port-forward the Prometheus UI to confirm that Prometheus discovered the scrape targets.
Open http://localhost:9090/targets in a web browser and confirm that the kafka-resources-metrics endpoints appear as UP. Press Ctrl + C to stop the port-forward.
Access Grafana using port-forwarding.
Open http://localhost:3000 in a web browser and log in with username admin and the password you set in GRAFANA_ADMIN_PASSWORD.
Navigate to Connections in the left-side menu, select Data sources, and confirm that a Prometheus data source is listed. The kube-prometheus-stack chart provisions it automatically through a Grafana sidecar, but this provisioning can fail silently. If a Prometheus data source already appears, continue to the next step.
If no Prometheus data source is present, click Add new data source and select Prometheus. Set the Prometheus server URL to the in-cluster Prometheus service, then scroll to the bottom and click Save & test. Verify that Grafana reports that the data source is working.
Download the Strimzi 1.3.1 Kafka dashboard definition. The grafana-dashboards folder contains additional dashboards, such as strimzi-kraft.json for the controller quorum.
The command saves strimzi-kafka.json in the current directory.
Download the Kafka Connect dashboard definition.
The command saves strimzi-kafka-connect.json in the current directory.
Download the Kafka Exporter dashboard definition.
The command saves strimzi-kafka-exporter.json in the current directory.
In Grafana, click the + icon in the top-right corner and select Import dashboard. Under Upload dashboard JSON file, drag in or browse to strimzi-kafka.json, or paste its contents into the Import via dashboard JSON model field. Click Load.
In the import screen, set the Prometheus data source selector to the Prometheus data source you verified earlier, then click Import.
The dashboard populates after Prometheus scrapes the kafka-resources-metrics targets.
Repeat the import for strimzi-kafka-connect.json and strimzi-kafka-exporter.json. The Kafka Exporter dashboard shows consumer group lag, including the lag of the connect-s3-sink-events group that the S3 sink connector uses.
Validate the complete deployment by testing end-to-end data flow from a producer through Kafka to the S3 sink. The Kafka cluster now requires SASL/SCRAM authentication over TLS, so the test client uses the connect-user credentials and the cluster CA certificate.
Verify that the connector and all its tasks are running.
The READY column shows True. If any task reports FAILED, inspect the connector and task states with kubectl get kafkaconnector s3-sink-events -n kafka -o jsonpath='{.status.connectorStatus}'.
Create a client pod manifest that mounts the cluster CA certificate and exposes the SCRAM password as an environment variable.
Add the following configuration.
Save and close the file. The quay.io/strimzi/kafka:1.3.1-kafka-4.3.2 image contains the Kafka 4.3.2 command-line tools that match the cluster version.
Apply the client pod manifest.
The output displays pod/kafka-client created.
Wait for the client pod to become ready.
Generate the client properties file inside the pod with the SASL credentials and the cluster truststore path. Use /bin/bash -lc so the pod's PASSWORD environment variable expands inside the container rather than in your local shell.
Produce a batch of 10,500 test messages with the same key so they land on one topic partition and cross the connector's flush.size threshold of 10,000 records. The connector commits a file as soon as it reaches the threshold rather than waiting for a time-based rotation.
Wait about 30 seconds for the connector to commit the batch.
List the objects in the bucket. Replace OBJECT_STORAGE_ACCESS_KEY, OBJECT_STORAGE_SECRET_KEY, OBJECT_STORAGE_REGION, OBJECT_STORAGE_ENDPOINT, and OBJECT_STORAGE_BUCKET with the values from your s3-credentials Secret and s3-config ConfigMap.
This command runs the AWS CLI in a temporary pod, so no local installation is required. The output displays JSON files organized by the time-based partitioning structure, for example kafka-events/events/year=2026/month=06/day=25/hour=17/events+0+0000000000.json.
This command stores the Object Storage secret key in the pod specification while the pod exists, where anyone with read access to pods in the kafka namespace can view it, and in your local shell history. The --rm flag deletes the pod after the command exits. Rotate the key afterward if the cluster is shared, or browse the bucket from your Object Storage provider's web console instead.
Verify the data format by downloading and inspecting one of the listed files. Replace the placeholders as before, and replace the object key with one from the previous listing. This command carries the same credential-exposure risk described in the previous step.
Each line is a JSON record matching the messages produced earlier, with the added record_timestamp and source fields and with email and ssn set to null.
Verify topic delivery by consuming directly from Kafka. Pass --group verify-group so the consumer joins the group authorized in the connect-user ACLs.
The output displays the first 10 messages produced earlier, without the fields that the connector's transforms add.
Delete the client pod after verification completes.
Migrating from Azure Event Hubs to Apache Kafka involves mapping event hubs to Kafka topics, updating producer and consumer applications, replacing Event Hubs Capture with Kafka Connect sink connectors, and replacing Azure Functions-based processing with SMTs or Kafka Streams. Because Event Hubs already exposes a Kafka-compatible protocol endpoint, much of this migration consists of repointing existing Kafka clients at the new cluster rather than rewriting them against a different API. The guidance below assumes you completed Deploy Kafka Cluster, Deploy Kafka Connect, and Set Up Authentication and Encryption earlier in this article.
An Azure Event Hubs namespace groups one or more event hubs behind a single managed endpoint, and each event hub is itself a partitioned stream that Kafka clients can already address as a topic. Kafka splits the archival responsibility that Event Hubs Capture handles automatically into two Strimzi resources: a KafkaTopic that holds the records and a KafkaConnector that delivers them to the destination.
KafkaConnector name for each downstream integration that you replace, such as an archival sink or a database or search sink.KafkaTopic.spec.partitions, and neither platform allows decreasing it. Increasing partitions changes which partition a given key maps to, so size the partition count for your expected long-term throughput and consumer parallelism up front.rotate.schedule.interval.ms or rotate.interval.ms (multiply minutes by 60000) and approximate the size window with flush.size, tuned to your average record size, because the connector's flush.size threshold counts records rather than bytes. Use s3.part.size for multipart upload chunk sizing, not as a direct Capture size equivalent.Because Event Hubs supports Kafka producer and consumer clients at Kafka version 1.0 and later, most producer and consumer changes are limited to connection configuration rather than code:
bootstrap.servers: Change from the namespace's Kafka endpoint (NAMESPACE.servicebus.windows.net:9093) to the Strimzi cluster's bootstrap service on the SASL listener, kafka-cluster-kafka-bootstrap:9094.security.protocol / sasl.mechanism: Kafka clients typically connect to Event Hubs with SASL_SSL and either PLAIN (using $ConnectionString as the username and the namespace connection string as the password) or OAUTHBEARER for Microsoft Entra ID-based authentication. Replace this with SASL_SSL and SCRAM-SHA-512, using credentials from a KafkaUser such as the connect-user created in Set Up Authentication and Encryption. Create a separate KafkaUser with its own ACLs for each application in production.topic value producers and consumers already use for the event hub name carries over unchanged, as long as you create a KafkaTopic with the same name on the new cluster.auto.offset.reset according to the migration strategy. Use earliest if the new topic already contains the historical records that should be reprocessed, or latest if consumers should process only records arriving after the cutover.If you need to migrate historical data from an Event Hubs namespace to the new cluster, use Kafka MirrorMaker 2, which replicates topics between Kafka-compatible clusters, against the Event Hubs Kafka endpoint, the same tool Microsoft recommends for migrating existing Kafka workloads to Event Hubs in the opposite direction.
Event Hubs itself has no built-in transform step. Enrichment and filtering typically happen downstream, either in an Azure Functions Event Hubs trigger, in an Azure Stream Analytics query between the event hub and its destination, or in application code that reads and republishes events.
Kafka Connect offers two mechanisms that cover different transformation requirements:
For more information, see the Kafka Streams documentation. Event Hubs also offers public preview support for the Kafka Streams client library in the Premium and Dedicated tiers, which uses the same programming model described here.
Event Hubs Capture's output settings map to Kafka Connect sink connector configuration keys as follows.
{Namespace}/{EventHub}/{PartitionId}/{Year}/{Month}/{Day}/{Hour}/{Minute}/{Second}). Recreate a similar layout with the connector's topics.dir, partitioner.class, and path.format settings. For more information, see the S3 Sink Connector configuration reference.format.class setting supports JSON, Avro, or Parquet, so choose the format your downstream consumers already expect rather than being constrained to Avro.errors.deadletterqueue.topic.name gives you an explicit topic for records the sink connector cannot process, which you can archive to Object Storage with a separate sink connector if you need failed records on disk.rotate.schedule.interval.ms, rotate.interval.ms, and flush.size as described under Configure Buffering and Batching.For destinations with existing data that needs to be preserved:
path.format alone does not guarantee that existing data catalogs or queries automatically discover the new output.Review the following operational differences before cutting production traffic over to the new deployment.
replicas and connector tasksMax, while the Kafka cluster scales through brokers, partitions, and storage.IncomingBytes, OutgoingBytes, ThrottledRequests, and CaptureBacklog to their corresponding Kafka broker, Kafka Exporter consumer lag, and connector metrics.KafkaUser ACLs. Kubernetes role-based access control (RBAC) separately controls access to Kafka resources through the Kubernetes API.retention.ms and retention.bytes, subject to available cluster storage.You have deployed Apache Kafka with Strimzi on Kubernetes as a self-hosted alternative to Azure Event Hubs. The deployment includes a KRaft-mode Kafka cluster, Kafka Connect with an S3-compatible sink connector that applies SMTs and routes failed records to a dead-letter queue, SASL/SCRAM authentication with TLS encryption, and Prometheus monitoring with consumer lag metrics. For more information, see the official Strimzi documentation and the Kafka Connect documentation.
0 Comments
Be the first to comment and share your perspective with the community.