# Deploy to AWS EKS Source: https://docs.automq.com/automq-cloud/deploy-automq-on-kubernetes/deploy-to-aws-eks AutoMQ offers full Kafka compatibility and a cloud-native architecture based on AWS EKS, providing an efficient and scalable message queue service. Refer to [Overview▸](/automq-cloud/deploy-automq-on-kubernetes/overview), AutoMQ supports deployment on Kubernetes. This article outlines the installation process for deploying AutoMQ on the AWS EKS platform. > [!NOTE] > > Throughout the product's **full lifecycle**, AutoMQ will maintain deep and continuous integration with Amazon Elastic Kubernetes Service (EKS) and EKS Anywhere (EKS-A). > > To uphold this commitment, we ensure: > > **Continuous version compatibility:** We guarantee that each new version of AutoMQ will be compatible with both current and future versions of EKS and EKS-A. Additionally, we proactively adapt to updates on the AWS platform, offering users a forward-compatible experience. > > **Timely response and resolution:** We have established a clear response mechanism to quickly identify and resolve any configuration, security, and non-security issues reported by customers or AWS. ## Prepare EKS Cluster and Compute Resources If you expect to run the AutoMQ cluster on Kubernetes, you need to prepare an EKS cluster for AutoMQ to use. If you expect to deploy the AutoMQ cluster on EC2, you do not need to prepare an EKS cluster. ### Step 1: Create the Required IAM Roles Before creating the EKS cluster and compute resources, create a dedicated IAM Role. This Role is used for the EKS cluster's own service authorization. 1. Access the IAM console and click Create Role. 2. **Trusted entity type**: Select **AWS Service**. 3. **Service Use case**: Select **EKS-Cluster**. 4. Click Next, enter a custom role name, and create the IAM Role. If you use EKS managed node groups, also follow [Amazon EKS node IAM role](https://docs.aws.amazon.com/eks/latest/userguide/create-node-role.html) to create the node group IAM Role. If you use Karpenter, prepare the node role referenced by the EC2NodeClass. ### Step 2: Create EKS Cluster 1. Log in to the AWS [EKS console](https://console.aws.amazon.com/eks/home), click **Create cluster**, and select the custom creation mode. 2. **Configure basic cluster information**: * Bind the EKS cluster IAM Role created in the previous step. * Select an EKS-supported Kubernetes version that meets the AutoMQ release requirements. 3. **Configure VPC network**: * Select the VPC you have prepared for AutoMQ; this VPC should be consistent with the VPC where the application is located. * Select the private subnets for deploying the cluster. * It is recommended to select the default security group for the VPC. 4. Keep other default configurations and create the EKS cluster. 5. **Authorize console access**. To allow AutoMQ Console to manage the EKS cluster, authorize the IAM Role used by the console. 1. Go to the **Access** menu of the EKS cluster and click **Create Access Entry**. 2. Select the IAM Role used by AutoMQ Console. 3. Set **Type** to **Standard**. 4. Click Next, and on the **Add access policy** page, select the **AmazonEKSClusterAdminPolicy** policy. 5. Select **Cluster** for the **Scope** and click Add. 6. Complete the creation. 6. **Set security group rules to allow access to Pods and the EKS API Server service from outside the EKS cluster.** > [!NOTE] > > AutoMQ Console needs to call the EKS cluster API Server, so ensure that the network where the console runs can access the API Server on port 443. In addition, AutoMQ Brokers expose service ports. If components outside the cluster, including AutoMQ Console and Producer/Consumer applications, need to access AutoMQ, add inbound rules to the EKS cluster security group. > > * **Ports**: `443`, `9090`, `9092`, `9102`, `9122`, `9112`, `8083`. > * **Source**: Set the CIDR ranges or security groups according to where AutoMQ Console and your applications run. ### Step 3: Prepare EKS Compute Capacity Prepare stable capacity for Kubernetes system components and dedicated capacity for AutoMQ workloads. Dedicated AutoMQ capacity can use EKS managed node groups or Karpenter. #### 1. Create a System Node Group 1. Go to the EKS cluster details page, click the **Compute** menu, and **Create node group**. 2. **IAM Role**: Select the node group IAM Role you created in **Step 1**. 3. **Instance Configuration**: Select `t3.medium` or equivalent instances, with a recommended quantity of 2-3. 4. **Subnet**: Select all private subnets required for EKS deployment. 5. Complete the node group creation. #### 2. Prepare Dedicated AutoMQ Capacity Choose one of the following capacity types. **EKS managed node group** 1. Go to the **Compute** menu and **Create node group**. 2. **IAM Role**: Select the node group IAM Role created in **Step 1**. 3. **Custom label**: Add `node-type=automq`. 4. **Taints**: Add key `dedicated`, value `automq`, and effect `NO_SCHEDULE`. 5. **Instance Configuration**: Select an instance type supported by AutoMQ Console. 6. **Subnet**: Select private subnets in the one or three Availability Zones planned for the AutoMQ instance. 7. **Scaling Configuration**: Set a maximum size that can satisfy the planned AutoMQ node count. A starting desired size of 3 nodes is recommended. 8. Complete the node group creation. **Karpenter NodePool** 1. Add the custom label `node-type=automq` and taint `dedicated=automq:NoSchedule` under `spec.template`. 2. Ensure that `spec.template.spec.requirements` permits the instance types and Availability Zones selected in AutoMQ Console. 3. Set CPU and memory limits that can satisfy the planned AutoMQ node count. For Karpenter installation and EC2NodeClass configuration, see the [Karpenter getting started guide](https://karpenter.sh/docs/getting-started/getting-started-with-karpenter/). Managed node groups and Karpenter NodePools use the same [SchedulingSpec](/automq-cloud/deploy-automq-on-kubernetes/overview#schedulingspec). #### 3. Prepare Kafka Connector Capacity (Optional) If you plan to use the managed Kafka Connect service provided by AutoMQ, prepare node resources for Connector. Create a separate node pool by referring to the system node group steps, or scale up the system node group to ensure sufficient compute resources. ### Step 4: Initialize Local Tools and Configure EKS Plugins The newly created EKS cluster needs to have some necessary system plugins installed to work with AutoMQ. #### 1. Initialize Local Tools 1. Install and configure [AWS CLI](https://docs.aws.amazon.com/cli/latest/userguide/getting-started-install.html), [kubectl](https://kubernetes.io/docs/tasks/tools/), and [Helm](https://helm.sh/docs/intro/install/) in your local environment. 2. Execute the following command to generate the KubeConfig configuration file so that `kubectl` can connect to your EKS cluster. ```bash theme={null} # Replace and with your actual values aws eks update-kubeconfig --region --name ``` #### 2. Configure Cluster Autoscaler for managed node groups (optional) Use Cluster Autoscaler when EKS managed node groups need to scale on demand. Skip this step when you use Karpenter, which provisions nodes through its own controllers. 1. Download the AutoScaler configuration file from the [download link](https://download.automq.com/eks-config/cluster-autoscaler-autodiscover.yaml). 2. Modify the configuration file, replacing `` with your EKS cluster name. 3. Execute the installation command: ```bash theme={null} kubectl apply -f cluster-autoscaler-autodiscover.yaml ``` #### 3. Prepare IAM authorization for EKS add-ons The Amazon EBS CSI Driver and AWS Load Balancer Controller need IAM permissions to operate AWS resources. The example commands below use IRSA and `eksctl`, so create an IAM OIDC provider for the EKS cluster first. For details, see the AWS documentation [Create an IAM OIDC provider for your cluster](https://docs.aws.amazon.com/eks/latest/userguide/enable-iam-roles-for-service-accounts.html). This OIDC provider is used by the EKS add-ons in the following steps. AutoMQ workload Pods can use either EKS Pod Identity or IRSA. Prepare that workload IAM Role and ServiceAccount in [Step 5](#step-5-prepare-the-automq-workload-iam-role-and-serviceaccount). #### 4. Configure Amazon EBS CSI Driver The EKS cluster needs this plugin to manage storage volumes. 1. Refer to the official AWS documentation "[Amazon EBS CSI driver](https://docs.aws.amazon.com/eks/latest/userguide/ebs-csi.html)" to create a dedicated IAM Role for the CSI Driver after creating the OIDC Provider above. 2. After completing the IAM Role and Trust Policy configuration, go to the **Add-ons** tab of the EKS cluster console, add the **Amazon EBS CSI Driver**, and select the IAM Role created in the previous step. #### 5. Install AWS Load Balancer Controller This plugin is used to manage Load Balancers and provide an external access entry for AutoMQ to the EKS cluster. To install the Load Balancer Controller, you can refer to the [official documentation](https://kubernetes-sigs.github.io/aws-load-balancer-controller/latest/deploy/installation/#option-b-attach-iam-policies-to-nodes). 1. Execute the following command to generate the IAM Policy. ```bash theme={null} curl -o iam-policy.json https://raw.githubusercontent.com/kubernetes-sigs/aws-load-balancer-controller/v2.10.0/docs/install/iam_policy.json aws iam create-policy --policy-name AWSLoadBalancerControllerIAMPolicy --policy-document file://iam-policy.json ``` 2. Create an IAM Role and attach the Policy created in the previous step to this Role. ```bash theme={null} eksctl create iamserviceaccount \ --cluster= \ --namespace=kube-system \ --name=aws-load-balancer-controller \ --attach-policy-arn=arn:aws:iam:::policy/AWSLoadBalancerControllerIAMPolicy \ --override-existing-serviceaccounts \ --region \ --approve ``` 3. Add the Helm repository and install the CRD: ```bash theme={null} helm repo add eks https://aws.github.io/eks-charts kubectl apply -k "github.com/aws/eks-charts/stable/aws-load-balancer-controller/crds?ref=master" ``` 4. Execute the installation command, paying attention to replace `` with your cluster name, `` with your region ID, and `` with your VPC ID: ```bash theme={null} helm upgrade -i aws-load-balancer-controller eks/aws-load-balancer-controller -n kube-system --set clusterName= --set region= --set vpcId= ``` ### Step 5: Prepare the AutoMQ Workload IAM Role and ServiceAccount AutoMQ data plane Pods need AWS permissions to access cloud resources such as S3. Before you create an AutoMQ instance, prepare an IAM Role and a Kubernetes ServiceAccount for the AutoMQ workload. You can bind the ServiceAccount to the IAM Role in either of these ways: | Method | When to use it | Trust policy difference | ServiceAccount binding | | - | - | - | - | | EKS Pod Identity | Recommended for new EKS clusters when you want EKS to manage the association between the role and the ServiceAccount. | The role trusts the AWS service principal `pods.eks.amazonaws.com` and allows `sts:AssumeRole` and `sts:TagSession`. | Create an EKS Pod Identity association between the cluster, namespace, ServiceAccount, and IAM Role. | | IRSA | Use this when your cluster already uses IAM roles for service accounts, when you need compatibility with existing IRSA automation, or when Pod Identity is not supported for your workload type. | The role trusts the cluster OIDC provider as a federated principal and allows `sts:AssumeRoleWithWebIdentity`. | Annotate the Kubernetes ServiceAccount with `eks.amazonaws.com/role-arn=`. | > [!TIP] > > The IAM permission policy attached to the role can be the same for both methods. The main difference is the IAM Role trust policy and how the ServiceAccount is associated with the role. See [Appendix: Configure EKS Pod Identity for AutoMQ workloads](#appendix-configure-eks-pod-identity-for-automq-workloads) and [Appendix: Configure IRSA for AutoMQ workloads](#appendix-configure-irsa-for-automq-workloads) for the detailed setup. ## Install the Environment Console After preparing the EKS cluster and compute resources, choose either [Deploy AutoMQ Console on EC2▸](/automq-cloud/getting-started/install-byoc-environment/aws/install-automq-on-aws#deploy-automq-console-on-ec2) or [Deploy AutoMQ Console on EKS▸](/automq-cloud/getting-started/install-byoc-environment/aws/install-automq-on-aws#deploy-automq-console-on-eks) based on your operational requirements. The console deployment mode does not restrict running the AutoMQ data plane on EKS. ## Create an AutoMQ instance on Kubernetes ### Step 1: Create the instance in the console Sign in to AutoMQ Console, create an instance, and configure these fields: 1. **Deployment type**: Select **Kubernetes**. 2. **VPC and Availability Zones**: Select the VPC used by EKS and either one or three workload Availability Zones. 3. **Kubernetes cluster**: Select the EKS cluster. 4. **Load balancer subnets**: Select NLB subnets that cover the workload Availability Zones. 5. **Instance type**: Select a type permitted by the managed node group or Karpenter NodePool. 6. **Scheduling YAML**: If the dedicated compute pool has labels or taints, enter the corresponding [SchedulingSpec](/automq-cloud/deploy-automq-on-kubernetes/overview#schedulingspec). 7. Preview the configuration and create the instance. AutoMQ adds the selected instance type and Availability Zones to the effective Kubernetes scheduling conditions. Don't repeat those two conditions in the Scheduling YAML. ### Step 2: Check and configure Placeholders After creating the instance, use the [Placeholder check script](https://www.automq.com/downloads/check-placeholder.py) to prepare Placeholders for failure recovery. For production, complete this step before sending application traffic to the instance. You need Python 3.9+ and `kubectl`. Your identity needs read access to Controller StatefulSets and Deployments across all namespaces and cluster-scoped PriorityClasses, permission to create or update the Namespaces, PriorityClasses, and Deployments in the generated file, and read access to Pods in `automq-placeholders`. Run the commands step by step, following the comments: ```bash theme={null} # 1. Confirm that the current kubeconfig points to the cluster hosting the instance kubectl config current-context # 2. Install the dependency and download the script python3 -m pip install pyyaml curl -fL https://www.automq.com/downloads/check-placeholder.py \ -o check-placeholder.py # 3. Enter the instance ID from the AutoMQ console and check Placeholder Deployments INSTANCE_ID="" python3 check-placeholder.py --instance-id "$INSTANCE_ID" # If the output file exists, choose a new filename with --output # 4. If this check generated YAML, review it, then run the kubectl apply command printed by the script # If every zone shows EXISTS, continue to step 5. For ERROR, resolve the error and retry # kubectl apply -f placeholder.yaml # 5. Check Pod status; wait for Running and all containers ready in the READY column kubectl get pods -n automq-placeholders \ -l app=low-priority-placeholder -o wide # More options (context, output filename, image, and others) # python3 check-placeholder.py --help ``` In the same Kubernetes cluster, the script reuses Placeholders per Availability Zone. Instances can share an existing Deployment when their configuration for that zone matches, including node matching conditions, instance type, tolerations, and Controller requests, even if they use different additional zones. ## Appendix: Configure EKS Pod Identity for AutoMQ workloads For the complete AWS procedure, see [Learn how EKS Pod Identity grants pods access to AWS services](https://docs.aws.amazon.com/eks/latest/userguide/pod-identities.html). Before you start, make sure the EKS Pod Identity Agent is installed in the cluster. You do not need this step if EKS Auto Mode is enabled. The IAM Role must belong to the same AWS account as the EKS cluster for a direct Pod Identity association. Also make sure the AWS principal that creates the association has `iam:PassRole` permission for the IAM Role. 1. Create an IAM Role and attach the IAM permission policy required by AutoMQ. 2. Configure the role trust policy for EKS Pod Identity: ```json theme={null} { "Version": "2012-10-17", "Statement": [ { "Sid": "AllowEksAuthToAssumeRoleForPodIdentity", "Effect": "Allow", "Principal": { "Service": "pods.eks.amazonaws.com" }, "Action": [ "sts:AssumeRole", "sts:TagSession" ], "Condition": { "StringEquals": { "aws:RequestTag/kubernetes-namespace": "", "aws:RequestTag/kubernetes-service-account": "" } } } ] } ``` 3. Create the namespace and ServiceAccount: ```bash theme={null} kubectl create namespace kubectl create serviceaccount -n ``` 4. Create the Pod Identity association: ```bash theme={null} aws eks create-pod-identity-association \ --cluster-name \ --namespace \ --service-account \ --role-arn arn:aws:iam:::role/ \ --region ``` 5. Before creating the AutoMQ instance, confirm that the association is active and the ServiceAccount exists in the target namespace. ## Appendix: Configure IRSA for AutoMQ workloads For the complete AWS procedure, see [IAM roles for service accounts](https://docs.aws.amazon.com/eks/latest/userguide/iam-roles-for-service-accounts.html). 1. Create an IAM OIDC provider for the EKS cluster. You only need to do this once for each cluster. ```bash theme={null} eksctl utils associate-iam-oidc-provider \ --cluster \ --region \ --approve ``` 2. Create an IAM Role and attach the IAM permission policy required by AutoMQ. 3. Configure the role trust policy for IRSA: ```json theme={null} { "Version": "2012-10-17", "Statement": [ { "Effect": "Allow", "Principal": { "Federated": "arn:aws:iam:::oidc-provider/oidc.eks..amazonaws.com/id/" }, "Action": "sts:AssumeRoleWithWebIdentity", "Condition": { "StringEquals": { "oidc.eks..amazonaws.com/id/:aud": "sts.amazonaws.com", "oidc.eks..amazonaws.com/id/:sub": "system:serviceaccount::" } } } ] } ``` 4. Create the namespace and ServiceAccount, and annotate the ServiceAccount with the IAM Role ARN: ```bash theme={null} kubectl create namespace kubectl create serviceaccount -n kubectl annotate serviceaccount \ -n \ eks.amazonaws.com/role-arn=arn:aws:iam:::role/ ``` 5. Before creating the AutoMQ instance, confirm that the annotated ServiceAccount exists in the target namespace. # Deploy to Azure AKS Source: https://docs.automq.com/automq-cloud/deploy-automq-on-kubernetes/deploy-to-azure-aks Prepare AKS, a dedicated node pool, and Azure Workload Identity for an AutoMQ 8.x Instance. As described in [Overview](./overview), AutoMQ supports deployment on Kubernetes. This article describes how to prepare Azure Kubernetes Service (AKS) for AutoMQ 8.x. ## Install the environment console Before you begin, follow [Install AutoMQ on Azure](../getting-started/install-byoc-environment/install-env-on-azure) to install the AutoMQ console with Docker and complete **System Initialization**. To prepare the console, AKS, and example resources with Terraform, see the [AutoMQ Azure Terraform example](https://github.com/AutoMQ/automq-labs/tree/main/byoc-examples/setup/azure/azure-automq-env). ## Prepare the AKS cluster and node pool ### Step 1: Create the AKS cluster Create a Standard AKS cluster. The AutoMQ console must access the AKS Kubernetes API to create and manage an Instance. #### Console UAMI access to AKS The console should access AKS with its own identity instead of a shared static administrator credential. We recommend enabling **Microsoft Entra integration**: * The console authenticates as the Console UAMI with Microsoft Entra tokens. * The console uses a `clusterUser` kubeconfig, so Kubernetes requests carry the console identity. If Microsoft Entra integration is disabled, the console accesses AKS with a static `clusterAdmin` kubeconfig obtained through the Azure API. Grant the Console UAMI `Azure Kubernetes Service Cluster Admin Role` to obtain it. #### Console Kubernetes permissions After authentication is configured, choose where to manage the console's Kubernetes permissions. We recommend managing them centrally in Azure IAM instead of maintaining a separate Kubernetes RBAC configuration. With Microsoft Entra integration enabled, we recommend enabling **Azure RBAC for Kubernetes Authorization**: * Grant the Console UAMI `Azure Kubernetes Service RBAC Cluster Admin` at the target AKS cluster scope. * Grant the AKS access permission generated on the **System Initialization** page. It must include `Microsoft.ContainerService/managedClusters/listClusterUserCredential/action`, which lets the console obtain the `clusterUser` kubeconfig. This permission does not grant Kubernetes management permissions by itself. If Azure RBAC for Kubernetes Authorization is disabled, AKS uses native Kubernetes RBAC. Grant the AKS access permission generated on the **System Initialization** page, then have a cluster administrator create and maintain a Kubernetes `ClusterRoleBinding` for the Console UAMI principal. Use the Azure authorization commands generated on that page. #### Data plane access to Azure resources AutoMQ data plane Pods use Azure Workload Identity to access Azure resources. To use this authentication mechanism, enable both the AKS **OIDC issuer** and **Workload Identity** features. #### Network and egress The console must reach the cluster, and the nodes must pull images and call Azure APIs. AutoMQ service ports must also be reachable: * Use [**Azure CNI Node Subnet**](https://learn.microsoft.com/azure/aks/configure-azure-cni). When creating the AKS cluster, explicitly set `--network-plugin azure` and don't set `--network-plugin-mode overlay`. Make sure the console can access Pod IPs directly from outside the AKS cluster. * Make sure the console can reach the AKS API Server and AutoMQ service ports. * Make sure nodes can reach container registries, Azure APIs, and external services required by AutoMQ. #### Availability zones for production Place nodes across **three Availability Zones** in production to reduce the impact of a zone failure. ### Step 2: Check network access paths Before creating an Instance, check the NSGs, routes, firewalls, and DNS configuration for these paths: * The AutoMQ console can reach the AKS API Server. * The AutoMQ console can reach the AutoMQ data plane Pod or Service ports. * Kafka client networks can reach the AutoMQ service ports required by your applications. * AKS nodes can reach container registries, Azure APIs, and external services required by AutoMQ. Nodes without Public IPs need a NAT Gateway or another egress path. * For a private AKS API Server, the console VM must have connectivity to the AKS VNet and resolve the AKS private DNS name. * For a public AKS API Server with authorized IP ranges enabled, those ranges must include the console egress address. Run the following command to check the AKS network configuration: ```bash theme={null} az aks show \ --resource-group \ --name \ --query '{networkPlugin:networkProfile.networkPlugin,networkPluginMode:networkProfile.networkPluginMode}' \ --output yaml ``` Confirm that `networkPlugin` is `azure` and `networkPluginMode` isn't `overlay`. We recommend at least 512 IP addresses in the AKS Subnet. Common AutoMQ service ports include `8083`, `9090`, `9092`, `9093`, `9102`, `9103`, `9112`, and `9113`. The console Subnet is a required source. Add Kafka client CIDR ranges only when those clients need application access. Use NSGs or equivalent network policies to restrict sources to the required CIDR ranges. Allow node DNS resolution and outbound TCP `443`. ### Step 3: Prepare the dedicated AutoMQ node pool Create a separate User node pool for AutoMQ Brokers and configure: * A VM size and node count based on [Overview](./overview). * Three Availability Zones and Cluster Autoscaler for production. * Taint: `dedicated=automq:NoSchedule`. > [!WARNING] > > The AutoMQ 8.x data plane uses Azure Workload Identity. Do not bind the workload UAMI to the node pool VMSS. Node identity no longer carries AutoMQ data plane permissions. ### Step 4: Prepare the AutoMQ workload identity AutoMQ data plane Pods use Azure Workload Identity to access Blob Storage, Private DNS, and Managed Disks. Select one of these modes when creating an Instance: | Identity mode | When to use | What you prepare | What the AutoMQ console does | | - | - | - | - | | Managed | Recommended for new environments where the console may manage the Instance identity. | Complete console permission initialization. | Creates the workload UAMI, Federated Identity Credential, and required role assignments. | | Customer-Provided | Your organization already has naming, approval, or IAM management workflows. | Create and maintain the UAMI, KSA, Federated Identity Credential, and role assignments shown by the console. | Reads and checks the UAMI, FIC, and KSA configuration. It doesn't create, modify, or delete these resources. | For Customer-Provided mode, enter the workload UAMI full ARM resource ID, not its client ID or principal ID. The KSA `azure.workload.identity/client-id` annotation uses the UAMI client ID. The console checks the identity configuration, but you must still ensure that the identity can access both the Ops Bucket and Data Bucket Blob containers, the Private DNS Zone, and the Managed Disk resources. ## Create an AutoMQ Instance ### Step 1: Create the instance in the console Sign in to the AutoMQ console, create an Instance, select Kubernetes deployment, and configure: | Resource | Input format | | - | - | | AKS, VNet, Private DNS Zone, UAMI | Full ARM ID | | Azure Bucket | `:` | | Node pool | Short name within the selected AKS cluster | | Namespace, KSA | Kubernetes resource name | Do not replace an ARM ID with a display name, Resource Group/name tuple, UAMI client ID, or principal ID. The current scope supports AKS in Azure Public Cloud and resources in the same tenant and Subscription. Resources can be in different Resource Groups. Azure IaaS, cross-subscription resources, cross-tenant resources, and Public DNS lifecycle are not supported. 1. **AKS cluster**: Select the target cluster. APIs and automation use its full ARM ID: `/subscriptions//resourceGroups//providers/Microsoft.ContainerService/managedClusters/`. 2. **Node pool**: Enter the node pool short name within the selected AKS cluster. 3. **Virtual Network**: Enter the selected VNet full ARM ID. Kubernetes deployment does not use a Subnet as a workload placement input. 4. **Data bucket**: Select a Managed resource or enter a Customer-Provided Blob container. An Azure Bucket ID uses `:`. 5. **Private DNS Zone**: Select a Managed resource or enter the full ARM ID of a Customer-Provided Private DNS Zone. A Customer-Provided Zone must already have a resolution-only VNet Link to the selected VNet. 6. **Instance identity**: Select Managed identity or enter the full ARM ID of a Customer-Provided UAMI. 7. **Namespace and ServiceAccount**: For Customer-Provided identity, enter the values represented by the Federated Identity Credential subject. 8. Preview the configuration and complete creation. AKS, VNet, and node pool are always Customer-Provided dependencies. Data bucket, Private DNS Zone, and workload UAMI can be Managed or Customer-Provided. The console does not modify or delete Customer-Provided root resources. It still reads and writes Blob objects and maintains and cleans up Instance-owned DNS records during the Instance lifecycle. ### Step 2: Check and configure Placeholders After creating the instance, use the [Placeholder check script](https://www.automq.com/downloads/check-placeholder.py) to prepare Placeholders for failure recovery. For production, complete this step before sending application traffic to the instance. You need Python 3.9+ and `kubectl`. Your identity needs read access to Controller StatefulSets and Deployments across all namespaces and cluster-scoped PriorityClasses, permission to create or update the Namespaces, PriorityClasses, and Deployments in the generated file, and read access to Pods in `automq-placeholders`. Run the commands step by step, following the comments: ```bash theme={null} # 1. Confirm that the current kubeconfig points to the cluster hosting the instance kubectl config current-context # 2. Install the dependency and download the script python3 -m pip install pyyaml curl -fL https://www.automq.com/downloads/check-placeholder.py \ -o check-placeholder.py # 3. Enter the instance ID from the AutoMQ console and check Placeholder Deployments INSTANCE_ID="" python3 check-placeholder.py --instance-id "$INSTANCE_ID" # If the output file exists, choose a new filename with --output # 4. If this check generated YAML, review it, then run the kubectl apply command printed by the script # If every zone shows EXISTS, continue to step 5. For ERROR, resolve the error and retry # kubectl apply -f placeholder.yaml # 5. Check Pod status; wait for Running and all containers ready in the READY column kubectl get pods -n automq-placeholders \ -l app=low-priority-placeholder -o wide # More options (context, output filename, image, and others) # python3 check-placeholder.py --help ``` In the same Kubernetes cluster, the script reuses Placeholders per Availability Zone. Instances can share an existing Deployment when their configuration for that zone matches, including node matching conditions, instance type, tolerations, and Controller requests, even if they use different additional zones. ## Next steps After Instance creation, confirm that the Instance is healthy, AutoMQ Pods run on the dedicated node pool, Private DNS resolves from the target VNet, and Kafka connectivity works from the expected client network. # Deploy to Google Cloud GKE Source: https://docs.automq.com/automq-cloud/deploy-automq-on-kubernetes/deploy-to-google-cloud-gke AutoMQ offers scalable, cost-efficient Kafka-compatible cloud service. Learn how to deploy AutoMQ clusters on Google Cloud GKE for optimal performance. As described in [Overview▸](/automq-cloud/deploy-automq-on-kubernetes/overview), AutoMQ supports deployment on Kubernetes. This article outlines the installation process for deploying an AutoMQ cluster on the Google Cloud GKE platform. > [!NOTE] > > In this article, references to AutoMQ product service provider, AutoMQ service provider, or AutoMQ specifically refer to AutoMQ HK Limited and its affiliates. ## Install the Environment Console As described in [Overview▸](/automq-cloud/deploy-automq-on-kubernetes/overview), AutoMQ supports deployment on GKE clusters. In the GKE deployment mode, you still need to first install the AutoMQ console, and then use the console interface to manage GKE for deploying the cluster on GKE. On Google Cloud, the 8.x AutoMQ console is installed and started with a Docker image. For console installation instructions, see [Install AutoMQ on Google Cloud▸](/automq-cloud/getting-started/install-byoc-environment/google-cloud/install-automq-on-gcp). After the AutoMQ console installation is complete, use the console address, initial username, and password to log in to the console, and follow the page instructions to complete permission initialization. ## Prepare the GKE Cluster and Required Node Pools If you want to run AutoMQ on Kubernetes, prepare a GKE cluster for AutoMQ. If you only want to deploy AutoMQ in IaaS mode, you do not need to prepare a GKE cluster. ### Step 1: Create a GKE Standard cluster For instructions on creating a GKE Standard cluster, see the Google Cloud documentation [Creating a regional cluster](https://docs.cloud.google.com/kubernetes-engine/docs/how-to/creating-a-regional-cluster). This document does not repeat the full GKE creation procedure. It only lists the key configuration requirements for AutoMQ deployment. AutoMQ currently supports only GKE Standard clusters. GKE Autopilot is not supported. When you create the cluster, confirm the following settings: * **Cluster type**: Select GKE Standard. * **Cluster location**: A Regional cluster is recommended so that AutoMQ instances can span multiple zones. * **Network mode**: Enable VPC-native traffic routing and prepare secondary IP ranges for Pods and Services. * **Dataplane**: Dataplane V2 is recommended. * **Identity model**: Enable [Workload Identity Federation for GKE](https://docs.cloud.google.com/kubernetes-engine/docs/how-to/workload-identity). * **Node metadata**: Do not disable the GKE Metadata Server. AutoMQ Pods depend on it when a Kubernetes ServiceAccount is bound to a Google Service Account (GSA). If you use Shared VPC, use the following project boundary: * **Service project**: Owns the GKE cluster, Console VM, AutoMQ instances, data buckets, and instance GSAs. * **Host project**: Owns the VPC, subnets, routes, NAT, firewall rules, and other network resources. In Shared VPC mode, the GKE service agent also needs permissions in the host project to use the shared network. See the Google Cloud documentation [Setting up clusters with Shared VPC](https://docs.cloud.google.com/kubernetes-engine/docs/how-to/cluster-shared-vpc). ### Step 2: Configure network and firewall rules The AutoMQ console needs to access the GKE API Server and operate Kubernetes resources during instance creation, upgrades, and scaling. The AutoMQ console also needs to access the service ports exposed by the AutoMQ data plane for lifecycle management, status checks, and operations. Whether Kafka clients need to access these ports depends on your application access pattern. If the AutoMQ console, GKE cluster, and Kafka clients are not in the same subnet or cannot communicate by default, add the required VPC firewall rules. At minimum, confirm the following access paths: * The AutoMQ console can access the GKE API Server. * The AutoMQ console can access the AutoMQ Pod or Service ports. This access path is required. * Kafka client networks can access the AutoMQ service ports required by your applications, such as Kafka bootstrap, broker, or related proxy ports. * If the GKE nodes don't use external IPs and need to access Google APIs such as Cloud Storage, IAM, and Cloud DNS, the node subnet has Private Google Access enabled and the required routes and DNS are configured for Google APIs. Access to external image registries or other non-Google endpoints still requires Cloud NAT or another egress path. Common AutoMQ service ports include: `8083`, `9090`, `9092`, `9093`, `9102`, `9103`, `9112`, and `9113`. The console subnet is a required source. Add Kafka client source CIDR ranges only when those clients need application access. Restrict the source CIDR ranges based on the console subnet and client networks. If the AutoMQ workload node pool uses a dedicated node VM service account, you can restrict the target to that node pool by service account. Otherwise, use network tags or another targeting method to narrow the target scope. The following command shows how to allow common AutoMQ ports from the console source CIDR range and optional client source CIDR ranges, while narrowing the target when a dedicated node VM service account is used. In Shared VPC mode, create firewall rules in the host project. ```bash theme={null} HOST_PROJECT_ID="" VPC_NAME="" AUTOMQ_NODE_SA_EMAIL="" # If you don't need to allow Kafka client CIDR ranges yet, keep only the console subnet CIDR. SOURCE_CIDRS="," gcloud compute firewall-rules create "automq-gke-allow-automq-service" \ --project="${HOST_PROJECT_ID}" \ --network="${VPC_NAME}" \ --direction=INGRESS \ --action=ALLOW \ --source-ranges="${SOURCE_CIDRS}" \ --target-service-accounts="${AUTOMQ_NODE_SA_EMAIL}" \ --rules=tcp:8083,tcp:9090,tcp:9092,tcp:9093,tcp:9102,tcp:9103,tcp:9112,tcp:9113 ``` ### Step 3: Prepare the AutoMQ workload node pool > [!TIP] > > When you create a GKE Standard cluster, it has a node pool that can run GKE system components. Prepare a separate AutoMQ workload node pool, and add the `dedicated=automq:NoSchedule` taint only to the AutoMQ workload node pool. AutoMQ Brokers should run on a dedicated node pool. Prepare this node pool in advance, and select or enter the node pool name during instance creation. When you prepare the AutoMQ workload node pool, confirm the following settings: * **GKE Metadata Server**: Must be enabled. * **Taint**: Set `dedicated=automq:NoSchedule` so that only AutoMQ workloads are scheduled to this node pool. * **Machine type and size**: Select machine types based on the node pool requirements in [Overview▸](/automq-cloud/deploy-automq-on-kubernetes/overview), and set the minimum, desired, and maximum node counts based on workload size. * **Autoscaling**: Cluster Autoscaler with the Balanced policy is recommended. > [!TIP] > > AutoMQ on GKE uses Workload Identity to map a Kubernetes ServiceAccount to a Google Service Account (GSA). Make sure the AutoMQ workload node pool has GKE Metadata Server enabled. The node pool VM Service Account and access scopes affect the node itself, but they no longer carry AutoMQ data plane permissions. ### Step 4: Confirm the AutoMQ workload identity AutoMQ data plane Pods need to access Google Cloud resources such as GCS, Cloud DNS, and Compute. When you create an instance, choose one of the following identity modes: | Identity mode | When to use | What you prepare | What the AutoMQ console does | | - | - | - | - | | Managed identity | Recommended for new environments where the console should create and maintain the instance identity. | Make sure control-plane permission initialization has passed. | Creates the instance GSA and configures the required IAM bindings for GCS, Cloud DNS, Workload Identity, and related resources. | | Existing identity | Use when your organization already has GSA naming, audit, or approval workflows. | Create the GSA in advance and grant the permissions shown in the console. The GSA resource name uses `projects//serviceAccounts/`. | Verifies the GSA is readable and uses it in the instance configuration. | If you use an existing identity, also prepare the Kubernetes namespace and Kubernetes ServiceAccount, and make sure the ServiceAccount can use the GSA through Workload Identity. See [Appendix: Configure GKE Workload Identity for AutoMQ workloads](#appendix-configure-gke-workload-identity-for-automq-workloads). ## Create an AutoMQ Instance and Select Kubernetes Deployment ### Step 1: Create the instance in the console Log in to the AutoMQ console, create an instance, select Kubernetes as the deployment type, and configure the following settings. 1. **Deployment type**: Select Kubernetes. 2. **Kubernetes cluster**: Select the target GKE cluster. If you use an API or automation tool, the GKE cluster ID must be the full resource name: `projects//locations//clusters/`. 3. **Node pool**: Select or enter the node pool name for AutoMQ Brokers. The node pool must meet the node pool requirements in [Overview▸](/automq-cloud/deploy-automq-on-kubernetes/overview). 4. **Data bucket**: Let AutoMQ create a managed bucket, or enter an existing GCS bucket. 5. **Private DNS Zone**: Let AutoMQ create a managed Cloud DNS private managed zone, or enter an existing zone. 6. **Instance identity**: * For managed identity, the AutoMQ console creates the instance GSA and configures the required IAM bindings. * For existing identity, enter the full resource name of the existing GSA and confirm that the permissions shown in the console have been granted. 7. **Namespace and ServiceAccount**: Required only when you manage the Kubernetes identity yourself. The ServiceAccount must be bound to the instance GSA through Workload Identity. 8. Preview the configuration and **complete the creation**. ### Step 2: Check and configure Placeholders After creating the instance, use the [Placeholder check script](https://www.automq.com/downloads/check-placeholder.py) to prepare Placeholders for failure recovery. For production, complete this step before sending application traffic to the instance. You need Python 3.9+ and `kubectl`. Your identity needs read access to Controller StatefulSets and Deployments across all namespaces and cluster-scoped PriorityClasses, permission to create or update the Namespaces, PriorityClasses, and Deployments in the generated file, and read access to Pods in `automq-placeholders`. Run the commands step by step, following the comments: ```bash theme={null} # 1. Confirm that the current kubeconfig points to the cluster hosting the instance kubectl config current-context # 2. Install the dependency and download the script python3 -m pip install pyyaml curl -fL https://www.automq.com/downloads/check-placeholder.py \ -o check-placeholder.py # 3. Enter the instance ID from the AutoMQ console and check Placeholder Deployments INSTANCE_ID="" python3 check-placeholder.py --instance-id "$INSTANCE_ID" # If the output file exists, choose a new filename with --output # 4. If this check generated YAML, review it, then run the kubectl apply command printed by the script # If every zone shows EXISTS, continue to step 5. For ERROR, resolve the error and retry # kubectl apply -f placeholder.yaml # 5. Check Pod status; wait for Running and all containers ready in the READY column kubectl get pods -n automq-placeholders \ -l app=low-priority-placeholder -o wide # More options (context, output filename, image, and others) # python3 check-placeholder.py --help ``` In the same Kubernetes cluster, the script reuses Placeholders per Availability Zone. Instances can share an existing Deployment when their configuration for that zone matches, including node matching conditions, instance type, tolerations, and Controller requests, even if they use different additional zones. ## Appendix: Configure GKE Workload Identity for AutoMQ workloads For complete instructions, see the Google Cloud documentation [Authenticate to Google Cloud APIs from GKE workloads](https://docs.cloud.google.com/kubernetes-engine/docs/how-to/workload-identity). If you use an existing GSA, make sure the Kubernetes ServiceAccount can impersonate the GSA. Example steps: 1. Create the namespace and Kubernetes ServiceAccount. ```bash theme={null} kubectl create namespace kubectl create serviceaccount -n ``` 2. Add a `roles/iam.workloadIdentityUser` binding to the GSA. ```bash theme={null} gcloud iam service-accounts add-iam-policy-binding \ --role roles/iam.workloadIdentityUser \ --member "serviceAccount:.svc.id.goog[/]" ``` 3. Annotate the Kubernetes ServiceAccount with the GSA. ```bash theme={null} kubectl annotate serviceaccount \ -n \ iam.gke.io/gcp-service-account= ``` When you create the AutoMQ instance, enter the namespace, ServiceAccount, and GSA resource name prepared above. # Overview Source: https://docs.automq.com/automq-cloud/deploy-automq-on-kubernetes/overview Requirements, supported platforms, and machine types for deploying AutoMQ BYOC on managed Kubernetes. AutoMQ BYOC (Bring Your Own Cloud) environments support deployment to managed Kubernetes platforms provided by AWS, Google Cloud, Azure, Alibaba Cloud, Huawei Cloud, and Tencent Cloud. This article introduces the basic concepts and constraints of deploying AutoMQ to Kubernetes platforms. > [!NOTE] > > In this article, mentions of AutoMQ product service providers, AutoMQ service providers, and AutoMQ all specifically refer to AutoMQ HK Limited and its subsidiaries. ## Constraints and Limitations When deploying AutoMQ on Kubernetes, users need to follow the constraints and limitations outlined below. Improper user operations may lead to deployment and modification failures of the cluster. ### Constraint 1: Users Must Provide a Dedicated Kubernetes Cluster that Meets the Requirements AutoMQ requires a dedicated Kubernetes cluster that should not be shared with other application systems for the following reasons: * **Network isolation risk in Kubernetes:** AutoMQ is designed for high-throughput data transmission scenarios and demands high network throughput. Network isolation between different Pods within a Kubernetes cluster is not complete. AutoMQ requires an independent Kubernetes cluster to avoid interference with other business systems of the user. * **Operations authorization isolation:** The Kubernetes cluster where AutoMQ resides needs to provide operations authorization (granting AutoMQ service provider access to the cluster). AutoMQ requires an independent Kubernetes cluster to prevent unauthorized access by application systems. > [!TIP] > > Multiple AutoMQ instances can be deployed in one Kubernetes cluster. Share a Kubernetes cluster only among workloads in the same business domain and cloud network. ### Constraint 2: Users Must Provide Dedicated Compute Capacity that Meets the Requirements AutoMQ requires dedicated compute capacity. You can provide it through a managed node pool or an autoscaler such as Karpenter. The compute pool must permit the instance types and Availability Zones selected when you create an AutoMQ instance. > [!TIP] > > AutoMQ requires dedicated compute capacity. Provide a separate stable compute pool for Kubernetes system components. * **Add an exclusive label and taint:** To prevent other workloads from occupying resources on AutoMQ nodes, you can add a custom label such as `node-type=automq` and the taint `dedicated=automq:NoSchedule`. Use the corresponding node affinity and toleration in the [SchedulingSpec](#schedulingspec). * **Compliant Machine Types:** The compute pool must permit the machine types supported by AutoMQ for the selected cloud provider. As of August 2026, the supported machine types are listed below: | **Cloud Provider** | **Allowed Machine Types List** | | - | - | | AWS | `r6in.large`, `r6i.large`, `m7g.xlarge`, `m7g.2xlarge`, `c6g.2xlarge`, `m7g.4xlarge`, `m6g.medium` | | Google Cloud | `n4d-standard-2`, `n4d-highmem-2`, `n4a-highmem-1`, `n4a-standard-2`, `n4d-standard-4` | | Azure | `Standard_D4as_v5`, `Standard_D4s_v4`, `Standard_E2as_v5` | | Alibaba Cloud | `ecs.r7.large`, `ecs.r6.large`, `ecs.u1-c1m8.large`, `ecs.u1-c1m2.2xlarge`, `ecs.g8y.xlarge`, `ecs.r8y.large` | | Huawei Cloud | `c6ne.xlarge.4`, `m7.large.8`, `m7n.large.8` | | Tencent Cloud | `SA5.2XLARGE16`, `SA5.4XLARGE32`, `SA5.LARGE16`, `S6.LARGE16`, `S6.2XLARGE16`, `SA4.2XLARGE16` | * **Workload Identity Authorization Requirements:** AutoMQ clusters need to access services such as object storage and cloud volumes during operation. Grant the required cloud permissions to the cloud identity or role associated with the AutoMQ workload ServiceAccount, and ensure that the authorization is not modified or revoked. * **Zone (Subnet) Requirements:** AutoMQ supports both single-zone and three-zone instances. The managed node pool or Karpenter NodePool must permit the Availability Zones selected for the instance. > [!TIP] > > Example: A user needs to create three AutoMQ instances, namely Instance 1 (Zone A), Instance 2 (Zone B), and Instance 3 (Zones A, B, and C). The compute pool requirements must permit Zone A, Zone B, and Zones A+B+C respectively. ## SchedulingSpec The **Scheduling YAML** field is optional. Use it when AutoMQ pods need to target dedicated Kubernetes nodes or tolerate taints on those nodes. ### Supported fields The YAML supports these root fields: | Field | Supported configuration | | - | - | | `affinity` | `nodeAffinity.requiredDuringSchedulingIgnoredDuringExecution.nodeSelectorTerms[].matchExpressions[]` | | `tolerations` | A list of standard Kubernetes toleration objects | Node affinity has these restrictions: * Configure at most one `nodeSelectorTerm`. * Each term can contain only non-empty `matchExpressions`. * Each expression must use the `In` operator and include a key and at least one value. The following fields aren't supported in the Scheduling YAML: `nodeSelector`, `topologySpreadConstraints`, `matchFields`, pod affinity, and pod anti-affinity. ### Configure dedicated nodes The following example applies to both managed node pools and Karpenter NodePools. Configure the compute pool to add: * Custom label: `node-type=automq` * Taint: `dedicated=automq:NoSchedule` Enter this Scheduling YAML when you create the AutoMQ instance: ```yaml theme={null} affinity: nodeAffinity: requiredDuringSchedulingIgnoredDuringExecution: nodeSelectorTerms: - matchExpressions: - key: node-type operator: In values: - automq tolerations: - key: dedicated operator: Equal value: automq effect: NoSchedule ``` For a Karpenter NodePool, add the label and taint under `spec.template`, and ensure that `spec.template.spec.requirements` permits the instance types and Availability Zones selected in AutoMQ Console. Instead of adding a custom label, you can match a node pool label provided by your cloud provider's managed Kubernetes service or node pool implementation. Label keys vary across cloud providers and implementations. Replace the key and value in `matchExpressions` above with the actual node pool label on the target nodes. ### System-managed scheduling conditions Don't add these keys to `matchExpressions`: * `node.kubernetes.io/instance-type` * `topology.kubernetes.io/zone` AutoMQ derives these conditions from the **Instance type** and **Availability Zone** fields in the creation form. A request containing either key in the Scheduling YAML is rejected. The load balancer subnets are also selected separately in the creation form. Select subnets that cover the workload Availability Zones; don't place subnet IDs in the Scheduling YAML. ### Troubleshoot pending pods If AutoMQ pods remain pending, check: * The target nodes contain the label used by node affinity. * Every `NoSchedule` taint on the target nodes has a matching toleration. * The managed node pool or Karpenter NodePool permits the selected instance type and Availability Zones. * The compute pool hasn't reached its resource limits and the cloud provider has capacity. Use these commands to inspect the scheduling state: ```bash theme={null} kubectl get nodes \ -L node-type,node.kubernetes.io/instance-type,topology.kubernetes.io/zone kubectl describe pod --namespace ``` For Karpenter, also inspect NodePool and NodeClaim status: ```bash theme={null} kubectl get nodepools,nodeclaims ``` # Client SDK Guide Source: https://docs.automq.com/automq-cloud/getting-started/client-sdk-guide AutoMQ provides full Apache Kafka protocol compatibility for scalable, cloud-native messaging. This guide covers recommended client SDKs for various languages to ensure optimal performance and stability. AutoMQ is fully compatible with the Apache Kafka protocol, allowing you to connect and exchange messages using standard Kafka client SDKs. This guide outlines the recommended clients for various programming languages and highlights important considerations for their use with AutoMQ. ## Compatibility Notes AutoMQ is compatible with the Apache Kafka protocol, supporting clients from Kafka versions 0.10 to 3.9. This compatibility ensures that any standard Kafka client for these versions can connect to AutoMQ without modification. > [!TIP] > > We strongly recommend using the latest stable version of your chosen client SDK to leverage recent performance enhancements, features, and critical bug fixes. ## Recommended Client SDK List The Apache Kafka community maintains a list of client SDKs for various programming languages, which you can find in the [official documentation](https://cwiki.apache.org/confluence/display/KAFKA/Clients). Based on extensive testing and production use, we recommend the following clients for optimal performance and stability with AutoMQ. To help you get started, we provide code samples for each recommended client in our [AutoMQ Labs](https://github.com/AutoMQ/automq-labs) repository. | **Programming Language** | **Client SDK** | **Recommended Version** | Sample | | - | - | - | - | | Java | [Apache Kafka Java Client](https://github.com/apache/kafka) | >= 3.2.0 | [Demo](https://github.com/AutoMQ/automq-labs/tree/main/opensource-examples/clients/java) | | C/C++ | [librdkafka](https://github.com/edenhill/librdkafka) | >= 2.8.0 | [Demo](https://github.com/AutoMQ/automq-labs/tree/main/opensource-examples/clients/cpp) | | Go | [franz-go](https://github.com/twmb/franz-go) | >= 1.17.1 | [Demo](https://github.com/AutoMQ/automq-labs/tree/main/opensource-examples/clients/go) | | Python | [kafka-python](https://pypi.org/project/kafka-python/) | >= 2.2.3 | [Demo](https://github.com/AutoMQ/automq-labs/tree/main/opensource-examples/clients/python) | | NodeJS | [KafkaJS](https://kafka.js.org/) | >= 2.2.4 | [Demo](https://github.com/AutoMQ/automq-labs/tree/main/opensource-examples/clients/javascript) | > [!TIP] > > If the SDK you are using is not among the recommended ones listed above, as long as it is compatible with the Apache Kafka protocol, you can continue to access AutoMQ. We suggest reviewing the known issues list below and adjusting parameters accordingly. ## Client Parameter Tuning When using the SDK to send and receive messages, in addition to selecting the recommended SDK version, you need to tune the key parameters of the Producer to achieve optimal performance. Below are the recommended Producer configurations for each SDK and Kafka Output. ### Apache Kafka Java Client > 2.1 ```properties theme={null} # https://kafka.apache.org/documentation/#producerconfigs # Batch size, up to 1MiB of data can be accumulated at a time. batch.size=1048576 # Batch linger time. If the batch limit is not reached within this time, sending is triggered anyway. This represents the maximum send delay. linger.ms=1000 ``` ### Apache Kafka Java Client \<= 2.1 ```properties theme={null} # https://kafka.apache.org/21/documentation.html#producerconfigs # Maximum retry count retries=2147483647 # Initial backoff delay time retry.backoff.ms=100 # Maximum backoff delay time retry.backoff.max.ms=1000 # RPC timeout for each send request request.timeout.ms=30000 # Total timeout for the entire send call. No further retries after this time; an exception is returned to the caller. delivery.timeout.ms=120000 # Batch size, up to 1MiB of data can be accumulated at a time. batch.size=1048576 # Batch linger time. If the batch limit is not reached within this time, sending is triggered anyway. This represents the maximum send delay. linger.ms=1000 ``` ### franz-go ```go theme={null} package main import ( "time" "github.com/twmb/franz-go/pkg/kgo" ) func main() { client, err := kgo.NewClient( kgo.SeedBrokers("localhost:9092"), // Equivalent to the linger.ms configuration in the Java client, set to 1 second. kgo.ProducerLinger(1*time.Second), ) if err != nil { panic(err) } defer client.Close() } ``` ### kafka-go ```go theme={null} // https://pkg.go.dev/github.com/segmentio/kafka-go#Writer // Configure kafka.Writer fields; values align with Apache Kafka Java producer defaults. writer := &kafka.Writer{ // Maximum number of attempts to deliver a message. // Aligned with the Apache Kafka Java Client retries parameter (Integer.MAX_VALUE). MaxAttempts: 2147483647, // Maximum number of messages to trigger a flush. BatchSize: 4096, // Number of acknowledges from partition replicas required before responding. RequiredAcks: kafka.RequireAll, } ``` ### Sarama ```go theme={null} package main import ( "time" "github.com/IBM/sarama" ) func main() { // https://pkg.go.dev/github.com/IBM/sarama#Config config := sarama.NewConfig() // Byte threshold to trigger a flush. config.Producer.Flush.Bytes = 1048576 // Message count threshold to trigger a flush. config.Producer.Flush.Messages = 4096 // Maximum flush wait time, equivalent to the Kafka Java producer's linger.ms. config.Producer.Flush.Frequency = 1 * time.Second // Maximum retry count (default 3), equivalent to the Kafka Java producer's retries. config.Producer.Retry.Max = 2147483647 // Backoff wait time between retries (default 100ms), equivalent to the Kafka Java producer's retry.backoff.ms. config.Producer.Retry.Backoff = 1 * time.Second // TODO: use config to create a producer, e.g. sarama.NewSyncProducer(brokers, config) _ = config } ``` ### Logstash Kafka Output ```ruby theme={null} # https://www.elastic.co/docs/reference/logstash/plugins/plugins-outputs-kafka output { kafka { # other connection configs ... # Batch size in bytes, up to 1MiB of data can be accumulated at a time. batch_size => 1048576 # Batch linger time in ms. If the batch limit is not reached within this time, sending is triggered anyway. linger_ms => 1000 # The number of acknowledgments the producer requires the leader to have received. acks => "all" # Compression type for all data generated by the producer. compression_type => "lz4" # The amount of time to wait before attempting to retry a failed produce request. retry_backoff_ms => 1000 } } ``` ### Filebeat Kafka Output ```yaml theme={null} # https://www.elastic.co/docs/reference/beats/filebeat/kafka-output # Retry backoff wait time during leader elections. retry.backoff: 3s # Wait time before sending bulk Kafka requests. bulk_flush_frequency: 1s ``` ### Fluentd Kafka Output ```xml theme={null} # https://github.com/fluent/fluent-plugin-kafka @type kafka2 # other connection configs ... # use default configs ``` ### Fluent Bit Kafka Output ```yaml theme={null} # https://docs.fluentbit.io/manual/pipeline/outputs/kafka pipeline: outputs: - name: kafka match: '*' # other connection configs ... # Batch linger time in ms. rdkafka.queue.buffering.max.ms: 1000 # Compression type. rdkafka.compression.type: lz4 ``` ### Vector Kafka Sink ```toml theme={null} # https://vector.dev/docs/reference/configuration/sinks/kafka/ [sinks.my_kafka] type = "kafka" inputs = ["my-source-or-transform-id"] # other connection configs ... # Compression type for all data generated by the producer. compression = "lz4" # Batch linger time is controlled via librdkafka options. [sinks.my_kafka.librdkafka_options] "queue.buffering.max.ms" = "1000" ``` ## Appendix: Other Known Issues ### [Sarama Go SDK](https://github.com/IBM/sarama) | **Known Defects** | **Defect Information** | **Resolution Methods** | | - | - | - | | Async Producer has no memory usage limit during send retries |
  • Defect Version: V1.43.3
  • Community Issue: [https://github.com/IBM/sarama/issues/1358](https://github.com/IBM/sarama/issues/1358)
  • Community PR: [https://github.com/IBM/sarama/pull/3026](https://github.com/IBM/sarama/pull/3026)
  • Phenomenon: When using async\_producer to send messages and the corresponding Topic undergoes partition reassignment, the Producer's memory usage can increase abnormally, potentially leading to OOM.
  • Cause: When async\_producer receives server-side retryable errors (like NOT\_LEADER\_OR\_FOLLOWER due to partition reassignment), it temporarily stores the messages in memory and retries according to the policy. However, this retry cache has no size limit, and if substantial and continuous retries occur, memory usage may unexpectedly increase.
|
  • Upgrade to version >= V1.44.0
| ### [Kafka-Go SDK](https://github.com/segmentio/kafka-go) | **Known Defects** | **Defect Information** | **Resolution Methods** | | - | - | - | | Consumers Unable to Identify Group Coordinator Changes |
  • Defect Version: V0.4.47
  • Issue: After partition reassignment of the \_\_consumer\_offsets topic, some groups experience consumption interruptions, with errors logged.
  • Cause: When the \_\_consumer\_offsets partitions are reassigned, the coordinator for some groups changes. Kafka-go does not correctly handle this situation, as it continues to send requests to the old coordinator following a change, resulting in NOT\_COORDINATOR errors.
|
  • Temporarily restart the Consumer to recover.
  • Switch SDKs, and it is recommended to use the Franz-Go SDK as per the recommended versions in this document.
| ### [Kafka JS SDK](https://github.com/tulios/kafkajs) | **Known Defects** | **Defect Information** | **Resolution Methods** | | - | - | - | | Inaccurate Consumer Configuration of `heartbeatInterval` |
  • Defect Version: V2.2.4
  • Community Notes: [https://github.com/tulios/kafkajs/issues/130#issuecomment-422024849](https://github.com/tulios/kafkajs/issues/130#issuecomment-422024849)
  • Issue: When the Consumer's configured `heartbeatInterval` is too close to `sessionTimeout`, the Consumer may periodically Leave & Rejoin the Group (though it generally does not affect consumption), logging errors.
  • Cause: In kafkajs, the configuration of `heartbeatInterval` only guarantees the "minimum interval between two heartbeats." This means that in certain scenarios (e.g., the Consumer reaches the end of the topic with no new messages to consume), the interval between the Consumer sending heartbeats to the Coordinator may exceed the `heartbeatInterval`; if set too large, it may exceed `sessionTimeout`, causing the Coordinator to evict the Consumer.
|
  • Lower the `heartbeatInterval` or increase the `sessionTimeout` (it is advised that heartbeat.interval.ms should not exceed 1/3 of session.timeout.ms).
| # Experience AutoMQ Source: https://docs.automq.com/automq-cloud/getting-started/experience-automq Create an AutoMQ instance and verify message production and consumption. This guide shows you how to create an AutoMQ instance and verify that it can produce and consume Kafka messages. > [!NOTE] > > In this document, product service provider, service provider, and AutoMQ refer to AutoMQ HK Limited. ## Prerequisites Complete the installation and operations authorization for an AutoMQ BYOC (Bring Your Own Cloud) environment. If the environment is not ready, use the guide for your cloud provider: * [AWS](/automq-cloud/getting-started/install-byoc-environment/aws/install-automq-on-aws) * [Google Cloud](/automq-cloud/getting-started/install-byoc-environment/google-cloud/install-automq-on-gcp) * [Azure](/automq-cloud/getting-started/install-byoc-environment/install-env-on-azure) ## Create an Instance 1. Sign in to the AutoMQ Console for your environment. 2. In the navigation pane, choose **Instances**, and then choose **New Instance**. 3. If prompted, select the Deployment Profile for the instance. 4. Follow the wizard to configure the instance settings, capacity, additional settings, and IAM permissions. The wizard displays only the settings supported by the selected environment and AutoMQ version. 5. Review the configuration and choose **Create Instance**. 6. Wait until the instance status is **Running** before connecting a client. ## Send and receive messages 1. Open the instance details page and choose **Topics**. 2. Choose **Create Topic**, configure the Topic, and submit the request. 3. Open the Topic details page and choose the message production function. 4. Enter a test record and send it. 5. Use the message consumption function or a Kafka consumer to verify that the record can be consumed. ## Next steps Use a supported Kafka client SDK to integrate your application. See the [Client SDK development guide](/automq-cloud/getting-started/client-sdk-guide). > [!TIP] > > Delete test instances and other cloud resources when they are no longer required to avoid additional charges. # Install AutoMQ on AWS Source: https://docs.automq.com/automq-cloud/getting-started/install-byoc-environment/aws/install-automq-on-aws This article describes how to install the AutoMQ console on AWS and complete the initial configuration to prepare for creating and managing AutoMQ clusters. ## Overview To use the AutoMQ Cloud BYOC environment on AWS, you first need to install the AutoMQ console. The console is a web application deployed in your account that you will use to create, manage, and monitor your AutoMQ clusters. ## Prerequisites The AutoMQ Console can be deployed directly to Amazon EC2 or Amazon EKS. Prepare the resources required by the deployment option that you select. | Deployment option | Required resources | Preparation guide | | - | - | - | | Amazon EC2 | A VPC for the AutoMQ Console and AutoMQ instances. Use the VPC that contains your Kafka applications when possible. | [Prepare a VPC](/automq-cloud/getting-started/install-byoc-environment/aws/prepare-vpc) | | Amazon EKS | A VPC and an existing EKS cluster with the required compute, networking, storage, and identity configuration. | [Prepare a VPC](/automq-cloud/getting-started/install-byoc-environment/aws/prepare-vpc) and [Deploy to Amazon EKS](/automq-cloud/deploy-automq-on-kubernetes/deploy-to-aws-eks) | ## Register Your AutoMQ Environment First, you need to register your deployment environment on the AutoMQ official website to obtain the metadata for environment installation. 1. Visit [AutoMQ Cloud](https://account.automq.cloud) and log in to your account. 2. On the console page, click **Create Environment**. 3. Follow the wizard to enter the following information: * **Environment Name**: Set a custom name for your environment. * **Description**: Enter a description for the environment. * **Cloud Provider**: Select **AWS**. * **Region**: Select the AWS region where you plan to deploy AutoMQ. 4. After creation, you will receive the environment metadata for deployment. ## Deploy AutoMQ Console on EC2 ### Prepare and Deploy the Console EC2 Instance The AutoMQ console is the core component for managing the AutoMQ Cloud BYOC environment, and it is deployed on a standalone EC2 instance. Therefore, you need to prepare this EC2 instance before installation. #### Basic Requirements To ensure the stable operation of the console, the EC2 instance you prepare needs to meet the following basic requirements: 1. **Instance Specifications**: * **Configuration**: At least a **2-core CPU** and **8 GB of memory**. * **System Volume**: At least **20 GiB** of storage space. * **Data Volume**: An additional data volume of at least **20 GiB** must be mounted to store metadata. > [!TIP] > > **Important Note**: To prevent metadata loss from the console due to EC2 instance migration or failure, it is crucial to mount an additional data volume to the EC2 instance for the AutoMQ console and store the metadata on this volume. 2. **Network Location**: * The EC2 instance **must** be located in the same VPC as the AutoMQ cluster that will be deployed later. * Typically, this VPC should also be the same as the one where your application services are located to ensure network connectivity. 3. **Public Access**: * The EC2 instance must have internet access to download installation packages and synchronize necessary metadata. You can achieve this by associating an Elastic IP (EIP) or by configuring a NAT gateway. #### Creation and Deployment Steps 1. Log in to the AWS [EC2 console](https://console.aws.amazon.com/ec2/home) and click **Launch instances**. 2. **Operating System (AMI)**: Choose a Linux distribution you are familiar with, such as Amazon Linux 2023 or Ubuntu. 3. **Instance Type**: Select an instance type that meets the above specifications (e.g., `t3.large` or higher). 4. **Network Settings**: * Select the target VPC and a public subnet (if using an EIP) or a private subnet (if using a NAT gateway). * Ensure the security group opens necessary ports, such as SSH (22) for management access and the console's service port (default 8080). Restrict the source to trusted IP ranges. 5. **Storage (Volumes)**: * Configure the root volume size to at least 20 GiB. * Click **Add new volume** to add an additional data volume, ensuring its size is not less than 20 GiB. 6. Complete the remaining configurations and launch the instance. 7. **Mount the Data Volume**: * After the instance starts, log in to it. * Mount the additional data volume to a specified directory (e.g., `/data`). This path will be used as the data mount path when starting the Docker container. * Ensure the mount point has the correct permissions. 8. **Install and Start Docker Service**: * Install Docker on the EC2 instance. The following are reference commands for Amazon Linux 2023: ```bash theme={null} # Update packages sudo dnf update -y # Install Docker sudo dnf install docker -y # Start the Docker service sudo systemctl start docker # Add the current user to the docker group to run docker commands without sudo sudo usermod -aG docker ec2-user # Enable the Docker service to start on boot sudo systemctl enable docker # Verify Docker installation docker version ``` * **Note**: If you are using another Linux distribution (like Amazon Linux 2), refer to the official Docker documentation or use the appropriate package manager for installation. 9. **Deploy the AutoMQ Console** * Once the EC2 instance is ready, you can copy the installation command from the installation wizard to start the AutoMQ console. ### Configure Console Permissions and Complete Initialization After the AutoMQ console starts successfully, you need to log in to the console. On your first visit, you will need to grant it the necessary permissions to operate AWS cloud resources. 1. **Log in to the Console** * Access `http://:8080` in your browser. * Log in with the initial username and password. 2. **Grant IAM Permissions to the Console** After logging in, the interface will guide you to complete IAM authorization for the AutoMQ console. This is to allow the console to have permission to create and manage cluster resources in your AWS account. The process is as follows: 1. **Create an IAM Policy**: * Go to the AWS IAM console and create a new customer-managed policy based on the policy JSON provided in the console interface. 2. **Create an IAM Role**: * Create a new IAM Role. * When selecting the trusted entity, choose **AWS service** and **EC2**. * Attach the IAM Policy created in the previous step to this Role. 3. **Associate the IAM Role with the EC2 Instance**: * Go to the AWS EC2 console and find the EC2 instance you are using to deploy the console. * In **Actions** -> **Security** -> **Modify IAM role**, associate the IAM Role created in the previous step with this instance. 3. **Complete Initialization** * Return to the AutoMQ console page and click **Confirm Authorization** or **Next**. * The console will automatically verify if the permissions are configured correctly. Once verified, you can officially enter the AutoMQ console and start creating your first cluster. ## Deploy AutoMQ Console on EKS This section deploys AutoMQ Console as a Helm release in Amazon EKS. Before you begin, [prepare the EKS cluster and compute resources](/automq-cloud/deploy-automq-on-kubernetes/deploy-to-aws-eks#prepare-eks-cluster-and-compute-resources) and keep the deployment configuration generated by the environment installation wizard available. The following commands and manifests use `<...>` placeholders. Replace them with the corresponding resource identifiers from your environment. ### Prepare the ServiceAccount and runtime configuration Before installing the Chart, ensure that the target namespace and ServiceAccount exist. You can reuse existing resources or prepare them through your own resource management process. The Chart references `` in `` but does not create or modify it. The environment installation wizard provides the same base64-encoded deployment configuration used by the EC2 Docker deployment. Prepare a Secret whose lowercase `config` key contains the complete base64 string generated by the installation wizard. Replace `` with the Secret name, `` with the namespace where the console runs, and `` with the configuration generated by the installation wizard: ```yaml theme={null} apiVersion: v1 kind: Secret metadata: name: namespace: stringData: config: "" ``` Save the manifest to a local file and replace `` with its path: ```bash theme={null} kubectl apply -f ``` ### Configure the workload identity Bind the IAM role to the ServiceAccount with EKS Pod Identity or IRSA. EKS Pod Identity is recommended for new EKS deployments. > [tab] EKS Pod Identity > > 1. Confirm that the EKS Pod Identity Agent is installed. EKS Auto Mode includes the agent. > 2. Prepare or select an IAM role with this trust policy: > > ```json theme={null} > { > "Version": "2012-10-17", > "Statement": [ > { > "Effect": "Allow", > "Principal": { > "Service": "pods.eks.amazonaws.com" > }, > "Action": [ > "sts:AssumeRole", > "sts:TagSession" > ] > } > ] > } > ``` > > 3. Ensure that the role is associated with the ServiceAccount. If it is not already associated, run the following command. `` is the target EKS cluster, `` and `` identify the ServiceAccount used by the console, `` and `` identify the IAM role, and `` is the region of the EKS cluster: > > ```bash theme={null} > aws eks create-pod-identity-association \ > --cluster-name \ > --namespace \ > --service-account \ > --role-arn "arn:aws:iam:::role/" \ > --region > ``` > > For more information, see [Learn how EKS Pod Identity grants pods access to AWS services](https://docs.aws.amazon.com/eks/latest/userguide/pod-identities.html). > [tab] IRSA > > 1. Confirm that the EKS cluster has an IAM OIDC provider. > 2. Prepare or select an IAM role whose trust policy allows `sts:AssumeRoleWithWebIdentity` for this ServiceAccount. > 3. Ensure that the ServiceAccount has the role ARN annotation. If it is not already configured, run the following command. `` and `` identify the ServiceAccount used by the console, while `` and `` identify the IAM role: > > ```bash theme={null} > kubectl annotate serviceaccount \ > --namespace \ > "eks.amazonaws.com/role-arn=arn:aws:iam:::role/" > ``` > > For the required trust policy, see [IAM roles for service accounts](https://docs.aws.amazon.com/eks/latest/userguide/iam-roles-for-service-accounts.html). ### Grant access to the EKS cluster AutoMQ Console uses the same IAM role to manage Kubernetes resources. Ensure that the role has a standard EKS access entry with the cluster-scoped `AmazonEKSClusterAdminPolicy`. If it is not already configured, run the following commands. `` is the target EKS cluster, `` and `` identify the IAM role associated with the ServiceAccount, and `` is the region of the EKS cluster: ```bash theme={null} aws eks create-access-entry \ --cluster-name \ --principal-arn "arn:aws:iam:::role/" \ --type STANDARD \ --region aws eks associate-access-policy \ --cluster-name \ --principal-arn "arn:aws:iam:::role/" \ --policy-arn arn:aws:eks::aws:cluster-access-policy/AmazonEKSClusterAdminPolicy \ --access-scope type=cluster \ --region ``` ### Configure the Helm values Set the following values in your Helm values file: * ``: The runtime configuration Secret prepared above. * ``: The AWS account where the console is deployed. * ``: The VPC that contains the EKS cluster. * `` and ``: Subnets in different Availability Zones where the ALB will be created. * ``: The ServiceAccount already associated with the IAM role. * ``: An existing StorageClass in the target EKS cluster that supports dynamic `ReadWriteOnce` provisioning, typically provided by the Amazon EBS CSI driver. Run `kubectl get storageclass` to list available StorageClasses. * ``: The domain name used to access the console. * ``: The ARN of an ACM certificate that matches the console domain. ```yaml theme={null} automqByocConsole: config: existingSecret: aws: account: "" network: vpcId: subnetIds: - - serviceAccount: name: persistence: storageClass: ingress: enabled: true host: alb: scheme: internet-facing protocol: HTTPS certificateArn: ``` The ALB subnets expose AutoMQ Console and are independent of the NLB subnets selected when you create an AutoMQ instance. To keep the endpoint private, set `ingress.alb.scheme` to `internal` and use private subnets. The Chart does not constrain pod placement by default. If the EKS cluster has dedicated nodes for AutoMQ Console, add their label as a required affinity. Replace `` and `` with a label key and value that already exist on the target nodes: ```yaml theme={null} nodeAffinities: - key: values: - ``` ### Install AutoMQ Console Install the Chart from the AutoMQ OCI registry. The latest recommended stable Chart version is `8.3.7`. Replace `` with the Helm release name, `` with the namespace where the console runs, and `` with the path to the values file prepared above: ```bash theme={null} helm upgrade --install \ oci://automq.azurecr.io/helm/automq-byoc-console-chart \ --version 8.3.7 \ --namespace \ --values \ --wait ``` Wait for the pod and Ingress to become ready. Replace `` with the namespace where the console runs: ```bash theme={null} kubectl get pods,ingress \ --namespace ``` Create the DNS record for the hostname in `ingress.host` and point it to the ALB hostname shown in the Ingress status. ### Complete initialization Open `https://` and sign in with the temporary bootstrap credentials: ```text theme={null} Username: admin Password: admin ``` > [!WARNING] > > These credentials are public bootstrap credentials. Restrict access to the ALB and change the password immediately after the first sign-in. The initialization page displays the IAM policy required by AutoMQ Console. Create a customer-managed policy from that JSON and attach it to the same IAM role associated with the ServiceAccount. Return to AutoMQ Console and confirm the authorization. After the permission check succeeds, you can create and manage AutoMQ instances. ## Next Steps * **Use AutoMQ via WebUI:** Continue to create instances through the environment console and experience the product features. [Experience AutoMQ▸](/automq-cloud/getting-started/experience-automq) * **Use AutoMQ via Terraform:** After installing the console, users can manage and use AutoMQ through the AutoMQ Terraform Provider. For using AutoMQ via Terraform, [refer to the documentation](https://registry.terraform.io/providers/AutoMQ/automq/latest/docs). # Prepare VPC Source: https://docs.automq.com/automq-cloud/getting-started/install-byoc-environment/aws/prepare-vpc Ensure you have the necessary AWS resources, including VPC, EKS, and S3, ready before installing AutoMQ. This article details the steps and considerations for preparing various cloud resources on AWS. All components of the AutoMQ Cloud BYOC environment are deployed within your AWS account to ensure data privacy and security. Before installing AutoMQ, you need to prepare various AWS resources in advance. This article describes how to prepare the necessary cloud resources for AutoMQ on the AWS public cloud. > [!NOTE] > > In this document, "AutoMQ," "AutoMQ service provider," and "the AutoMQ service" all refer to AutoMQ HK Limited and its affiliates. ## Prepare VPC You can choose to use an existing VPC when installing AutoMQ, or create a new one for it. For production environments, we recommend checking and adjusting your existing VPC configuration to meet AutoMQ's requirements. For POC testing, creating a new VPC is a quicker option. ### VPC Requirements To deploy AutoMQ BYOC environment on AWS, your VPC must meet the following conditions: | **Resource** | **Requirement Description** | | :- | :- | | **Control Plane Subnet** | **1**. Used to deploy the AutoMQ BYOC environment console, which needs to connect to the public network via NAT or other methods. | | **Data Plane Subnet** | **1 or 3**. Used to deploy the AutoMQ data plane cluster. The number of subnets depends on whether you choose a single-AZ or three-AZ deployment model. | | **S3 Gateway Endpoint** | **1**. Ensures AutoMQ components access S3 via the AWS internal network, avoiding public network traffic costs. The endpoint's route table must cover all private subnets. | | **EC2 Interface Endpoint** | **1**. Ensures AutoMQ components can call EC2 and Auto Scaling APIs via the AWS internal network. | | **DNS Configuration** | **Enabled**. The VPC must have **DNS hostnames** and **DNS resolution** enabled, as AutoMQ relies on Route 53 for DNS resolution within the VPC. | | **NAT Gateway** | **1**. If you plan to deploy the AutoMQ data plane cluster on EKS, you must configure a NAT gateway and the correct public outbound routes for the private subnets where the EKS worker nodes are located. \[!CAUTION] **Note**: If the NAT gateway is not configured correctly, the AutoMQ cluster installation on EKS will fail. | ### Scenario 1: Create a New VPC If you need to create a new VPC for AutoMQ, we recommend using the **VPC and more** feature in the AWS VPC console. 1. Log in to the [AWS VPC console](https://console.aws.amazon.com/vpc/home). 2. In the left navigation pane, choose **Your VPCs**, then click **Create VPC**. 3. In **VPC settings**, select **VPC and more**. 4. In the **Name tag auto-generation** section, set a clear name for your VPC. 5. Configure the **IPv4 CIDR block**, **Number of Availability Zones**, **Number of public subnets**, and **Number of private subnets**. 6. Depending on your deployment needs, choose whether to create **NAT gateway(s)** and **VPC endpoints**. * **NAT Gateway**: If you plan to deploy on EKS, select at least **1 per AZ**. * **VPC Endpoints**: Select **S3 Gateway**, which will automatically create a gateway-type S3 endpoint. 7. Ensure that both **Enable DNS hostnames** and **Enable DNS resolution** under **DNS options** are checked. 8. Click **Create VPC**. After the VPC is created, you also need to manually create an EC2 interface endpoint for it. 1. In the [AWS VPC console](https://console.aws.amazon.com/vpc/home), choose **Endpoints** from the left navigation pane. 2. Click **Create endpoint**. 3. **Name tag**: Name the endpoint. 4. **Service category**: Select **AWS services**. 5. **Services**: Search for and select the `com.amazonaws..ec2` interface service. 6. **VPC**: Select the VPC you just created. 7. **Subnets**: Select all the private subnets intended for AutoMQ deployment. 8. **Security groups**: Select or create a security group and add an inbound rule to allow HTTPS (443) traffic from your VPC's CIDR. 9. Click **Create endpoint**. ### Scenario 2: Configure an Existing VPC If you are deploying AutoMQ in an existing VPC, verify that the following configurations meet the requirements. #### 1. Check DNS Configuration 1. In the [AWS VPC console](https://console.aws.amazon.com/vpc/home), choose **Your VPCs** from the left navigation pane. 2. Select your target VPC and view the **Details** tab. 3. Confirm that the values for **DNS hostnames** and **DNS resolution** are both **Enabled**. If not, click **Actions** -> **Edit VPC settings** to modify them. #### 2. Check S3 Endpoint 1. In the [AWS VPC console](https://console.aws.amazon.com/vpc/home), choose **Endpoints** from the left navigation pane. 2. Search for and check if there is an S3 endpoint of type **Gateway** (service name `com.amazonaws..s3`) associated with your VPC. 3. If it doesn't exist, click **Create endpoint** to create one. * When creating it, ensure its route table (**Route tables**) is associated with all private subnets that will be used for deploying AutoMQ. #### 3. Check EC2 Endpoint 1. On the **Endpoints** page, continue to search for and check if there is an EC2 endpoint of type **Interface** (service name `com.amazonaws..ec2`) associated with your VPC. 2. If it doesn't exist, click **Create endpoint** to create one. * **Subnets**: Ensure you select all private subnets that will be used for deploying AutoMQ. * **Security groups**: Select or create a security group and add an inbound rule to allow HTTPS (443) traffic from your VPC's CIDR. * **Enable DNS name**: Make sure to check **Enable DNS name** to enable Private DNS resolution, ensuring that AutoMQ components can correctly access the EC2 API via private DNS names. ## Prepare Private DNS (Optional) The AutoMQ cluster exposes service addresses to applications through Private DNS, which relies on private domain name resolution within the VPC. Therefore, a Private DNS must be configured to provide reliable domain name resolution services. You can choose to have the AutoMQ console create the Private DNS Zone automatically or prepare it yourself by following the tutorial below. ### Private DNS Zone Requirements When configuring Private DNS, the following two key conditions must be met: | **Condition** | **Description** | **Importance** | | - | - | - | | **Associated VPC** | The Private DNS must be associated with the VPC where AutoMQ is deployed. | **Required** | | **Domain Name and TLS Consistency** | If you need to use the TLS feature later, the domain name of the Private DNS must be consistent with the domain name in the TLS certificate. | **As needed** | ### Private DNS Configuration Steps #### Step 1: Check Existing Private DNS 1. Log in to the AWS console and visit the [Route53 console](https://console.aws.amazon.com/route53/). 2. In the left navigation bar, select **Hosted zones**. 3. Check if a Private DNS associated with the target VPC already exists. #### Step 2: Create or Configure Private DNS **If a Private DNS already exists:** 1. Select the target Private DNS and click **Details**. 2. Confirm that the **Type** is **Private hosted zone**. 3. Check the **VPCs** section to ensure it includes the VPC where AutoMQ is deployed. 4. Record the domain name information for subsequent TLS feature configuration. **If you need to create a new Private DNS:** 1. Click **Create hosted zone**. 2. Configure the basic information: * **Domain name**: Enter a private domain name (e.g., `internal.example.com`). * **Type**: Select **Private hosted zone**. * **VPC**: Select the VPC where AutoMQ is deployed and the corresponding region. 3. Click **Create hosted zone**. #### Step 3: Verify the Configuration 1. On the Private DNS details page, confirm the VPC association status. 2. Check if the domain name configuration meets the planning requirements for the TLS feature. 3. Record the ID and domain name of the Private DNS, which will be provided to the AutoMQ components during subsequent installation. ## Prepare Cluster Security Group (Optional) During the cluster deployment process, you can opt to use a pre-configured security group for precise network access control. If you choose this method, you must create a security group in advance and configure its inbound rules according to the table below. If you prefer to simplify network configuration, you can choose to have AutoMQ automatically create a new security group with all the necessary rules during cluster creation, in which case you can skip this section. | Port | Purpose | Required Access Source | Enablement Condition | | :- | :- | :- | :- | | 9093 | Exposes the PLAINTEXT protocol for internal communication among Controller nodes. |
  • Internal cluster components
| Enabled by default | | 9103 | Exposes the SASL\_PLAINTEXT protocol for internal communication among Controller nodes. |
  • Internal cluster components
| Enabled by default | | 9092 | Exposes the Kafka service to clients via the PLAINTEXT protocol. |
  • Console
  • Internal cluster components
  • Applications
| Enabled by default | | 9102 | Exposes the Kafka service to clients via the SASL\_PLAINTEXT protocol. |
  • Console
  • Internal cluster components
  • Applications
| Enabled by default | | 9112 | Exposes the Kafka service to clients via the SASL\_SSL protocol. |
  • Console
  • Internal cluster components
  • Applications
| Optional | | 9122 | Exposes the Kafka service to clients via the SSL protocol. |
  • Console
  • Internal cluster components
  • Applications
| Optional | | 9090 | Provides an endpoint for Prometheus Metrics Exporter to read metrics. |
  • Console
  • Applications (Optional)
| Enabled by default | | 22 | Default SSH port for cluster nodes, exposed to the console node for emergency troubleshooting. |
  • Console
| Enabled by default | | 8081 | Service port for the managed Schema Registry. |
  • Internal cluster components
  • Applications
| Optional, required only when TableTopic is enabled. | > [!TIP] > > Notes on the access sources mentioned in the table above: > > * **Console**: It is recommended to configure this as the Subnet CIDR where the AutoMQ console is located. > * **Internal cluster components**: Select the Subnet CIDR chosen when creating the cluster instances. > * **Applications**: Refers to the source from which applications access the Kafka service. Configure this based on your actual business requirements. ## Configure cross-VPC access An AutoMQ instance that uses a Route 53 private hosted zone can be resolved only from VPCs associated with that hosted zone. To access the instance from an application in another VPC, complete both of the following tasks: 1. Establish network connectivity between the AutoMQ VPC and the application VPC, for example by using VPC peering or AWS Transit Gateway. Update the relevant route tables and security groups to allow Kafka traffic. 2. Associate the Route 53 private hosted zone used by the AutoMQ instance with the application VPC. ### Find the private hosted zone Copy the instance endpoint from the AutoMQ Console and identify its domain suffix. In the [Route 53 console](https://console.aws.amazon.com/route53/), choose **Hosted zones**, open the matching private hosted zone, and record its hosted zone ID. ![Find the Route 53 private hosted zone ID used by the AutoMQ instance.](https://mintcdn.com/automq/zNOSgZlhMF-DHnm6/automq-cloud/getting-started/experience-automq/3.webp?fit=max\&auto=format\&n=zNOSgZlhMF-DHnm6\&q=85\&s=6c568047da2fc2cd731bb356c1bf5790) ### Associate a VPC in the same AWS account On the private hosted zone details page, edit the VPC associations and add the application VPC and its AWS Region. ![Associate a VPC in the same AWS account with the private hosted zone.](https://mintcdn.com/automq/zNOSgZlhMF-DHnm6/automq-cloud/getting-started/experience-automq/4.webp?fit=max\&auto=format\&n=zNOSgZlhMF-DHnm6\&q=85\&s=f5bbc2198d20d2158e09f04ce2ce8428) ### Associate a VPC in a different AWS account For a cross-account association, first use credentials for the account that owns the private hosted zone to authorize the application VPC: ```bash theme={null} aws route53 create-vpc-association-authorization \ --hosted-zone-id \ --vpc VPCRegion=,VPCId= ``` Then use credentials for the account that owns the application VPC to create the association: ```bash theme={null} aws route53 associate-vpc-with-hosted-zone \ --hosted-zone-id \ --vpc VPCRegion=,VPCId= ``` Allow several minutes for the association and DNS records to propagate. Then verify that a host in the application VPC can resolve the AutoMQ endpoint and connect to the configured Kafka listener. ## Prepare FSx File System Security Group (Optional) If you plan to use AutoMQ in an AWS environment and leverage FSx for NetApp ONTAP as the storage backend for the WAL (Write-Ahead Log), you need to configure a dedicated security group for the FSx file system. This section details the required inbound rules for that security group. If you prefer AutoMQ to automatically create and configure this security group during deployment, you can skip this section. | Port | Access Source | Purpose | Enablement Condition | | :- | :- | :- | :- | | 443 |
  • Console
  • Internal cluster components
| Allows the AutoMQ cluster and console to call the FSx for ONTAP management API. | Enabled by default | | 22 |
  • Internal cluster components
| Allows nodes within the AutoMQ cluster to access the FSx service. | Enabled by default | | 111 |
  • Internal cluster components
| Allows nodes within the AutoMQ cluster to access the FSx service. | Enabled by default | | 635 |
  • Internal cluster components
| Allows nodes within the AutoMQ cluster to access the FSx service. | Enabled by default | | 2049 |
  • Internal cluster components
| Allows nodes within the AutoMQ cluster to access the FSx service. | Enabled by default | | 4045 |
  • Internal cluster components
| Allows nodes within the AutoMQ cluster to access the FSx service. | Enabled by default | | 4046 |
  • Internal cluster components
| Allows nodes within the AutoMQ cluster to access the FSx service. | Enabled by default | > [!TIP] > > Notes on the access sources mentioned in the table above: > > * **Console**: It is recommended to configure this as the Subnet CIDR where the AutoMQ Console is located. > * **Internal cluster components**: Select the Subnet CIDR chosen when creating the cluster instances. ## Prepare EFS File System Security Group (Optional) If you plan to use AutoMQ in an AWS environment and leverage EFS (Elastic File System) as the storage backend for NFS WAL, you need to configure a dedicated security group for the EFS file system. This section details the required inbound rules for that security group. If you prefer AutoMQ to automatically create and configure this security group during deployment, you can skip this section. | Port | Access Source | Purpose | Enablement Condition | | :- | :- | :- | :- | | 2049 |
  • Internal cluster components
| Allows nodes within the AutoMQ cluster to access the EFS file system via the NFS protocol. | Enabled by default | > [!TIP] > > Notes on the access sources mentioned in the table above: > > * **Internal cluster components**: Select the Subnet CIDR chosen when creating the cluster instances. # Install AutoMQ on Google Cloud Source: https://docs.automq.com/automq-cloud/getting-started/install-byoc-environment/google-cloud/install-automq-on-gcp This article describes how to install the AutoMQ console on Google Cloud with Docker and complete the initial permission configuration before deploying to GKE. ## Overview To use an AutoMQ BYOC environment on Google Cloud, you first need to install the AutoMQ console. The console is a web application deployed in your Google Cloud project. You use it to create, manage, and monitor AutoMQ clusters. Starting from 8.x, the AutoMQ console is distributed and started as a Docker image. New environments should use the Docker installation method. ## Prerequisites Before you begin installing the AutoMQ console, prepare the required Google Cloud network resources. * **VPC environment**: The AutoMQ console and GKE cluster need to run in your VPC, usually the same VPC as your Kafka client applications or a VPC that can reach them. ## Steps ### Step 1: Register your environment on the AutoMQ website First, register your deployment environment on the AutoMQ website to obtain the environment metadata and Docker startup command. 1. Visit [AutoMQ Cloud](https://account.automq.cloud) and log in to your account. 2. On the console page, click **Create Environment**. 3. Follow the wizard to enter the environment name, cloud provider, region, and related information. 4. After creation, copy the Docker startup command generated by the installation wizard. ### Step 2: Prepare and deploy the console VM The AutoMQ console needs to run on a standalone Google Cloud VM. The VM should be in the VPC used by the GKE cluster that you will deploy later. On GCP, the AutoMQ console running on the VM calls Google Cloud APIs through the Google Service Account bound to that VM. To avoid using the default Compute Engine service account, create a dedicated service account in the service project where the console runs before you create the VM. This document refers to it as the console Google Service Account. The console Google Service Account is the control plane identity for the AutoMQ console. During permission initialization, you grant this service account the permissions needed to manage GKE, GCS, Cloud DNS, IAM bindings, and other cloud resources required by AutoMQ. At this point, you only need to create the service account and bind it to the VM when you create the VM. You don't need to grant the full AutoMQ permissions in advance. After the console starts, the initialization page shows the permissions that need to be granted to this service account and guides you through authorization and verification. If you use `gcloud` to create the console Google Service Account, use the following example: ```bash theme={null} PROJECT_ID="" CONSOLE_SA_ID="automq-console" gcloud iam service-accounts create "${CONSOLE_SA_ID}" \ --project="${PROJECT_ID}" \ --display-name="AutoMQ console" ``` #### Basic requirements For stable console operation, we recommend the following VM configuration: 1. **Instance specifications** * At least **2 vCPUs** and **8 GB memory**. * At least **20 GiB** system disk. * Use a separate data disk or a stable data directory for console data. 2. **Network location** * The console VM should be in a VPC and subnet reachable from the GKE cluster. * If you use Shared VPC, confirm the permission boundary between the service project where the console runs and the host project where the VPC resides. * The console service listens on port `8080` by default. Allow your operations access source to reach port `8080` on the console VM, and restrict the source CIDR ranges to your office network, bastion host, or another approved access path. If you use `gcloud` to create the firewall rule, use the following command as a reference. It narrows the target to VMs bound to the console Google Service Account by using `--target-service-accounts`. `NETWORK_PROJECT_ID` is the project that owns the VPC and firewall rules. In non-Shared VPC environments, it is usually the service project. ```bash theme={null} NETWORK_PROJECT_ID="" VPC_NAME="" CONSOLE_SA_EMAIL="" SOURCE_CIDR="" gcloud compute firewall-rules create "automq-console-allow-8080" \ --project="${NETWORK_PROJECT_ID}" \ --network="${VPC_NAME}" \ --direction=INGRESS \ --action=ALLOW \ --source-ranges="${SOURCE_CIDR}" \ --target-service-accounts="${CONSOLE_SA_EMAIL}" \ --rules=tcp:8080 ``` 3. **Internet access or egress capability** * The console VM needs to pull Docker images and synchronize required metadata. Use an external IP, Cloud NAT, or another egress path. * If the console VM doesn't use an external IP and doesn't have Cloud NAT or another egress path, enable Private Google Access on the subnet that hosts the console VM so it can reach Cloud Storage, GKE, IAM, Cloud DNS, and other Google APIs. This configuration only covers Google API access. If the VM needs to reach external image registries or other non-Google endpoints, it still needs an external IP, Cloud NAT, or another egress path. For details, see the Google Cloud documentation [Configure Private Google Access](https://docs.cloud.google.com/vpc/docs/configure-private-google-access). 4. **VM service account** * When you create the VM, bind the console Google Service Account prepared earlier to the VM. This is the same service account you created at the beginning of this step, and the later permission initialization also applies to this service account. * The operator who creates the VM needs the `iam.serviceAccounts.actAs` permission on this service account to bind it to the VM. * Set the VM access scope to allow full access to all Cloud APIs (`https://www.googleapis.com/auth/cloud-platform`). Google Cloud's default access scopes only include limited permissions such as read-only Cloud Storage, Logging, and Monitoring. * Even if the console Google Service Account has the required IAM roles, a restrictive VM access scope can still block calls to GKE, IAM, Cloud DNS, or write operations to GCS. For details, see the Google Cloud documentation [Create a VM that uses a user-managed service account](https://docs.cloud.google.com/compute/docs/access/create-enable-service-accounts-for-instances). #### Install and start Docker Log in to the console VM, then install and start Docker. The following commands use Debian / Ubuntu as an example: ```bash theme={null} sudo apt-get update sudo apt-get install -y docker.io sudo systemctl start docker sudo systemctl enable docker sudo docker version ``` #### Start the AutoMQ console After the VM is ready, copy the Docker startup command generated by the installation wizard in Step 1 and start the AutoMQ console. > [!TIP] > > The command generated by the installation wizard already contains the environment ID, cloud provider, region, authentication parameters, Docker image address, and related information. Do not assemble these parameters manually. After you run the startup command, check the container status and logs: ```bash theme={null} sudo docker ps sudo docker logs -f "" ``` After the Docker container runs correctly and port 8080 is reachable, you can access the AutoMQ console in your browser. ### Step 3: Configure console permissions and complete initialization After the AutoMQ console starts successfully, the first login may ask you to initialize permissions. Follow the GCP permission instructions on the page and grant the required permissions to the console Google Service Account. Permission initialization allows the AutoMQ console to create and manage cloud resources. In GCP, the console VM calls Google Cloud APIs through the bound console Google Service Account. Follow the page instructions and grant the listed permissions to this service account. The console verifies those permissions during initialization. GCP permissions can be granted at different locations depending on the capability. In non-Shared VPC environments, the service project and host project are usually the same project. In Shared VPC environments, GKE, the console VM, buckets, and Google Service Accounts usually reside in the service project, while VPC, subnet, and firewall resources reside in the host project. Some bucket and Cloud DNS permissions may also need to be granted on the target resource. The following table helps you understand the bindings shown on the initialization page. Grant permissions based on the content generated on that page. | Capability | Recommended binding location | Description | | - | - | - | | Console system data management | Bucket shown on the initialization page | The console reads and writes system logs, metrics, and other runtime data, and maintains the bucket IAM policy. Recommended role: `roles/storage.admin`. | | GKE and network discovery | Service project and host project | The console reads GKE Standard clusters, node pools, VPCs, and subnets. In Shared VPC environments, grant VPC and subnet read permissions in the host project. Grant `roles/container.admin` in the service project, and `roles/compute.networkViewer` in the project that owns the network. | | Data bucket management | Service project | The console creates managed data buckets based on instance configuration, or discovers and validates existing data buckets. Recommended role for managed bucket mode: `roles/storage.admin`; existing bucket mode usually requires `roles/storage.bucketViewer`. | | Cloud DNS management | Service project; also host project in Shared VPC environments | The console creates or reads Cloud DNS private managed zones, and maintains zone IAM policies in managed DNS mode. Managed DNS mode requires `roles/dns.admin` and creates a custom role named `automqConsoleDnsZoneIamPolicyAdmin`, which contains `dns.managedZones.getIamPolicy` and `dns.managedZones.setIamPolicy`. In Shared VPC environments, the host project also needs `roles/dns.admin` for private zone binding. Existing DNS mode usually requires `roles/dns.reader`. | | Instance Google Service Account management | Service project | The console creates the instance Google Service Account and configures instance-level IAM bindings in managed identity mode. In existing identity mode, the console reads the target Google Service Account. Managed identity mode requires `roles/iam.serviceAccountAdmin`, `roles/iam.roleAdmin`, and `roles/resourcemanager.projectIamAdmin`; existing identity mode usually requires `roles/iam.serviceAccountViewer`. | After granting the permissions, return to the AutoMQ console and click the verification or initialization action. After verification succeeds, you can enter the AutoMQ console and continue configuring GKE. ## Next steps * **Deploy to GKE**: After installing the console and completing permission initialization, see [Deploy to Google Cloud GKE](/automq-cloud/deploy-automq-on-kubernetes/deploy-to-google-cloud-gke). * **Use AutoMQ via WebUI**: Continue to create instances through the environment console and experience the product features. [Experience AutoMQ▸](/automq-cloud/getting-started/experience-automq) * **Use AutoMQ via Terraform**: After installing the console, you can manage and use AutoMQ through the AutoMQ Terraform Provider. For Terraform usage, see the [Terraform Provider documentation](https://registry.terraform.io/providers/AutoMQ/automq/latest/docs). # Install AutoMQ on Azure Source: https://docs.automq.com/automq-cloud/getting-started/install-byoc-environment/install-env-on-azure Install the AutoMQ 8.x BYOC console on Azure with Docker and complete permission initialization. ## Overview Before using AutoMQ BYOC, install the AutoMQ console in your Azure subscription. You use the console to create, manage, and monitor AutoMQ clusters. Starting from 8.x, the AutoMQ console is distributed and started as a Docker image. New environments should use this Docker installation process. For an existing 7.x environment, see [Azure BYOC Console Upgrade Guide to v8.x](../../appendix/azure-byoc-console-upgrade-to-8.x-guide). ## Prerequisites Prepare the following resources: * An Azure subscription and Resource Group. * A Virtual Network and a Subnet for the console VM. The Subnet must reach the Docker registry and AutoMQ Cloud. If the VM has no Public IP, configure a NAT Gateway or another egress path. * A dedicated User-assigned Managed Identity for the console (Console UAMI). * Network access from an approved operations source to port `8080` on the console VM. ## Steps ### Step 1: Register the environment in AutoMQ Cloud 1. Sign in to [AutoMQ Cloud](https://account.automq.cloud). 2. Create an Azure BYOC Environment and follow the wizard to enter the environment name, Region, and related information. 3. Copy the complete Docker startup command generated by the installation wizard. > [!TIP] > > The command contains the complete Base64 `CONFIG`, `CLOUD_PROVIDER=azure`, initial administrator settings, and exact image address. Run the generated command directly. Do not decode, split, or manually assemble `CONFIG`. ### Step 2: Prepare the console VM #### Check the VM configuration Create an Ubuntu VM in the prepared Subnet. We recommend: * At least 2 vCPUs, 8 GiB memory, and a 20 GiB system disk. * A separate persistent disk mounted at a stable host path for console data. Configure automatic mounting after a VM restart, and confirm that the directory exists and is writable by Docker before starting the console. * Egress to the Docker registry, AutoMQ Cloud, and Azure APIs. * Ingress to TCP `8080` only from approved operations networks. #### Create and bind the Console UAMI Create a dedicated Console UAMI and bind it to the console VM. The following Azure CLI commands are an example: ```bash theme={null} RESOURCE_GROUP="" IDENTITY_NAME="" VM_NAME="" az identity create --resource-group "$RESOURCE_GROUP" --name "$IDENTITY_NAME" CONSOLE_UAMI_ID=$(az identity show \ --resource-group "$RESOURCE_GROUP" \ --name "$IDENTITY_NAME" \ --query id -o tsv) az vm identity assign \ --resource-group "$RESOURCE_GROUP" \ --name "$VM_NAME" \ --identities "$CONSOLE_UAMI_ID" az vm show --resource-group "$RESOURCE_GROUP" --name "$VM_NAME" --query identity ``` The VM must use this Console UAMI as the only Managed Identity caller for the console. The `az vm identity assign` command adds an identity; it does not remove an existing system-assigned identity or other UAMIs. Review the final `az vm show` output and remove other VM identities before startup unless the generated configuration explicitly selects the Console UAMI. Grant the later **System Initialization** permissions to this identity. #### Install and start Docker Sign in to the VM and install Docker. The following example uses Ubuntu: ```bash theme={null} sudo apt-get update sudo apt-get install -y docker.io sudo systemctl enable --now docker sudo docker version ``` #### Start the AutoMQ console Run the complete Docker startup command from Step 1. Before running it, confirm that its host mount source is on the mounted persistent disk and that the container target remains `/root`. Otherwise, rebuilding the VM or replacing its system disk can lose console data. Check the container after startup: ```bash theme={null} sudo docker ps sudo docker logs -f "" ``` When the container is healthy and port `8080` is reachable, open the AutoMQ console in your browser. Sign in with the initial administrator credentials from the generated command and reset the bootstrap password when prompted. ### Step 3: Complete System Initialization After the first login, open **System Initialization** and use the Terraform configuration generated on that page to grant permissions to the existing Console UAMI. The generated configuration does not create or replace the Console UAMI. The roles, scopes, and commands shown on the page are the source of truth for the current release. The generated permissions follow these boundaries: | Permission group | Scope | Purpose | | - | - | - | | Required resource discovery | Subscription | Read-only discovery of Resource Groups, AKS, VM/VMSS, VNet/Subnet, Storage, Private DNS, UAMI, and role metadata. | | Required Blob data access | The specified Ops or Data Blob container | Reads, writes, and deletes Blob objects used by AutoMQ. | | Required AKS access | The specified AKS cluster | Reads the AKS cluster and obtains a `clusterUser` credential. It does not grant Kubernetes API management permissions. | | Customer-Provided DNS records | The specified Private DNS Zone | Reads the VNet link and manages the A/CNAME records owned by an Instance. | | Managed resource lifecycle | Console Resource Group | When Managed resources are selected, creates and maintains Storage, Private DNS, UAMI, and Federated Identity Credential resources. | | Managed RBAC delegation | Subscription, with the condition generated by the page | When Managed resources are selected, allows the console to create only the role definitions and ServicePrincipal role assignments required by AutoMQ. | AKS credential access and Kubernetes authorization are separate. If Azure RBAC for Kubernetes Authorization is enabled, grant the Console UAMI the Kubernetes role shown by the console at the target AKS scope. Otherwise, have a cluster administrator create and maintain the required Kubernetes `ClusterRoleBinding`. See [Deploy to Azure AKS](../../deploy-automq-on-kubernetes/deploy-to-azure-aks) for both authorization paths. Apply only the permissions generated for the selected resource mode and scopes, then return to **System Initialization** to verify them. Resources selected later during Instance creation may require additional permissions scoped to those resources. Do not grant those permissions in advance, and do not replace the generated least-privilege roles with Subscription-level `Contributor`. ## Terraform quick start To prepare the console, AKS, and example resources together, see the [AutoMQ Azure Terraform example](https://github.com/AutoMQ/automq-labs/tree/main/byoc-examples/setup/azure/azure-automq-env). The example is intended as a quick start. Before production use, restrict network access, protect Terraform state, and review all custom roles and scopes against your organization policy. ## Next steps * **Deploy to AKS**: See [Deploy to Azure AKS](../../deploy-automq-on-kubernetes/deploy-to-azure-aks) to prepare AKS and Azure Workload Identity and create an AutoMQ Instance. * **Use AutoMQ through the WebUI**: See [Experience AutoMQ](../experience-automq) to create and manage an Instance. * **Use AutoMQ through Terraform**: See the [AutoMQ Terraform Provider](https://registry.terraform.io/providers/AutoMQ/automq/latest/docs) to manage AutoMQ resources. # OCI Source: https://docs.automq.com/automq-cloud/getting-started/install-byoc-environment/oci-install-automq # Install AutoMQ on OCI This document will guide you through the process of deploying AutoMQ for Kafka on Oracle Cloud Infrastructure (OCI). We will cover environment preparation and installation steps to ensure a smooth deployment. ## 1. Prepare a Virtual Cloud Network (VCN) First, we need a correctly configured Virtual Cloud Network (VCN) to host the Kubernetes cluster and AutoMQ instances. Please ensure your VCN meets the following requirements: * **Same Region**: The VCN must be in the same OCI region where you plan to deploy the OKE cluster and your business applications. * **Subnets**: * The VCN must contain at least two subnets, ideally one Public Subnet and at least one Private Subnet. * **Public Subnet**: Used for deploying resources that require public internet access, such as Load Balancers. * **Private Subnet**: Used for deploying OKE worker nodes and AutoMQ instances to enhance security. * Ensure each subnet has sufficient available IP addresses to meet the scaling needs of your OKE cluster and applications. * Reference: [Managing VCNs and Subnets](https://docs.oracle.com/en-us/iaas/Content/Network/Tasks/managingVCNs.htm) * **Internet Gateway**: Attach an Internet Gateway to your Public Subnet and configure appropriate routing rules to allow traffic from the internet. * Reference: [Managing Internet Gateways](https://docs.oracle.com/en-us/iaas/Content/Network/Tasks/managingIGs.htm) * **NAT Gateway**: Attach a NAT Gateway to your Private Subnet and configure appropriate routing rules. This allows resources within the Private Subnet (e.g., OKE nodes) to access the internet for downloading images and dependencies, without allowing direct internet access to these resources. * Reference: [Managing NAT Gateways](https://docs.oracle.com/en-us/iaas/Content/Network/Tasks/manage-nat.htm) * **Service Gateway**: Enable a Service Gateway for your VCN and configure routing rules to allow resources within the private network to access OCI Object Storage via OCI's backbone network. This ensures secure and high-performance data transfer. * Reference: [Access to Oracle Services: Service Gateway](https://docs.oracle.com/en-us/iaas/Content/Network/Tasks/servicegateway.htm) ## 2. Prepare Object Storage AutoMQ offloads streaming data to cloud provider object storage for disaggregated storage and compute, achieving significant cost savings. In an OCI environment, each AutoMQ cluster requires two separate object storage buckets: * **Data Bucket**: Used for storing Kafka message data. Recommended naming convention: `automq-data-`. * **Ops Bucket**: Used for storing operational data such as cluster logs and metrics. Recommended naming convention: `automq-ops-`. Please create these two buckets in the same OCI region as your OKE cluster. * Reference: [Managing Buckets in Object Storage](https://docs.oracle.com/en-us/iaas/Content/Object/Tasks/managingbuckets.htm) ## 3. Prepare the Kubernetes Cluster (OKE) AutoMQ is a cloud-native messaging and streaming system designed to run entirely on Kubernetes. Therefore, you need to prepare an Oracle Kubernetes Engine (OKE) cluster. > [!TIP] > > **Note**: You can refer to [this Terraform script](https://github.com/AutoMQ/automq-labs/tree/main/byoc-examples/setup/kubernetes/oci/terraform/oke) to create a compliant OKE cluster with one click. ### 3.1. Create OKE Cluster When creating your OKE cluster, pay attention to the following key parameter configurations: * **Kubernetes Version**: It is recommended to choose a recent stable version, for example, `v1.33.x`. Please refer to the official OCI documentation for the latest supported versions. * **Network Mode**: * Select **"VCN-Native Pod Networking"** (NPN) network mode. * In the network configuration, select the VCN you prepared in the first step and configure the Kubernetes API Endpoint and Worker Nodes subnets to the correct private subnets. * Configure Network Security Groups (NSGs) to allow necessary traffic into and out of the cluster. * Reference: [Creating a Kubernetes Cluster](https://docs.oracle.com/en-us/iaas/Content/ContEng/Tasks/contengcreatingclusterusingoke.htm) ### 3.2. Create Node Pool For optimal performance and resource isolation, it is recommended to create a dedicated node pool for AutoMQ. * **Instance Type (Shape)**: We recommend `VM.Standard.E5.Flex` shapes, which offer flexible CPU and memory ratios. * **Resource Configuration**: * **OCPUs**: 2 * **Memory**: 16 GB * **Node Count (Size)**: Select at least 3 nodes to ensure high availability. ## 4. Deploy AutoMQ with Helm Chart Once all the above preparatory work is complete, you can proceed to deploy AutoMQ BYOC using Helm Chart. For detailed installation steps, parameter configurations (such as choosing between S3WAL and EBSWAL modes), and advanced configurations, refer to our standard Helm Chart deployment documentation. **[Deploy AutoMQ BYOC with Helm Chart▸](/automq-cloud/appendix/deploy-automq-enterprise-via-helm-chart)** # Overview Source: https://docs.automq.com/automq-cloud/getting-started/overview Register an account, install an AutoMQ BYOC environment, and create an AutoMQ instance. This guide provides the workflow for using AutoMQ Cloud to install an AutoMQ BYOC (Bring Your Own Cloud) environment and create an Apache Kafka-compatible instance in your cloud account. > [!NOTE] > > Throughout this document, "AutoMQ" refers to AutoMQ HK Limited and its affiliates. ## Prerequisites Before you begin, ensure your cloud environment meets the following requirements: * **Cloud Infrastructure:** Prepare the provider-specific cloud network used by your applications, such as an AWS VPC, a Google Cloud VPC network, or an Azure VNet. The installation also requires access to the object storage and compute services specified by the cloud provider guide. * **Cloud Account:** Use an active public cloud account whose identity has the permissions required to create and manage the documented network, storage, compute, and identity resources. ## Getting Started Workflow The process of getting started with AutoMQ Cloud involves three steps: 1. **Register an AutoMQ Cloud account:** Go to the [AutoMQ Cloud sign-up page](https://account.automq.cloud) and create an account. 2. **Create and install an Environment:** Create the logical management boundary for your cloud infrastructure, network, and AutoMQ resources, and then install the AutoMQ Console in your cloud account. For more information, see [Environments overview](/automq-cloud/manage-environments/overview). 3. **Create an Instance:** After the Environment is installed and authorized, create an AutoMQ Instance. An Instance corresponds to an Apache Kafka® cluster. After the Instance is running, use its bootstrap server endpoint to connect Kafka clients and produce and consume messages. # Manage Environment License Source: https://docs.automq.com/automq-cloud/manage-environments/manage-environment-license Obtain and activate a prepaid license for an AutoMQ BYOC environment. > [!TIP] > > This document applies only to the prepaid billing model. If you are using an AWS environment, we recommend [Usage-Based Billing](/automq-cloud/subscriptions-and-billings/byoc-env-billings/usage-based-billing), which does not require License management. Use this document to manage the environment license when you select prepaid billing for AutoMQ BYOC (Bring Your Own Cloud). > [!NOTE] > > In this document, AutoMQ product service provider, AutoMQ service provider and AutoMQ each specifically refer to AutoMQ HK Limited. ## Obtaining a License When a new user installs an AutoMQ BYOC environment for the first time, the environment includes a free trial license by default. > [!TIP] > > The default free trial license is valid for 14 days and provides 24 AKUs. For the definition of AKU, see [Billing Instructions for BYOC](/automq-cloud/subscriptions-and-billings/byoc-env-billings/billing-instructions-for-byoc). Formal production environment users can purchase a license through the following channels: > [tab] Offline Contract Procurement License > > Users can contact the AutoMQ technical team to purchase a license through [Obtaining Services▸](/automq-cloud/support/obtaining-services). > [tab] AWS Marketplace Purchase License > > The AutoMQ BYOC subscription license is available on **AWS Marketplace** as [AutoMQ for Kafka (BYOC Monthly Subscription License)](https://aws.amazon.com/marketplace/pp/prodview-5jgdxi4mhl4rg). Use the following procedure: > > 1. AWS users can visit Marketplace, search for AutoMQ or Kafka, locate [AutoMQ for Kafka (BYOC Monthly Subscription License)](https://aws.amazon.com/marketplace/pp/prodview-5jgdxi4mhl4rg), select the appropriate specification version and subscription period, then activate the subscription. > > ![](https://mintcdn.com/automq/Nkuel_v7FAcWxmbN/automq-cloud/manage-environments/manage-environment-license/3.webp?fit=max\&auto=format\&n=Nkuel_v7FAcWxmbN\&q=85\&s=52ae05e923a4883fe95d9a2bd849dc69) > > 2. Choose the desired subscription quantity and duration. > > ![](https://mintcdn.com/automq/Nkuel_v7FAcWxmbN/automq-cloud/manage-environments/manage-environment-license/4.webp?fit=max\&auto=format\&n=Nkuel_v7FAcWxmbN\&q=85\&s=7643a4cb95a6685107ab1a783819275f) > > 3. After completing the purchase, click **Setup Product** to be redirected to the AutoMQ Contact page. Complete the License information and reach out to AutoMQ technical support to obtain the product key. > > ![](https://mintcdn.com/automq/Nkuel_v7FAcWxmbN/automq-cloud/manage-environments/manage-environment-license/5.webp?fit=max\&auto=format\&n=Nkuel_v7FAcWxmbN\&q=85\&s=589604f39d282608f5eaecf2870f2532) > [tab] Azure Marketplace Purchase License > > Azure Marketplace provides the AutoMQ BYOC prepaid license as a SaaS offer. Azure Marketplace is the purchasing and billing channel; the AutoMQ control plane and data plane remain in your cloud environment. > > 1. Sign in to Azure and verify that your account can manage the applicable Billing Profile. For role details, see [Understand Microsoft Customer Agreement administrative roles in Azure](https://learn.microsoft.com/en-us/azure/cost-management-billing/manage/understand-mca-roles). > 2. Open the [AutoMQ BYOC offer in Azure Marketplace](https://portal.azure.com/#view/Microsoft_Azure_Marketplace/GalleryItemDetailsBladeNopdl/id/automq.automq-byoc-license/selectionMode~/false/resourceGroupId//resourceGroupLocation//dontDiscardJourney~/false/selectedMenuId/home/launchingContext~/%7B%22galleryItemId%22%3A%22automq.automq-byoc-licenseaku%22%2C%22source%22%3A%5B%22GalleryFeaturedMenuItemPart%22%2C%22VirtualizedTileDetails%22%5D%2C%22menuItemId%22%3A%22home%22%2C%22subMenuItemId%22%3A%22Search%20results%22%2C%22telemetryId%22%3A%22de8e32d0-4735-4d9d-bc96-23813e277828%22%7D/searchTelemetryId/faa4a435-a76d-4e3b-ac22-138f431b9a50). > 3. Choose **Subscribe**, select the Resource Group, enter a subscription name, and configure renewal according to your procurement policy. > 4. After Azure creates the subscription, choose **Set up product account** and complete the requested account synchronization. > 5. Contact [AutoMQ Support](/automq-cloud/support/obtaining-services) with the subscription information and Environment Installation ID to obtain the product key. > > For negotiated pricing or discounts, request an Azure Marketplace Private Offer from AutoMQ before subscribing. ## Using the License to Activate the Environment After installing the user BYOC environment and purchasing the License, refer to the documentation below for environment activation. ### Operational Steps 1. Log in to the BYOC environment console and navigate to the **Settings** page. ![](https://mintcdn.com/automq/Nkuel_v7FAcWxmbN/automq-cloud/manage-environments/manage-environment-license/6.webp?fit=max\&auto=format\&n=Nkuel_v7FAcWxmbN\&q=85\&s=d5d046666be940fd8e7a0f2333ac3573) 2. Gather the environment **Installation ID** and configure the license information purchased in the previous step. Contact AutoMQ technical personnel to obtain the activation **product key**. The product key for environment activation will be in a format similar to the following: ```text theme={null} eyJpbnN0YWxsSWQiOiJmMGQzZDRlNmJmMjhjNTBjNGM3M2RjNzdkZTUzYTZiOSIsImVudmlyb25txxxxxxxdXRvTVEgZm9yIEthZmthICggQllPQyBNb250aGx5IFN1YnNjcmlwdGlvxxxxaWNlbnNlICkifX19 ``` 3. Return to the **Settings** page and click **Update product license**. Enter the product key to complete environment activation. You can then proceed to create instances normally. ![](https://mintcdn.com/automq/Nkuel_v7FAcWxmbN/automq-cloud/manage-environments/manage-environment-license/7.webp?fit=max\&auto=format\&n=Nkuel_v7FAcWxmbN\&q=85\&s=e554cd3a944582a61ad125c93084559b) # Overview Source: https://docs.automq.com/automq-cloud/manage-environments/manage-environment-ops-authing/overview Ensure seamless operations and stability of your AutoMQ Cloud BYOC environment by authorizing read and write permissions for system logs and updates. Discover the steps for different cloud providers. # Manage Environment Ops Authing When using the AutoMQ Cloud BYOC product, system logs, metrics, and other data are generated at the underlying level of the BYOC environment. The AutoMQ service provider requires the user to provide corresponding operational authorization for system stability monitoring and self-healing maintenance operations. > [!NOTE] > > In this article, the terms AutoMQ product service provider, AutoMQ service provider, and AutoMQ specifically refer to AutoMQ HK Limited. ## Authorization Principle AutoMQ's operational authorization includes three scenarios: 1. **Scenario 1: System monitoring and alerts, requiring read permissions.** During the operation of the AutoMQ Cloud BYOC environment, system logs, inspection logs, and system metrics data are generated by the environment console and the AutoMQ data plane cluster. This data is automatically uploaded to the operational bucket specified when the user creates the environment. The AutoMQ service provider needs the user’s cloud account to authorize read permissions for this operational bucket. This allows the AutoMQ operational platform to monitor the stability and perform self-healing of the user’s cluster. 2. **Scenario 2: Subscription license dynamic updates and new version updates, requiring write permissions.** When the subscription license of the AutoMQ BYOC environment triggers renewal, scaling, or new version releases, the control components within the environment need to perceive the new subscription information and the metadata of the new version. At this point, the AutoMQ service provider writes the new information to the operational bucket, and the environment console dynamically loads it. 3. **Scenario 3: Emergency Trouble Shooting scenario requiring remote access to the BYOC environment.** The AutoMQ BYOC environment supports Ops Tunnel, which allows users to create secure, trusted, and auditable operational channels. This grants AutoMQ technical staff access to the BYOC environment within a limited scope for locating and analyzing complex issues. ![](https://mintcdn.com/automq/Nkuel_v7FAcWxmbN/automq-cloud/manage-environments/manage-environment-ops-authing/overview/1.webp?fit=max\&auto=format\&n=Nkuel_v7FAcWxmbN\&q=85\&s=2cdb3d41b9d7fd96f399820212d7e736) ## Ops Bucket Authorization The authorization operation is completed through the bucket authorization policy provided by the cloud provider’s object storage. The user, as the bucket owner, grants the AutoMQ service provider's cloud account the permission to read the specified operational bucket. **The details of the required read permissions are as follows:** | **Cloud Providers** | **AutoMQ Service Provider Cloud Account ID** | **Granted Permissions List** | | - | - | - | | Alibaba Cloud | 1431115939942888 |
  • Authorized Resource: Maintenance Bucket for the specified environment
  • Authorized Operations: Read and write permissions for the bucket.
| | AWS | 381492316447 |
  • Authorized Resource: Maintenance Bucket for the specified environment
  • Authorized Operations:
    • s3:GetObject
    • s3:GetObjectVersion
    • s3:GetObjectAcl
    • s3:GetObjectTagging
    • s3:GetObjectVersionAcl
    • s3:GetObjectVersionTagging
    • s3:ListBucket
    • s3:ListBucketVersions
    • s3:ListBucketMultipartUploads
    • s3:PutObject
| | GCP | [automq-public-ops-authing@automq-public.iam.gserviceaccount.com](mailto:automq-public-ops-authing@automq-public.iam.gserviceaccount.com) |
  • Storage Object User role
| | Azure | 123d6e96-84f4-4569-82ec-c25edb2dc696 (App ID) |
  • Authorized Resource: Ops Bucket Blob Container for the specified environment
  • Authorized Role: Storage Blob Data Contributor
| > [!TIP] > > Environmental Maintenance Authorization Statement: > > The maintenance bucket must be isolated from the data bucket and other application buckets used, storing only system logs and metrics data. It does not contain user business messages or other data, ensuring no data security risk. ### Configuration Guide Since the control panels of object storage products vary among different cloud providers, the steps for granting operation authorization also differ. Please refer to the documentation listed below for detailed steps: * [Set Ops Authing from AWS▸](/automq-cloud/manage-environments/manage-environment-ops-authing/set-ops-authing-from-aws) * [Set Ops Authing from Google Cloud▸](/automq-cloud/manage-environments/manage-environment-ops-authing/set-ops-authing-from-google-cloud) * [Set Ops Authing from Azure▸](/automq-cloud/manage-environments/manage-environment-ops-authing/set-ops-authing-from-azure) # Set Ops Authing from AWS Source: https://docs.automq.com/automq-cloud/manage-environments/manage-environment-ops-authing/set-ops-authing-from-aws Configure delegated ops authorization for AutoMQ cloud service on AWS S3 with detailed steps and policies. Enjoy cloud-native scalability and Kafka compatibility. Refer to [Manage Environment Ops Authing▸](/automq-cloud/manage-environments/manage-environment-ops-authing/overview), when using the AutoMQ Cloud BYOC product, the AutoMQ service provider needs the user to provide the appropriate ops authorization. This document explains how to configure delegated ops authorization in AWS S3. > [!TIP] > > When installing the AutoMQ console in an AWS environment, operational authorization is usually completed automatically by default. > > * **If your version is >= 8.0**: manual authorization is usually not required. > * **If your version is \< 8.0**: manual authorization must be performed according to the guidelines in this document. ### AWS Environment Authorization The AWS S3 console provides the Bucket Policy authorization feature. The operation steps are referenced in the document below. #### Console Operation Steps Log in to the cloud account that owns the Ops Bucket or a sub-account with authorization capabilities, and go to the [S3 Console](https://ap-southeast-1.console.aws.amazon.com/s3/buckets?region=ap-southeast-1): 1. **Go to the Bucket list page and find the target Bucket.** The user visits the S3 console, clicks on **Bucket List** on the left navigation bar, and enters the list page. Search for the Ops Bucket configured for the current environment and click on the details. ![](https://mintcdn.com/automq/Nkuel_v7FAcWxmbN/automq-cloud/manage-environments/manage-environment-ops-authing/set-ops-authing-from-aws/1.webp?fit=max\&auto=format\&n=Nkuel_v7FAcWxmbN\&q=85\&s=8b264fe7af24fdc13ff51034313fc3f9) 2. **Go to the Permissions menu and find the Bucket Policy.** Click **Edit** to open the authorization form. ![](https://mintcdn.com/automq/HveFFwfWarPtnDnE/automq-cloud/manage-environments/manage-environment-ops-authing/set-ops-authing-from-aws/2.webp?fit=max\&auto=format\&n=HveFFwfWarPtnDnE\&q=85\&s=3cac7314b2d32ce64e3ec2cdb310d165) 3. **Fill in Authorization Information and Create a Bucket Authorization Policy.** Follow the instructions below to fill in the necessary authorization information, click OK, and complete the creation of the authorization policy. * Authorized Resource: Select the specified Ops Bucket. * Authorized User: Refer to [Overview▸](/automq-cloud/manage-environments/manage-environment-ops-authing/overview), and fill in the AutoMQ service provider cloud account ID "381492316447". * Authorized Operation: Refer to the policy below. ```json theme={null} { "Version": "2012-10-17", "Statement": [ { "Effect": "Allow", "Principal": { "AWS": "arn:aws:iam::381492316447:root" }, "Action": [ "s3:GetObject", "s3:GetObjectVersion", "s3:GetObjectAcl", "s3:GetObjectTagging", "s3:GetObjectVersionAcl", "s3:GetObjectVersionTagging", "s3:ListBucket", "s3:ListBucketVersions", "s3:ListBucketMultipartUploads", "s3:PutObject" ], "Resource": [ "arn:aws:s3:::{Ops Bucket Name}", "arn:aws:s3:::{Ops Bucket Name}/*" ] } ] } ``` ![](https://mintcdn.com/automq/HveFFwfWarPtnDnE/automq-cloud/manage-environments/manage-environment-ops-authing/set-ops-authing-from-aws/3.webp?fit=max\&auto=format\&n=HveFFwfWarPtnDnE\&q=85\&s=b6e2c9d23292f4c3a0afe61da2810dc4) #### Optional: restrict access to cluster configuration Logs stored in the AutoMQ Ops Bucket also include cluster configuration information. To prevent AutoMQ from accessing configuration objects under `automq/config/` and `automq/config-template/`, use the policy below. This policy keeps read and list access for the Ops Bucket, limits `s3:PutObject` to `automq/metadata/` and `automq/license/`, and adds an explicit `Deny` for reads from the two configuration prefixes. Replace every occurrence of `{Ops Bucket Name}` with your environment's Ops Bucket name. Use the statements below in place of the original AutoMQ Allow statement. Remove any existing broader `s3:PutObject` Allow. Retain unrelated Bucket Policy statements. ```json theme={null} { "Version": "2012-10-17", "Statement": [ { "Effect": "Allow", "Principal": { "AWS": "arn:aws:iam::381492316447:root" }, "Action": [ "s3:GetObject", "s3:GetObjectVersion", "s3:GetObjectAcl", "s3:GetObjectTagging", "s3:GetObjectVersionAcl", "s3:GetObjectVersionTagging", "s3:ListBucket", "s3:ListBucketVersions", "s3:ListBucketMultipartUploads" ], "Resource": [ "arn:aws:s3:::{Ops Bucket Name}", "arn:aws:s3:::{Ops Bucket Name}/*" ] }, { "Effect": "Allow", "Principal": { "AWS": "arn:aws:iam::381492316447:root" }, "Action": [ "s3:PutObject" ], "Resource": [ "arn:aws:s3:::{Ops Bucket Name}/automq/metadata/*", "arn:aws:s3:::{Ops Bucket Name}/automq/license/*" ] }, { "Effect": "Deny", "Principal": { "AWS": "arn:aws:iam::381492316447:root" }, "Action": [ "s3:GetObject", "s3:GetObjectVersion", "s3:GetObjectAcl", "s3:GetObjectTagging", "s3:GetObjectVersionAcl", "s3:GetObjectVersionTagging" ], "Resource": [ "arn:aws:s3:::{Ops Bucket Name}/automq/config/*", "arn:aws:s3:::{Ops Bucket Name}/automq/config-template/*" ] } ] } ``` Bucket listing permissions remain unchanged, so object names under the configuration prefixes may still appear in listing results. The `s3:PutObject` permission applies only to objects under `automq/metadata/` and `automq/license/`. # Set Ops Authing from Azure Source: https://docs.automq.com/automq-cloud/manage-environments/manage-environment-ops-authing/set-ops-authing-from-azure Configure cross-tenant operational authorization for AutoMQ on Azure by creating a service principal and granting Storage Blob Data Contributor access to the Ops Bucket. As described in [Manage Environment Ops Authing▸](/automq-cloud/manage-environments/manage-environment-ops-authing/overview), the AutoMQ operational platform requires read and write access to the Ops Bucket in your Azure environment. This access enables system stability monitoring, self-healing, subscription license updates, and version upgrades for your BYOC environment. In Azure, cross-tenant authorization is achieved by creating a service principal from AutoMQ's multitenant application in your tenant, then assigning the appropriate role to that service principal. For more details on this approach, see [Create a service principal for a cross-tenant application](https://learn.microsoft.com/entra/identity/enterprise-apps/create-service-principal-cross-tenant?pivots=azure-cli) and [Authorize cross-tenant access](https://learn.microsoft.com/en-us/azure/azure-signalr/signalr-howto-authorize-cross-tenant). > [!NOTE] > > In this document, references to the AutoMQ product service provider, AutoMQ service provider, and AutoMQ all specifically mean AutoMQ HK Limited. ## Procedure ### Step 1: Sign in to Azure CLI with your tenant administrator Sign in to Azure CLI using your tenant administrator identity. Replace `` with your Microsoft Entra tenant ID. ```shell theme={null} az login --tenant ``` ### Step 2: Collect your Ops Bucket information Before proceeding, gather the following information about the Ops Bucket created when you set up the AutoMQ BYOC environment. You can retrieve these values from the Azure portal or Azure CLI. | Parameter | Description | | - | - | | Subscription ID | The Azure subscription that contains the Ops Bucket resources. | | Resource Group | The resource group where the Storage Account is located. | | Storage Account | The Storage Account that hosts the Ops Bucket Blob Container. | | Blob Container | The name of the Blob Container used as the Ops Bucket. | To list your Storage Accounts and Blob Containers via Azure CLI: ```shell theme={null} # List Storage Accounts in a resource group az storage account list --resource-group --query "[].name" -o table # List Blob Containers in a Storage Account az storage container list --account-name --query "[].name" -o table ``` ### Step 3: Create a service principal for the AutoMQ operational platform Create a service principal in your tenant from AutoMQ's multitenant application. This allows the AutoMQ operational platform to authenticate in your Azure environment. Run the following command: ```shell theme={null} az ad sp create --id 123d6e96-84f4-4569-82ec-c25edb2dc696 ``` > [!WARNING] > > The `--id` value `123d6e96-84f4-4569-82ec-c25edb2dc696` is the official App ID of the AutoMQ operational platform. Do not modify this value. After the command succeeds, verify the service principal: ```shell theme={null} az ad sp show --id 123d6e96-84f4-4569-82ec-c25edb2dc696 ``` ### Step 4: Assign the Storage Blob Data Contributor role Grant the AutoMQ service principal the **Storage Blob Data Contributor** role, scoped to the Ops Bucket Blob Container. AutoMQ only receives this role on the specific Blob Container used as the Ops Bucket — no other resources are affected. Replace the placeholders with the values collected in Step 2: ```shell theme={null} az role assignment create \ --role "Storage Blob Data Contributor" \ --assignee 123d6e96-84f4-4569-82ec-c25edb2dc696 \ --scope "/subscriptions/{Your Subscription ID}/resourceGroups/{Your Resource Group}/providers/Microsoft.Storage/storageAccounts/{Your Storage Account}/blobServices/default/containers/{Your Ops Bucket Blob Container}" ``` After the command completes successfully, the Ops Bucket authorization is finished. You can proceed with cluster creation and management on the AutoMQ platform. # Set Ops Authing from Google Cloud Source: https://docs.automq.com/automq-cloud/manage-environments/manage-environment-ops-authing/set-ops-authing-from-google-cloud Enable AutoMQ to provide 24/7 monitoring by configuring Google Cloud GCS operational authorization for cross-account access, ensuring seamless data management. Referencing [Manage Environment Ops Authing▸](/automq-cloud/manage-environments/manage-environment-ops-authing), when using the AutoMQ Cloud BYOC product, the AutoMQ service provider requires users to provide the appropriate operational authorization. Users can grant cross-account access to the Ops Bucket, where AutoMQ stores logs and monitoring data, enabling AutoMQ to deliver 24/7 monitoring and governance for the customer's production environment. This document explains how to configure managed operational authorization on Google Cloud GCS. > [!NOTE] > > In this document, references to the AutoMQ product service provider, AutoMQ service provider, and AutoMQ all specifically mean AutoMQ HK Limited. ### Google Cloud Environment Authorization GCS on Google Cloud offers a web interface and simplified policy authorization. #### Console Operational Steps Log in to the cloud account that owns the Ops Bucket and switch to the corresponding Project. Then navigate to the [GCS Console](https://console.cloud.google.com/storage/browser): 1. **Navigate to the Bucket List page to find the target OpsBucket.** Access the GCS Console and click the **Bucket List** in the left navigation bar to enter the list page. Search for the operations Bucket configured in the current environment, and click on details. ![](https://mintcdn.com/automq/HveFFwfWarPtnDnE/automq-cloud/manage-environments/manage-environment-ops-authing/set-ops-authing-from-google-cloud/1.webp?fit=max\&auto=format\&n=HveFFwfWarPtnDnE\&q=85\&s=c6ef92eb8c0551c53e4855c04e22207b) 2. **Go to Permission Management > Add Authorization.** Click the add authorization button to open the form for new authorization. ![](https://mintcdn.com/automq/HveFFwfWarPtnDnE/automq-cloud/manage-environments/manage-environment-ops-authing/set-ops-authing-from-google-cloud/2.webp?fit=max\&auto=format\&n=HveFFwfWarPtnDnE\&q=85\&s=7dd73a4b90cbece4189fd5b7e824f347) 3. **Add the Bucket Authorization Policy according to the template information.** Refer to the following instructions to fill in the respective authorization information, click confirm, and complete the authorization policy creation. * **Authorized main account:** Refer to the **Authorization Principle** section of this document and select the AutoMQ service-side **service account "[automq-public-ops-authing@automq-public.iam.gserviceaccount.com](mailto:automq-public-ops-authing@automq-public.iam.gserviceaccount.com)".** * **Bound Role:** Choose the **Storage Object User** role. ![](https://mintcdn.com/automq/HveFFwfWarPtnDnE/automq-cloud/manage-environments/manage-environment-ops-authing/set-ops-authing-from-google-cloud/3.webp?fit=max\&auto=format\&n=HveFFwfWarPtnDnE\&q=85\&s=32372cc13f3a1e11ac809136720d3f9e) # Set Ops Authing from OCI Source: https://docs.automq.com/automq-cloud/manage-environments/manage-environment-ops-authing/set-ops-authing-from-oci This document describes how to configure operational authorization for AutoMQ on OCI. ## Background Information When creating a BYOC cluster, you need to authorize the AutoMQ operational platform to access your OCI Bucket for cluster maintenance operations. This document will guide you through the operational authorization process on OCI. ## Procedure You need to create a Policy in your OCI tenancy that allows the Group used by the AutoMQ operational platform to access the corresponding operational Bucket. Please refer to the following commands and replace `` with your OPS Bucket name. ```shell theme={null} Define group OpsAccessGroup as ocid1.group.oc1..aaaaaaaakauhv6pn2cmx4vrrbzysk4oeqmp2lqabjistbkgapzawnl5m74ia Define tenancy SourceTenancy as ocid1.tenancy.oc1..aaaaaaaaeufibuie3dttnycwg6h2jnfpqot6w2guvdjz2oiqseggpdpmfl7a Admit group OpsAccessGroup of tenancy SourceTenancy to read,write objects in tenancy where target.bucket.name='' ``` After completing the above steps, you can proceed with subsequent cluster creation and management operations on the AutoMQ platform. # Set Ops Tunnel for Troubleshooting Source: https://docs.automq.com/automq-cloud/manage-environments/manage-environment-ops-authing/set-ops-tunnel-for-troubleshooting AutoMQ's BYOC Ops Tunnel provides secure temporary access for troubleshooting, ensuring cloud-native scalability, Kafka compatibility, and cost efficiency. Learn setup and usage in detail. Refer to [Overview▸](/automq-cloud/manage-environments/manage-environment-ops-authing/overview). The AutoMQ BYOC environment supports Ops Tunnel, enabling environment administrators to initiate and establish a secure and trusted Ops Tunnel for temporarily granting access to AutoMQ technicians in the BYOC environment. This article explains how to use Ops Tunnel. ## Prerequisites 1. OpsTunnel utilizes the Ngrok secure proxy tunnel to provide a secure and trusted external WebSocket channel. 2. It supports temporary access to the BYOC environment for AutoMQ technical staff. 3. Using OpsTunnel only requires allowing the AutoMQ environment console to access the secure Ngrok service. For more information about Ngrok, please refer to the [Ngrok Product Introduction](https://ngrok.com/). ## Usage Process ### Enable or Disable Ops Tunnel To facilitate timely responses and resolution of potential issues by our technical support team, AutoMQ enables Ops Tunnel by default during standard deployment. This tunnel establishes a secure, encrypted connection, allowing authorized AutoMQ support engineers to access your BYOC environment for diagnostics and troubleshooting when necessary. While we recommend keeping this tunnel active to receive prompt support, you may need to temporarily or permanently disable this feature in certain scenarios. You can manually disable Ops Tunnel by following these steps: 1. **Log in to the Console**: Log in to the AutoMQ console with your environment administrator account. 2. **Navigate to Ops Tunnels**: In the main menu, locate and open the "Ops Tunnels" management page. 3. **Close the Tunnel**: On the Ops Tunnels detail page, find and click the "Close Tunnel" button. The system will prompt you for confirmation. 4. **Confirm Closure**: In the confirmation dialog, click confirm to complete the closure process. > [!CAUTION] > > **Important Note:** > > Closing the Ops Tunnel will immediately terminate all active connections and reject any new connection requests. The Ops Tunnel can be re-enabled or temporarily enabled at any time, which does not affect existing service operations. ### Inspecting Operation Audits AutoMQ environment administrators can review historical sessions and operation logs of Ops Tunnel through the operation audit function. ![](https://mintcdn.com/automq/HveFFwfWarPtnDnE/automq-cloud/manage-environments/manage-environment-ops-authing/set-ops-tunnel-for-troubleshooting/3.webp?fit=max\&auto=format\&n=HveFFwfWarPtnDnE\&q=85\&s=f817908e1efee738162056ca40e12ece) # Overview Source: https://docs.automq.com/automq-cloud/manage-environments/overview Discover the power of AutoMQ with cloud-native scalability, 100% Kafka compatibility, and cost-efficient management in both SaaS and BYOC environments. The environment is a crucial operational resource for AutoMQ Cloud. This article introduces the definition, resource model, internal attributes, classification, and usage recommendations of the AutoMQ Cloud environment. > [!NOTE] > > In this article, references to AutoMQ product service providers, AutoMQ service providers, and AutoMQ specifically refer to AutoMQ HK Limited. > [!NOTE] > > Terms such as cloud providers and Public Cloud providers mentioned in this article refer to the cloud service providers that AutoMQ Cloud relies on, as specified by the user, including AWS, Google Cloud, Azure, OCI, and Alibaba Cloud. ## Definition The environment is a logical abstract resource provided by AutoMQ Cloud, used to determine the foundational configuration information that needs to be shared at the runtime level of Kafka and to manage the actual usage of Kafka instances (clusters) in a unified manner. The environment defines information such as infrastructure type, network environment, and permission policies, and all subsequent Kafka instances are created and managed under the environment. The main roles of the environment are elaborated as follows: * It stipulates the underlying infrastructure of the Kafka service, clarifying the basic information such as the type of cloud provider, region, and permission policies of the infrastructure. * It stipulates the basic information such as the network topology, availability zone topology, and external service exposure methods of the entire control system. * Common foundational configurations across instances, such as metrics integration configurations. In a BYOC environment, all physical resources belong to the user, and the user authorizes the AutoMQ service provider to offer maintenance and management. ## Model Relationships In the domain model of AutoMQ Cloud, the environment is the top-level resource for managing product instances, as roughly illustrated below: ![](https://mintcdn.com/automq/HveFFwfWarPtnDnE/automq-cloud/manage-environments/overview/1.webp?fit=max\&auto=format\&n=HveFFwfWarPtnDnE\&q=85\&s=ee1d51dc0225344ac984ce13a6fc4952) ## Internal Attributes ### Attribute: Infrastructure Configuration Infrastructure configuration is a necessary setup for deploying AutoMQ Cloud environments, specifying the type of infrastructure, network topology, permission policies, and other configuration information. The environment console will use this configuration to deploy and manage actual Kafka clusters. ### Attribute: Integration Configuration Integration configuration abstracts configuration at the environment level for external data integration across clusters. For example, the Metrics integration configuration can support pushing Metrics data from multiple clusters within the environment to a user-defined Prometheus cluster for custom monitoring and analysis. ### Attribute: Environment Version Technically, the environment itself is a software foundation and, as such, will define multiple environment versions with the continuous iteration of the software. Upgrading the environment version generally does not affect the upper-layer product services. Users are advised to update to the latest environment version regularly to ensure defect fixes and feature optimizations. ### Attribute: Environment Status The environment status shows the various service states in the environment lifecycle. The complete lifecycle of an environment will include the following processes and states: ![](https://mintcdn.com/automq/HveFFwfWarPtnDnE/automq-cloud/manage-environments/overview/2.webp?fit=max\&auto=format\&n=HveFFwfWarPtnDnE\&q=85\&s=90a51837983310f93e1d6832070ce940) * **Creating:** The initial environment creation operation is an asynchronous process. When the creation operation is completed, the backend will asynchronously deploy the full software foundation. During this process, the user cannot make any changes until the creation is complete. * **Running:** The current environment is in an active running state, allowing normal operational use such as creating, deleting, updating, and querying internal product instances. * **Changing:** The current environment is performing operational changes, version upgrades, or other operations. Since these operations are asynchronous, any changes to the environment are prohibited until the process is complete. * **Service Exception:** The current environment is unable to provide normal services due to the execution of creation, maintenance changes, or underlying infrastructure anomalies. ## BYOC Environment ### Environment Architecture As mentioned above, the BYOC environment is maintained by the AutoMQ Cloud agent. The underlying resources belong to the user's custom cloud account under the VPC, allowing for complete data isolation and autonomous control. In this environment type, the data plane system and control plane system are as shown in the following figure: ![](https://mintcdn.com/automq/HveFFwfWarPtnDnE/automq-cloud/manage-environments/overview/3.webp?fit=max\&auto=format\&n=HveFFwfWarPtnDnE\&q=85\&s=12e1409268aaf79e96aeace146e79fa6) * **Resource Location:** The control plane system (environment console) and the data plane system (Kafka service cluster) are all deployed in the user-defined network environment. * **Network Exposure:** The environment console can be accessed via the public network by default based on user choice, or it can be restricted to private network access only. The data plane system supports only private network access. * **Maintenance Authorization:** The BYOC environment is a fully privately isolated private environment that requires user authorization for AutoMQ to perform environment maintenance (issue troubleshooting and version upgrades). * **System Observability:** The BYOC environment collects system metrics and log data through the maintenance bucket provided by the cloud providers. Users authorize AutoMQ service providers with read-only access to achieve system operation monitoring and alerting. # Upgrade Environment Version Source: https://docs.automq.com/automq-cloud/manage-environments/upgrade-environment-version Upgrade your AutoMQ BYOC environment version on AWS, Google Cloud, or Azure to receive updates and bug fixes. When using AutoMQ BYOC, users can refer to this document to upgrade the BYOC environment console version as needed to receive updates and fix bugs. > [!NOTE] > > The terms AutoMQ product service provider, AutoMQ service provider, and AutoMQ mentioned in this document specifically refer to AutoMQ HK Limited. AutoMQ BYOC environments will produce updated versions as functionalities evolve. Users can refer to the [Release Notes▸](/automq-cloud/release-notes) to view the corresponding versions and choose to upgrade the environment version. ## Upgrade Operation ### Version >= 8.0 (AWS, Google Cloud, and Azure) Starting from version 8.0, the AutoMQ environment console is installed and managed via Docker. Therefore, upgrading the version only requires updating the Docker image and restarting the container. > [!WARNING] > > Keep the Docker mount point unchanged during the upgrade. AutoMQ Console stores all its metadata in the mounted directory. Reuse the existing host directory and the same container mount path in the `-v` option. For example, if the current container uses `-v /home/admin:/root`, keep that mapping when starting the new container. Do not delete or clear the host directory, or replace it with an empty directory; the upgraded Console needs the existing metadata. **Steps** 1. **Check the version number** Go to the [Release Notes](/automq-cloud/release-notes) to confirm the target version number you wish to upgrade to. 2. **Get the installation command** Log in to the AutoMQ official website, find the metadata for your current environment, and copy the `docker run` command used for the initial installation. Before removing the old container, verify that the command uses the same mount point as the running container. Use your existing paths rather than copying the example paths if they differ. 3. **Update and restart the container** On the host machine where the console is located, stop and remove the old container, then re-run the installation command with the new version number. For example, use the existing installation command and replace only the image version. The `CONFIG` value contains the environment configuration generated for your environment. Keep the existing value unchanged. ```bash theme={null} sudo docker run -d --restart unless-stopped \ -v ${Replace with your actual host dir}:/root \ --net=host \ -e CONFIG=${Your CONFIG value} \ -e CLOUD_PROVIDER=${aws|gcp|azure} \ -e CONSOLE_INITIAL_USER=admin \ -e CONSOLE_INITIAL_PASSWORD=${Your initial password} \ /automq/automq-byoc-console:- ``` To upgrade, stop and remove the old container, then run the command again with the target image version: ```bash theme={null} sudo docker stop automq_byoc_console sudo docker rm automq_byoc_console # Run the docker command again with the target image version. ``` After the upgrade is complete, you can log back into the AutoMQ environment console to verify that the new version is active. ### Version \< 8.0 For AWS and Google Cloud environments, you can keep the 7.x upgrade procedures below. For Azure environments running 7.x, contact AutoMQ support for upgrade assistance. #### AWS If your AutoMQ BYOC environment is older than version 8.0 and was installed via Marketplace CloudFormation on AWS, then upgrading to an updated 7.x version also needs to be done via CloudFormation. > [!TIP] > > If you want to upgrade from a 7.x version to an 8.x version, please refer to the [BYOC Console Upgrade to 8.x Guide](/automq-cloud/appendix/byoc-console-upgrade-to-8.x-guide). **Steps** Log in to the cloud account associated with the Console or a sub-account with authorization capabilities, and navigate to the Marketplace Console. 1. **Go to the Marketplace to check the latest version**. Visit the [AWS Marketplace product page](https://aws.amazon.com/marketplace/pp/prodview-suwr5pyxwakrk), select the target version you wish to upgrade to; it is recommended to upgrade to the most recent 'Latest' version. ![](https://mintcdn.com/automq/HveFFwfWarPtnDnE/automq-cloud/manage-environments/upgrade-environment-version/4.webp?fit=max\&auto=format\&n=HveFFwfWarPtnDnE\&q=85\&s=4747023b955b5eee1eac60977c9294cd) 2. **Select the desired upgrade version.** Click "Launch with CloudFormation". ![](https://mintcdn.com/automq/HveFFwfWarPtnDnE/automq-cloud/manage-environments/upgrade-environment-version/5.webp?fit=max\&auto=format\&n=HveFFwfWarPtnDnE\&q=85\&s=d8f0fcf01a3c35c91122b53b3c225c83) 3. **Copy the new version's CloudFormation Template URL.** ![](https://mintcdn.com/automq/HveFFwfWarPtnDnE/automq-cloud/manage-environments/upgrade-environment-version/6.webp?fit=max\&auto=format\&n=HveFFwfWarPtnDnE\&q=85\&s=a1c90f95e44f73f8fb267991a8589e81) 4. **Go to the Stack list page and find the Stack that deploys the AutoMQ BYOC environment.** Access the CloudFormation console, click on **Stacks** in the left navigation bar to enter the list page. Search for the Stack corresponding to the current environment and click **Stack Actions**. ![](https://mintcdn.com/automq/HveFFwfWarPtnDnE/automq-cloud/manage-environments/upgrade-environment-version/7.webp?fit=max\&auto=format\&n=HveFFwfWarPtnDnE\&q=85\&s=1c082cfff2a0d12c982b970699595ce1) 5. Find the operations supported by Stack, then click **Replace existing template, create ChangeSet.** ![](https://mintcdn.com/automq/HveFFwfWarPtnDnE/automq-cloud/manage-environments/upgrade-environment-version/8.webp?fit=max\&auto=format\&n=HveFFwfWarPtnDnE\&q=85\&s=765ba96fc83e1a36531fb0828e0f2f7c) 6. Update the ImageId to the target version. For example, substitute **7.0.3 with 7.1.0**. ![](https://mintcdn.com/automq/HveFFwfWarPtnDnE/automq-cloud/manage-environments/upgrade-environment-version/9.webp?fit=max\&auto=format\&n=HveFFwfWarPtnDnE\&q=85\&s=771d1d1be95aa9718dc0a4840c4fbfc2) > [!CAUTION] > > **Warning:** > > When creating the ChangeSet, aside from the new version Template update, the following parameters cannot be changed; otherwise, the environment may become unstable: > > ExistingVPCId: After the environment is set up, the VPC cannot be altered. > > ExistingPublicSubnetId: Once the environment installation is complete, you cannot modify the subnet where the environment console resides. > > MsgBucket: Once the environment installation is complete, the MsgBucket cannot be changed. > > OpsBucket: After the installation of the environment is finalized, the OpsBucket is not alterable. ![](https://mintcdn.com/automq/HveFFwfWarPtnDnE/automq-cloud/manage-environments/upgrade-environment-version/10.webp?fit=max\&auto=format\&n=HveFFwfWarPtnDnE\&q=85\&s=2813fa40a87b2332029d462d2a7221d3) 7. **Submit changes step-by-step for a preview.** After confirming the submission, you can review the scope of resources affected by the current version upgrade. ![](https://mintcdn.com/automq/HveFFwfWarPtnDnE/automq-cloud/manage-environments/upgrade-environment-version/11.webp?fit=max\&auto=format\&n=HveFFwfWarPtnDnE\&q=85\&s=1a89bb8ff973bd22381ca956220d37c0) 8. **Confirm the execution of the ChangeSet.** Wait for the execution to complete and verify whether the upgrade results align with expectations. #### Azure For Azure environments running a 7.x version, contact AutoMQ support for upgrade assistance. #### Google Cloud In the AutoMQ BYOC environment on GCP via Marketplace installation, since Marketplace does not offer a console page for upgrades, it is advised to upgrade versions using the gcloud CLI. #### Steps 1. Locally, use the gcloud CLI to log into the cloud account linked with the environment console, or a sub-account with authorized operational capabilities. ```bash theme={null} gcloud auth login ``` 2. **Create New Version System Disk**. Check the AutoMQ version logs to determine the environment version that needs an upgrade. Use the following command as a guideline to create a system disk for the new version of the console VM. ```bash theme={null} gcloud compute disks create $disk_name \ --image projects/mpi-automq-public/global/images/automq-control-center-prod-$version-x86-64 \ --zone $zone ``` The parameter descriptions are as follows: * disk\_name: You can customize the name of the system disk. * image: The name of the image used by the system disk. Here, you need to input the corresponding value based on the version number, such as “projects/automq-public/global/images/automq-control-center-prod-**7-3-11**-x86-64”, replacing **7-3-11** with the appropriate **X.Y.Z** version number. * Zone: Enter the name of the zone where the AutoMQ console is located. 3. **Stop the AutoMQ Console Virtual Machine**. Go to the Compute Engine console and find the virtual machine named AutoMQ Console. Run the following command to power it off. ```bash theme={null} gcloud compute instances stop $instance_name --zone $INSTANCE_ZONE ``` The parameter descriptions are as follows: * instance\_name: Enter the instance name in the AutoMQ console. * Zone: Enter the name of the zone where the AutoMQ console is located. 4. **Unmount the Old System Disk**. ```bash theme={null} gcloud compute instances detach-disk ${Your VM Instance} \ --disk=${Your Original System Disk} --zone $INSTANCE_ZONE ``` The parameter descriptions are as follows: * instance\_name: Enter the instance name in the AutoMQ console. * disk: Enter the current system disk name from the AutoMQ Console. 5. **Mount the new system disk.** ```bash theme={null} gcloud compute instances attach-disk $INSTANCE_NAME \ --disk $NEW_DISK_NAME \ --zone $INSTANCE_ZONE \ --boot ``` The parameter descriptions are as follows: * instance\_name: Enter the instance name in the AutoMQ console. * disk: Enter the new system disk name from the AutoMQ Console. This is the name of the system disk created in step 1. * Zone: Enter the name of the zone where the AutoMQ console is located. 6. **Restart the AutoMQ Console.** ```bash theme={null} gcloud compute instances start $INSTANCE_NAME --zone $INSTANCE_ZONE ``` The parameter descriptions are as follows: * instance\_name: Enter the instance name in the AutoMQ console. * Zone: Enter the name of the zone where the AutoMQ console is located. 7. Once the upgrade is complete and verified to meet expectations, you can **delete the system disk of the previous version**. After deletion, rolling back to the previous version will not be possible. ```bash theme={null} gcloud compute disks delete $DISK_NAME --zone $INSTANCE_ZONE ``` The parameter descriptions are as follows: * DISK\_NAME: Enter the system disk name of the previous version in the AutoMQ console. * INSTANCE\_ZONE: Enter the name of the zone where the AutoMQ console is located. # Identity Providers and SSO Authentication Source: https://docs.automq.com/automq-cloud/manage-identities-and-access/identity-providers-and-sso-authentication AutoMQ integrates with enterprise identity providers using SAML for SSO authentication. Manage all users in one place and allow access with existing credentials. AutoMQ supports configuring enterprise identity providers using the SAML protocol, allowing you to manage and authenticate AutoMQ environment members through your existing identity provider (hereinafter referred to as Identity Provider, IdP) without needing to use AutoMQ local usernames and passwords. After enabling SSO in AutoMQ, you can manage all users in one place and allow users to log in to AutoMQ using their existing SSO credentials. ## Prerequisites The AutoMQ console by default provides an initial admin member and local member login method. To enable SSO login, the following conditions must be met: * The enterprise's IdP must support the **SAML 2.0 protocol**. AutoMQ does not support the OIDC protocol. * Enterprise IdP needs to clearly identify each unique user. * The username provided by the enterprise IdP must not conflict with member names of the AutoMQ local type. Refer to [Member Accounts▸](/automq-cloud/manage-identities-and-access/member-accounts). ## Usage Limitations When using Enterprise IdP for SSO login in the AutoMQ Console, the following limitations apply: * Each AutoMQ Console only supports the configuration of a single Enterprise IdP and does not support multiple identity sources. * After configuring the IdP, SSO is enabled by default, but the local user login method is still supported. Environment administrators can manage SSO through local login. * If the IdP is deleted, SSO is disabled by default, and existing SSO members will not be deleted and need to be manually removed. * AutoMQ does not support converting between SSO and local member types. * AutoMQ does not support the SAML Session logout protocol. ## Configuring Enterprise Identity Providers and SSO. ### Step 1: Configure AutoMQ Console Domain Name Before configuring IdP and enabling SSO login, the environment admin needs to set up the domain name for the AutoMQ console. This ensures that enterprise users can access the AutoMQ console via their browsers using the specified domain name. The configuration steps are as follows: 1. The enterprise admin clicks the **Settings** menu. 2. On the settings page, click **Add Console Domain Name**. 3. Enter the domain name, port, and protocol that the console will use to provide services to users. ![Settings page showing the Add Console Domain Name configuration form](https://mintcdn.com/automq/HveFFwfWarPtnDnE/automq-cloud/manage-identities-and-access/identity-providers-and-sso-authentication/1.webp?fit=max\&auto=format\&n=HveFFwfWarPtnDnE\&q=85\&s=bf91d455317c25c3f34826bfd1f86260) > [!TIP] > > Enterprise users who require the use of the HTTPS protocol are recommended to mount the console domain onto a front load balancing service such as ALB to complete the TLS protocol offloading. 4. Once setup is complete, conduct a connectivity test. ![Connectivity test result for the configured AutoMQ Console domain](https://mintcdn.com/automq/HveFFwfWarPtnDnE/automq-cloud/manage-identities-and-access/identity-providers-and-sso-authentication/2.webp?fit=max\&auto=format\&n=HveFFwfWarPtnDnE\&q=85\&s=f9a0d947106f3acfe9b98c143572a301) ### Step 2: Obtain SP Information from the AutoMQ Console An AutoMQ environment administrator (a member authorized with the environment administrator role) should view the AutoMQ SP information and provide it to the enterprise IdP administrator. Follow these steps: 1. Click on the **Access and Control** section in the navigation bar. Then click **Add IdP**. 2. **Select Console External Domain**. 3. View the identity information of the AutoMQ console as a Service Provider (SP). Submit the SP information to the enterprise IdP administrator for entry. The administrator can manually copy the information or download the metadata file directly. 1. **SP EntityID:** A unique identifier for the AutoMQ console. 2. **Assertion Consumer Service URL:** The ACS URL is the unique address where AutoMQ, as an SP, receives SAML Responses, and it needs to be configured on the IdP. 3. **AutoMQ SP Certificate:** The certificate used to declare AutoMQ's signed requests. ![AutoMQ Console SP information panel showing SP EntityID, ACS URL, and SP certificate](https://mintcdn.com/automq/HveFFwfWarPtnDnE/automq-cloud/manage-identities-and-access/identity-providers-and-sso-authentication/3.webp?fit=max\&auto=format\&n=HveFFwfWarPtnDnE\&q=85\&s=cecbf359ad50aeaf0a4b077e1f22ff07) ### Step 3: Configure AutoMQ Service in Enterprise IdP After obtaining the SP information in Step 2, the enterprise IdP administrator needs to configure the SP information of the AutoMQ console into the IdP service. The operations for this step vary depending on the IdP service. Below are common configuration methods for IdP. > [tab] Auth0 > > 1. Log in to the [Auth0 account](https://manage.auth0.com/). > > 2. Select **Applications**. > > 3. Click **Create Application**. > > 4. Enter the application name. > > 5. Select **Regular Web Applications** and click **Create.** > > 6. Once the application is created, navigate to the Addons settings page to enable SAML2.0 configuration. > > 7. Click on the **SAML 2 WEB APP** option to open the settings page, and configure the following parameters: > > 1. In the **Application Callback URL** parameter box, set the **ACS URL** obtained from the AutoMQ console. > > 8. Click **Enable** and save. > > 9. On the **Usage Tab** page, record the **Identity Provider Login URL**, **Issuer URN**, and **Identity Provider Certificate** information for use in Step 4 for IdP information entry. > [tab] OKTA > > 1. In the Okta admin console, navigate to **Applications**. > > 2. Click **Add Application** to start creating a custom application. > > 3. Select the **SAML 2.0** application type. > > 4. Enter **App Name**, and click Next. > > 5. Configure the SP-related parameters according to the instructions below, and click Next. > > 1. Single sign-on URL: Enter the ACS URL provided by the SP from the second step. > > 2. Audience URI (SP Entity ID): Enter the SP Entity ID provided by the SP from the second step. > > 3. Name ID format: Fill in the unique identifier field according to your organization's standards, with the email address being the recommended option. > > 4. Application username: According to the enterprise standard, fill in the unique identifier field. It is recommended to use the OKTA username. > > ![Okta SAML application configuration showing single sign-on URL and Audience URI fields](https://mintcdn.com/automq/HveFFwfWarPtnDnE/automq-cloud/manage-identities-and-access/identity-providers-and-sso-authentication/4.webp?fit=max\&auto=format\&n=HveFFwfWarPtnDnE\&q=85\&s=5baec243c7f4e561bbcce306bfbb4812) > > 6. Click "Finish" to complete the SP entry. Click to download the metadata configuration file, which will be used to complete the IdP information in Step 4. > > > [!TIP] > > > > **Note:** > > > > After creating a new application in OKTA, users who have not been assigned to this OKTA application by default cannot use the AutoMQ application. Therefore, it is recommended to allocate the application to relevant users based on requirements. > [tab] Microsoft Entra ID > > 1. Sign in to the [Microsoft Entra admin center](https://entra.microsoft.com/) as at least a Cloud Application Administrator. > > 2. Go to **Identity** > **Applications** > **Enterprise applications**, and select **New application**. > > 3. Select **Create your own application**, enter an application name, select **Integrate any other application you don't find in the gallery (Non-gallery)**, and then select **Create**. > > 4. On the application overview page, select **Single sign-on**, and then select **SAML**. > > 5. In **Basic SAML Configuration**, select **Edit** and configure the following parameters with the SP information obtained in Step 2 (Obtain SP Information from the AutoMQ Console): > > 1. **Identifier (Entity ID):** Enter the AutoMQ **SP EntityID**. > > 2. **Reply URL (Assertion Consumer Service URL):** Enter the AutoMQ **ACS URL**. > > 3. **Sign on URL (Optional):** Enter the external URL of the AutoMQ console. > > 6. In **Attributes & Claims**, configure **Unique User Identifier (Name ID)**. `user.userprincipalname` or `user.mail` is recommended. Find the `emailaddress` claim and note its complete Claim URI. Use this URI for both user mapping fields in Step 4. > > 7. In **SAML Certificates**, download **Federation Metadata XML**. You can upload this file directly when entering the IdP information in the AutoMQ console in Step 4. > > If you enter the IdP information manually, copy **Microsoft Entra Identifier** and **Login URL** from **Set up \**, and download **Certificate (Base64)** from **SAML Certificates**. > > 8. Go to **Users and groups**, select **Add user/group**, and assign the users or groups that are allowed to access AutoMQ. > > > [!TIP] > > > > Microsoft Entra ID blocks sign-in for users who are not assigned to the enterprise application when **Assignment required?** is enabled. Assign at least one test user before verifying SSO, and keep a local AutoMQ environment administrator account available until the SSO configuration has been validated. ### Step 4: Complete IdP Entry in the AutoMQ Console After configuring the enterprise IdP, the IdP information needs to be recorded in the AutoMQ console to complete the connection. The AutoMQ console supports manual entry and direct upload of metadata files. The required information is as follows: * **IdP Alias:** This is used to distinguish the information of the IdP. It supports English and Chinese letters, numbers, hyphens, and underscores, with a length limit of 3-64 characters. * **IdP Entity ID:** This is the unique identifier used to recognize the IdP. * **IdP SSO URL:** This is the unique login address assigned by the IdP to the AutoMQ console. * **IdP Certificate:** This is the certificate information used by the IdP to sign and encrypt SAML responses. * **UserID Mapping (Optional):** AutoMQ extracts the unique user ID attribute from the SAML response. If not set, the default value will be used. * **UserName Mapping (Optional):** AutoMQ extracts the displayed environment member name attribute from the SAML response. If not set, it will be the same as UserID. * **Session Expiration Time Mapping (Optional):** AutoMQ extracts the session expiration time attribute from the SAML response. If not set, it will default to 6 hours. ![IdP entry form in AutoMQ Console for configuring IdP alias, entity ID, SSO URL, and certificate](https://mintcdn.com/automq/HveFFwfWarPtnDnE/automq-cloud/manage-identities-and-access/identity-providers-and-sso-authentication/5.webp?fit=max\&auto=format\&n=HveFFwfWarPtnDnE\&q=85\&s=9fe636a817f881e84583a4dd2b11b1f4) > [!WARNING] > > **Microsoft Entra ID:** When adding the identity provider, expand **Advanced Configurations (Optional)**. You must configure both **User ID Mapping** and **User Name Mapping**, even though the section is labeled optional. Set both fields to the complete `emailaddress` Claim URI: > > ```text theme={null} > http://schemas.xmlsoap.org/ws/2005/05/identity/claims/emailaddress > ``` > > To find this URI in Azure / Microsoft Entra, open the enterprise application configured for AutoMQ, then go to **Single sign-on** > **Attributes & Claims**. Copy the complete Claim URI for `emailaddress`, including its namespace. Do not enter only `emailaddress` or the source attribute, such as `user.mail`. > > **Session Expiration Mapping** remains optional. Advanced attribute field settings are as follows: ![Advanced attribute mapping settings for UserID, UserName, and session expiration time](https://mintcdn.com/automq/HveFFwfWarPtnDnE/automq-cloud/manage-identities-and-access/identity-providers-and-sso-authentication/6.webp?fit=max\&auto=format\&n=HveFFwfWarPtnDnE\&q=85\&s=4d268f490ad9adbf2ce2989f868fefb9) ### Step Five: SSO User Login Once IdP input and SSO configuration are complete, the AutoMQ console can be accessed using SSO login. ![AutoMQ Console login screen with SSO login option](https://mintcdn.com/automq/HveFFwfWarPtnDnE/automq-cloud/manage-identities-and-access/identity-providers-and-sso-authentication/7.webp?fit=max\&auto=format\&n=HveFFwfWarPtnDnE\&q=85\&s=b4e8d68a4823f9cc7ab3dbe03c719641) > [!TIP] > > **Note:** > > When a new user logs in directly using SSO, they will, by default, have no permissions to operate within the environment and will require authorization from an environment administrator to access specific resources. > > Environment administrators can also pre-create SSO members and assign predefined roles to them, allowing these SSO members to operate the console normally upon subsequent logins. # Member Accounts Source: https://docs.automq.com/automq-cloud/manage-identities-and-access/member-accounts Manage environment members in AutoMQ Cloud. Each environment has an isolated account system to prevent permission leaks across environments. Refer to [Overview▸](/automq-cloud/manage-identities-and-access/overview), users need to log into the environment console to use the product. This article describes how to create and manage environment members in the AutoMQ Cloud edition. ## Environment Members Each AutoMQ environment can be independently accessed, with a separate account system within each environment to manage the resources. * Environment members are completely isolated between different environments to prevent confusion and permission leaks. * Environment members are not associated with cloud provider accounts and are mutually independent. ### Initial Environment Members Refer to [Overview▸](/automq-cloud/manage-identities-and-access/overview), when an environment is created for the first time, the system automatically initializes and creates an Admin role member for the current environment. > [!NOTE] > > The initial Admin member's username is admin, and the default password varies depending on the cloud provider environment. It is recommended to change the initial default password after logging in. The method to obtain the initial password varies depending on the cloud provider environment. Refer to the documentation below. > [tab] Deploy using Docker > > In an AWS environment, starting from version 8.0, deploying the BYOC environment using a Docker installation package is supported. The initial username and password are freely specified by the installer at startup. ## Login Environment The environment administrator records the domain name of the environment console and distributes it to all environment members. Environment members can log in directly by entering their account information. 1. Open the environment console address in a browser. This address is provided by the environment administrator from the deployment system. 2. Enter the environment member's username and password to log in. 3. For the first login, if using a system-generated password, it is recommended to change it to a custom password as soon as possible. ![AutoMQ Console login screen with username and password fields](https://mintcdn.com/automq/HveFFwfWarPtnDnE/automq-cloud/manage-identities-and-access/member-accounts/3.webp?fit=max\&auto=format\&n=HveFFwfWarPtnDnE\&q=85\&s=a81279da3992a739bc8db5e39cd54b72) ## Create Environment Members Using the AutoMQ Cloud environment console, environment members with the Admin role can create new member accounts to share the environment. The steps to create environment members are as follows: 1. Admin role environment members enter the environment. 2. Click on the "Members" button in the left navigation bar to access the member list. 3. Click "Add Member," select the type of member account, enter the member's username, choose the role to assign, and click "Add." 1. **Local Type:** The local type is the default member account type, using a static username and password for login authentication. 2. **SSO Type:** The SSO type needs to cooperate with an enterprise identity service provider, using SSO for login, and does not support username and password login. 4. The system will return the new member's username and default password. ![Add Member dialog in AutoMQ Console showing member type, username, and role selection](https://mintcdn.com/automq/HveFFwfWarPtnDnE/automq-cloud/manage-identities-and-access/member-accounts/4.webp?fit=max\&auto=format\&n=HveFFwfWarPtnDnE\&q=85\&s=6ce718074d8c0069743f9c29085d1528) > [!TIP] > > To create an SSO environment member, you must first configure the enterprise identity provider (IDP) and ensure the SSO integration is completed. ## Modifying Environment Members Admin role environment members can manage environment members at any time through the environment console, including modifying member permission roles and deleting environment members. The steps are similar to adding members. # Overview Source: https://docs.automq.com/automq-cloud/manage-identities-and-access/overview AutoMQ Cloud offers scalable, Kafka-compatible message queues with identity recognition and RBAC permissions, ensuring secure account access for both members and services. AutoMQ Cloud supports identity recognition and RBAC (Role-Based Access Control) permissions. This article introduces the basic concepts of accounts in the AutoMQ Cloud product system. ## Account Types AutoMQ Cloud offers two types of accounts: **Member Account** and **Service Account**. Their definitions and differences are as follows: | **Account Type** | **Roles and Differences** | | - | - | | **Member Account** |
  • **Scenario:** A Member Account corresponds to an individual, typically held and used by a company employee.
  • **Access:** Access AutoMQ Cloud through the environment console WebUI.
  • **Identity Recognition:** Username and password login authentication.
| | **Service Account** |
  • **Scenario:** A Service Account is used only for applications and API integration, generally configured within application code.
  • **Access:** Service Accounts typically access AutoMQ Cloud via APIs, Terraform, etc.
  • **Identity Recognition:** Access Key Id and Secret Access Key, verified through signature.
| ## Member Account ### Definition Member accounts are system-generated by default, manually created by existing environment members, or automatically created through enterprise SSO login, serving as credentials for environment-level operations. Member accounts support multiple roles based on the required permission scope, including Admin, Operator, and Viewer roles. ### Creation Method * **Local Type:** The initial Admin member of each environment is automatically created by the system upon environment creation. Subsequent members can be manually created by Admin members. * **SSO Type:** AutoMQ supports configuring enterprise Identity Provider (IDP) services. Environment members of the SSO type are created through SSO login. ### Relationship Between Environment and Environment Members When a new environment is created, the system will automatically initialize and create an Admin role member for the current environment. Subsequent members are then created by the initial Admin member. ![Diagram showing the relationship between AutoMQ Cloud environments and environment members](https://mintcdn.com/automq/HveFFwfWarPtnDnE/automq-cloud/manage-identities-and-access/overview/1.webp?fit=max\&auto=format\&n=HveFFwfWarPtnDnE\&q=85\&s=1bef1d685cd5c99277fd3d65d91cf3aa) ## Service Account ### Definition Service accounts are provided by AutoMQ Cloud for external systems to access AutoMQ via APIs and application integration. Service accounts do not have login passwords and cannot be operated through the WebUI. ### Creation Method Service accounts can be created by member accounts in the AutoMQ Console or via API. ## RBAC Permission Control AutoMQ Cloud includes both **member accounts** and **service accounts**, and both support RBAC (Role-Based Access Control). The system comes with several predefined permission roles, each offering different scopes of operational permissions. An Admin role account conducts authorization operations, assigning roles to other accounts. For information on RBAC control, please refer to the document [Role-Based Access Control▸](/automq-cloud/manage-identities-and-access/role-based-access-control). # Role-Based Access Control Source: https://docs.automq.com/automq-cloud/manage-identities-and-access/role-based-access-control AutoMQ's Role-Based Access Control (RBAC) system ensures fine-grained, least-privilege permissions for secure, stable resource management in a cloud-native Kafka-compatible environment. AutoMQ supports Role-Based Access Control (RBAC), providing fine-grained permission management to ensure that member accounts and service accounts can access necessary resources with the principle of least privilege. Through RBAC, environment administrators can effectively manage and control access to AutoMQ resources, ensuring system security and stability. ### RBAC Principles The core principle of RBAC is to bind predefined roles to member accounts and service accounts. Each role contains a set of predefined permissions that determine the actions an account can perform. This approach allows administrators to flexibly assign and manage permissions, ensuring users can only access and operate on the resources they are authorized to. ### Appendix: Predefined System Roles AutoMQ provides a series of built-in roles, each corresponding to different levels of permissions to meet the needs of various scenarios. Below is a list of the built-in roles supported by AutoMQ along with their operation lists:
Role Action Permission Level and Applicable Scenarios
InstanceViewer Instance:ListInstances
  • Role Description: Instance Viewer Role
  • Permission Scope: Read-only access to specified instances within the environment (excluding message viewing).
Instance:GetInstance
Instance:GetInstanceMetadata
Instance:ListInstanceACLPolicies
Instance:ListInstanceACLUsers
ConsumerGroup:ListConsumerGroups
ConsumerGroup:GetConsumerGroup
Topic:GetTopic
Topic:ListTopics
Profile:GetDeployProfile
Profile:ListDeployProfiles
KafkaLinking:ListKafkaLinks
KafkaLinking:GetKafkaLink
InstanceDeveloper Instance:GetInstance
  • Role Description: Instance Developer
  • Permission Scope: Access to specified instances within the environment and management of resources like Topic and Group within the instance. Instance developers cannot perform instance configuration changes, upgrades, etc.
Instance:ListInstances
Instance:ListInstanceACLPolicies
Instance:CreateInstanceACLPolicy
Instance:DeleteInstanceACLPolicy
Instance:GetInstanceMetadata
Instance:ListInstanceACLUsers
Instance:CreateInstanceACLUser
Instance:DeleteInstanceACLUser
ConsumerGroup:ListConsumerGroups
ConsumerGroup:CreateConsumerGroup
ConsumerGroup:GetConsumerGroup
ConsumerGroup:UpdateConsumerGroup
ConsumerGroup:DeleteConsumerGroup
Topic:ListTopics
Topic:CreateTopic
Topic:GetTopic
Topic:DeleteTopic
Topic:UpdateTopic
Topic:CreateMessage
Profile:GetDeployProfile
Profile:ListDeployProfiles
Environment:GetMessage
InstanceAdmin Instance:GetInstance
  • Role Description: Instance Admin Role
  • Permission Scope: Access to view, modify, and delete specified instances within the environment.
Instance:ListInstances
Instance:UpdateInstance
Instance:GetInstanceMetadata
Instance:DeleteInstance
Instance:UpdateInstanceIntegration
Instance:ListInstanceACLUsers
Instance:CreateInstanceACLUser
Instance:DeleteInstanceACLUser
Instance:ListInstanceACLPolicies
Instance:CreateInstanceACLPolicy
Instance:DeleteInstanceACLPolicy
ConsumerGroup:ListConsumerGroups
ConsumerGroup:CreateConsumerGroup
ConsumerGroup:GetConsumerGroup
ConsumerGroup:UpdateConsumerGroup
ConsumerGroup:DeleteConsumerGroup
Topic:CreateTopic
Topic:GetTopic
Topic:DeleteTopic
Topic:UpdateTopic
Topic:ListTopics
Topic:CreateMessage
Profile:GetDeployProfile
Profile:ListDeployProfiles
Environment:GetMessage
Integration:ListIntegrations
Integration:ListIntegrationTypes
KafkaLinking:CreateKafkaLink
KafkaLinking:ListKafkaLinks
KafkaLinking:GetKafkaLink
KafkaLinking:DeleteKafkaLink
IntegrationAdmin Integration:UpdateInstanceIntegration
  • Role Description: Integration Administrator
  • Permission Scope: Access and edit specified integrations within the environment.
Integration:ListIntegrations
Integration:GetIntegration
Integration:UpdateIntegration
Integration:DeleteIntegration
Integration:ListIntegrationTypes
Profile:ListDeployProfiles
Profile:GetDeployProfile
EnvironmentViewer Instance:GetInstance
  • Role Description: Environment Read-Only Member Role
  • Permission Scope: Read-only access to instance resources within the environment; cannot manage the environment or other members (excluding message viewing).
    • Instance Viewing
    • Integration Viewing
Instance:ListInstances
Instance:ListInstanceACLPolicies
Instance:GetInstanceMetadata
Instance:ListInstanceACLUsers
ConsumerGroup:ListConsumerGroups
ConsumerGroup:GetConsumerGroup
Topic:ListTopics
Topic:GetTopic
Integration:ListIntegrations
Integration:GetIntegration
Integration:ListIntegrationTypes
Migration:ListMigrations
Migration:GetMigration
Profile:ListDeployProfiles
Profile:GetDeployProfile
Environment:ListProductVersions
Environment:ListProviders
Environment:ListRegions
Environment:ListZones
Environment:ListSubnets
Environment:ListNodeGroups
Environment:GetNodeGroup
Environment:GetEnvironment
KafkaLinking:ListKafkaLinks
KafkaLinking:GetKafkaLink
EnvironmentOperator Instance:GetInstance
  • Role Description: Environment Operator Member Role
  • Permission Scope: Write access to instance resources within the environment; cannot manage the environment or other members:
    • Integration Management
    • Instance Management
Instance:ListInstances
Instance:ListInstanceACLPolicies
Instance:CreateInstanceACLPolicy
Instance:DeleteInstanceACLPolicy
Instance:CreateInstance
Instance:UpdateInstance
Instance:DeleteInstance
Instance:GetInstanceMetadata
Instance:UpdateInstanceIntegration
Instance:ListInstanceACLUsers
Instance:CreateInstanceACLUser
Instance:DeleteInstanceACLUser
Topic:ListTopics
Topic:CreateTopic
Topic:GetTopic
Topic:DeleteTopic
Topic:UpdateTopic
Topic:CreateMessage
ConsumerGroup:ListConsumerGroups
ConsumerGroup:CreateConsumerGroup
ConsumerGroup:GetConsumerGroup
ConsumerGroup:UpdateConsumerGroup
ConsumerGroup:DeleteConsumerGroup
Integration:ListIntegrations
Integration:CreateIntegration
Integration:GetIntegration
Integration:UpdateIntegration
Integration:DeleteIntegration
Integration:ListIntegrationTypes
Migration:CreateMigration
Migration:UpdateMigration
Migration:ListMigrations
Migration:GetMigration
Migration:DeleteMigration
Profile:ListDeployProfiles
Profile:GetDeployProfile
Profile:CreateDeployProfile
Profile:UpdateDeployProfile
Profile:DeleteDeployProfile
Environment:CreateProductVersion
Environment:GetDeploymentOrder
Environment:ListProductVersions
Environment:ListProviders
Environment:ListRegions
Environment:ListZones
Environment:ListSubnets
Environment:ListNodeGroups
Environment:GetNodeGroup
Environment:GetMessage
Environment:DeleteEndPoint
Environment:CreateEndPoint
KafkaLinking:CreateKafkaLink
KafkaLinking:ListKafkaLinks
KafkaLinking:GetKafkaLink
KafkaLinking:DeleteKafkaLink
EnvironmentAdmin All
  • Role Description: Environment Administrator
  • Permissions: Has full operational access to all resources within the environment, including but not limited to:
    • Manage Members
    • Manage Integrations
    • Manage Instances
By utilizing built-in roles and their corresponding operations, administrators can flexibly manage permissions in the AutoMQ console, ensuring both system security and efficiency. # Service Accounts Source: https://docs.automq.com/automq-cloud/manage-identities-and-access/service-accounts Create and manage service accounts in AutoMQ Cloud for API and Terraform access. Service accounts are fully isolated between environments and independent of cloud provider accounts. Refer to [Overview▸](/automq-cloud/manage-identities-and-access/overview), to manage environment resources through APIs, Terraform, or other methods, you must first create a service account. This article provides instructions for creating and managing service accounts in AutoMQ Cloud. ## Service Account Each AutoMQ environment is managed independently, with a separate account system within each environment to manage resources specific to that environment. * Service accounts are completely isolated between different environments to prevent confusion and permission leaks. * There is no association between service accounts and cloud vendor accounts; they are entirely independent. ## Create a Service Account Using the AutoMQ Cloud environment console, members with an Admin role can create service accounts. The steps to create a service account are as follows: 1. An environment member with an Admin role accesses the environment. 2. Click the **Service Accounts** button in the left navigation bar to enter the **Service Accounts List**. 3. Click **Create Service Account**, enter the service account alias, choose the assigned permission role, and then click **Create**. 4. The system will provide the **AccessKey** information for the service account, which users need to download and save securely. > [!TIP] > > The Access Key information for the service account is only available for download at the time of creation and cannot be modified or viewed later. Users should keep it safe to prevent leaks and loss. ## Modifying a Service Account Members with Admin role privileges can access the environment console at any time to manage service accounts, including modifying the authorized role of the service account or deleting the service account. The steps for these actions are similar to those for creating an account. # Manage Consumer Groups Source: https://docs.automq.com/automq-cloud/managing-automq/manage-consumer-groups Manage Consumer Groups in AutoMQ: view, modify, reset consumption offsets, and delete consumer groups in a Kafka-compatible, cloud-native environment. This article introduces the basic concepts of Consumer Groups, relevant constraints, and operations related to viewing, modifying, and deleting Consumer Groups. ## Consumer Group Referencing the domain model of Apache Kafka®, a Consumer Group is a load balancing grouping in the Kafka system that handles multiple consumers with consistent consumption behavior. Unlike a Consumer, a Consumer Group is not a running entity but a logical resource. In Kafka, horizontal scalability of consumption performance and high availability disaster recovery are achieved by initializing multiple consumers within a consumer group. ## Viewing Consumer Group Details ### Procedure 1. Log in to the environment console, click **Instance List** in the left navigation bar. Then, in the instance list, click the target instance name to enter the instance's internal functions. 2. In the left navigation bar, click on **Consumer Groups**, then find the target Consumer Group on the **Consumer Groups** page. 3. Click on the target Consumer Group to view summary information, client connection information, subscription relationships, consumption progress, and related Metrics data. ## Reset Consumption Offset You can reset the consumption offset to clear accumulated or unwanted messages before resuming consumption. Alternatively, you can jump to a specific time point to consume messages from that point onwards, regardless of whether messages before that time point have been consumed. > [!NOTE] > > When resetting the consumption offset, the corresponding Consumer Group must be in an Empty state, meaning the Consumer must be offline. ### Procedure 1. Locate the Consumer Group whose consumption offset needs to be reset, and click on **Reset Offset** on its **Details Page**. 2. Choose from the following options based on actual needs: 1. Reset based on relative time: last 5 minutes, last 1 hour, last 24 hours 2. Reset progress based on a specific time point: custom timestamp 3. Reset by relative position: latest offset, earliest offset 4. Reset by specified offset: custom offset ## Delete Consumer Group After deleting a Consumer Group, all consumers under the Consumer Group may be unable to consume messages, and the previous state data cannot be restored. Therefore, you must first confirm that the business no longer uses it and ensure that the Consumer Group is in a Dead or Empty state. ### Procedure 1. Log in to the environment console, click **Instance List** in the left navigation bar. Then, in the instance list, click the target instance name to enter the instance's internal functions. 2. In the left navigation pane, click **Consumer Group**, and then find the target Consumer Group on the **Consumer Group** list page. 3. Click the action button on the right, click delete, and complete the secondary confirmation to delete. # Manage Instances Source: https://docs.automq.com/automq-cloud/managing-automq/manage-instances Create, view, scale, upgrade, and delete AutoMQ BYOC (Bring Your Own Cloud) instances. An AutoMQ instance is the top-level data plane resource and corresponds to an independent Apache Kafka® cluster. ## Instance lifecycle ![](https://mintcdn.com/automq/HveFFwfWarPtnDnE/automq-cloud/managing-automq/manage-instances/1.webp?fit=max\&auto=format\&n=HveFFwfWarPtnDnE\&q=85\&s=4ea95654ae3610d28d28b8688f41a96c) * **Creating:** AutoMQ is provisioning cloud resources and deploying the instance. Configuration changes are unavailable until creation completes. * **Running:** The instance can serve Kafka client requests and management APIs. * **Modifying:** AutoMQ is applying a configuration change or version upgrade. Additional changes are unavailable until the operation completes. * **Service Exception:** The instance cannot provide normal service because instance deployment, a change operation, or underlying infrastructure failed. * **Deleting:** AutoMQ is deleting the instance and releasing its managed resources. The instance no longer accepts client traffic. * **Deleted:** The instance and its managed resources have been released. The instance cannot be recovered. ## Create an Instance 1. Sign in to the AutoMQ Console. 2. In the navigation pane, choose **Instances**, and then choose **Create Instance**. 3. If prompted, select the Deployment Profile for the instance. 4. Follow the wizard to configure the instance settings, capacity, additional settings, and IAM permissions. The wizard displays only the settings supported by the selected environment and AutoMQ version. 5. Review the configuration and choose **Create**. 6. Wait until the instance status is **Running**. ## View an Instance On the **Instances** page, choose the instance name. The details page displays status, endpoints, capacity, network, security, configuration, metrics, and related resources. ![](https://mintcdn.com/automq/HveFFwfWarPtnDnE/automq-cloud/managing-automq/manage-instances/2.webp?fit=max\&auto=format\&n=HveFFwfWarPtnDnE\&q=85\&s=e0aebe254ad0b368b7d52d3c7d1b7bb2) ## Scale an Instance 1. Open the instance details page. 2. Choose **Change Configuration**. 3. Update the capacity settings and confirm the change. 4. Wait until the instance returns to **Running**. ![](https://mintcdn.com/automq/HveFFwfWarPtnDnE/automq-cloud/managing-automq/manage-instances/3.webp?fit=max\&auto=format\&n=HveFFwfWarPtnDnE\&q=85\&s=4798760413433d0dbc46bdf91600621b) ## Upgrade an Instance Review [Release Notes](/automq-cloud/release-notes) before upgrading. The AutoMQ Console must support the target instance version; if required, first follow [Upgrade Environment Version](/automq-cloud/manage-environments/upgrade-environment-version). 1. Open the instance details page. 2. Choose **Upgrade** when a target version is available. 3. Review the target version and confirm the rolling upgrade. > [!TIP] > > AutoMQ performs instance upgrades as rolling operations. Monitor application error rates and latency throughout the change. ## Delete an Instance On the **Instances** page, open the actions menu for the instance, choose **Delete**, and confirm the operation. > [!WARNING] > > Deleting an instance cannot be undone. Verify the instance name before you confirm the operation. # Manage Topics Source: https://docs.automq.com/automq-cloud/managing-automq/manage-topics Learn how to create, view, modify, and delete Kafka-compatible topics in AutoMQ. Covers topic creation, message queries, and safe deletion practices. This article introduces the basic concepts of Topics, related constraints, and operations for creating, viewing, modifying, and deleting Topics. ## Creating a Topic ### Operation Steps 1. Log in to the environment console and click **Instance List** in the left navigation bar. Then, in the instance list, click the target instance name to access the instance's internal functions. 2. Click **Topic** in the left navigation bar, then click **Create New Topic** on the **Topic** list page. 3. On the **Create New Topic** form page, enter the name, number of partitions, and message cleanup policy, then click **OK** to complete the creation. > [!NOTE] > > If the instance has automatic Topic creation enabled, Topic creation will be automatically triggered when producing or subscribing to messages. It is recommended to use the console or the Kafka Admin API for Topic management in a production environment to avoid the risk of uncontrolled automatic creation. ## Viewing Topic Details ### Operation Steps 1. Log in to the environment console and click **Instance List** in the left navigation bar. Then, in the instance list, click the target instance name to access the instance's internal functions. 2. Click **Topics** in the left navigation bar, then locate the target Topic on the **Topic** list page. 3. Click the target Topic to enter its details and view overview information, subscription information, and related metrics data. ## Message Query AutoMQ supports querying messages directly from the console. The query conditions and parameters are as follows: * By Relative Time: When multiple partitions are selected, it supports querying messages by relative time. * By Relative Offset: When a single partition is selected, you can specify the offset to query messages. ### Operation Steps 1. Log in to the environment console and click **Instance List** in the left navigation bar. Then, in the instance list, click the target instance name to access the instance's internal functions. 2. Click **Topics** in the left navigation bar, then locate the target Topic on the **Topic** list page. 3. Click on the target Topic to enter the Topic details, then click on Message Query and input the relevant filter conditions to query the message list. ## Delete Topic After deleting the Topic, all messages and configurations within the Topic will be cleared and cannot be recovered. Therefore, it is crucial to confirm that the business no longer requires it. > [!NOTE] > > If the instance has automatic Topic creation enabled, the Topic will be re-created automatically when producing or subscribing to messages. For production environments, it is recommended to use the console or Kafka Admin API for Topic management to avoid the risk of uncontrolled automatic creation. ### Operation Steps 1. Log in to the environment console and click **Instance List** in the left navigation bar. Then, in the instance list, click the target instance name to access the instance's internal functions. 2. Click **Topics** in the left navigation bar, then locate the target Topic on the **Topic** list page. 3. Click the action button on the right, select delete, and confirm the deletion to complete. # Executing Migration Source: https://docs.automq.com/automq-cloud/migrate-to-automq/executing-migration From Apache Kafka to AutoMQ: Migrate data without loss and maintain consumption progress. Also ensure a smooth transition for producers and consumers, achieving efficient data migration. With the [Prerequisites▸](/automq-cloud/migrate-to-automq/prerequisites) completed, you can proceed with the subsequent migration process. This document provides a detailed overview of the strategies and implementation procedures for migrating from Apache Kafka to AutoMQ. Before starting a production migration, review the [Kafka Linking best practices](/automq-cloud/migrate-to-automq/kafka-linking-best-practices) and incorporate the applicable endpoint, client cutover, offset, promotion, and rollback checks into your migration runbook. ## Migration plan Using Kafka Linking to migrate from Apache Kafka® to AutoMQ, the following tasks should be considered: * **Message data synchronization**: Kafka stores historical data of both consumed and unconsumed messages. Migrating clusters must ensure that message data is replicated to the new cluster as needed, without losing any messages. * **Producer switching**: In addition to data synchronization, the migration process requires switching producer applications at an appropriate time so that producers connect to the target cluster to produce new messages. * **Consumer switching**: In addition to data synchronization, the migration process requires switching consumer applications at an appropriate time so that consumers connect to the target cluster and continue consuming messages from the previous consumption progress. Refer to the following flowchart for the overall migration plan: ![Overall migration plan flowchart showing message data sync, producer switch, and consumer switch steps](https://mintcdn.com/automq/6t03b99H9kP_jCZq/automq-cloud/migrate-to-automq/executing-migration/1.webp?fit=max\&auto=format\&n=6t03b99H9kP_jCZq\&q=85\&s=be1f3bb4dfa5d1b5c0eb3b34975a2db4) ## Steps ### Step 1: Create a Kafka Link and start synchronizing data After completing the [Prerequisites▸](/automq-cloud/migrate-to-automq/prerequisites), the source cluster, target cluster, and the scope of Topics and Consumer Groups to be migrated have been clearly defined. The next step is to start creating the migration task. Create a **Kafka Link** by clicking on **Target Instance >> Kafka Links** and filling in the relevant parameters as guided. | **Parameter Name** | **Description** | | - | - | | **Kafka Link Id** |
  • Meaning: Used to represent a group of migration tasks, generally recommended to be a short and recognizable name.
  • Constraint: Supports only English uppercase and lowercase letters, numbers, hyphens (-), and underscores (\_).
| | **Source Cluster** | Specify the source cluster to be migrated. Here, fill in the Bootstrap address and ACL identity parameters of the source cluster. | | **Target Cluster** | Specify the target cluster for the migration. Here, select the already created AutoMQ instance. | | **Starting Sync Position** | Specifies the initial synchronization position after the migration task starts. The following options are supported:
  • **From Latest Position:** Kafka Linking only replicates new messages generated subsequently to the target cluster. This mode is suitable for cold read sensitivity scenarios where migration needs to catch up with both clusters from the current moment.
| | **Sync Topic List** | Select Source Topics from the source cluster. Kafka Linking creates a one-to-one mapped Mirror Topic in the target instance. The target instance must not already contain a Topic with the same name. | | **Sync Consumer Group List** | Select several Consumer Groups from the source cluster. Kafka Linking will create a one-to-one mapped Consumer Group on the target instance. | The console builds the candidate lists from the source cluster's Kafka APIs. After you enter a search keyword, the console matches resource names by containment. For example, `order` matches `prod-order-v1`. Each search displays up to 100 matching resources. The following filters also apply: * **Source Topic:** Includes Topics visible to the Kafka Linking source identity that are not identified as internal Topics. Excludes Topics marked as internal in Kafka metadata and Topic names that start with `__` or `.`, or end with `-internal` or `.internal`. * **Source Consumer Group:** Includes Groups visible to the Kafka Linking source identity whose `protocolType` is `consumer` or empty and whose Group IDs do not match a product-internal prefix. Excludes other protocol types, such as `connect` used by Kafka Connect or `connector` reported by some implementations. It also excludes product-internal Groups whose IDs start with `sys-cmp` or `karapace-autogenerated`. Appearing in a candidate list means only that the source identity can discover the resource. It does not guarantee successful creation. Conflicts such as a same-name Topic on the target or an existing Mirror resource are not prefiltered from the source candidate list and are still validated during creation. If an expected Topic or Consumer Group does not appear, shorten the search keyword, then check its name, Group protocol type, Group ID prefix, and source Kafka ACLs. Internal Topics and coordination Groups used by components such as Kafka Connect are outside the Kafka Linking business Topic and Consumer Group migration scope; migrate them by following the component-specific procedure. See [Kafka Linking best practices](/automq-cloud/migrate-to-automq/kafka-linking-best-practices#verify-the-mirror-topic-and-consumer-group-candidate-lists) for the complete checklist. > [!CAUTION] > > If the target instance already contains a Topic with the same name as a selected Source Topic, Kafka Linking cannot create the corresponding Mirror Topic. Resolve the naming conflict before adding that Source Topic to the Kafka Link. ![Kafka Link creation form showing source cluster, target cluster, and sync configuration fields](https://mintcdn.com/automq/6t03b99H9kP_jCZq/automq-cloud/migrate-to-automq/executing-migration/2.webp?fit=max\&auto=format\&n=6t03b99H9kP_jCZq\&q=85\&s=cbf41cdd791767965762c02671a66d1a) Select the target topic and Consumer Group. ![Topic and Consumer Group selection interface for Kafka Link synchronization](https://mintcdn.com/automq/6t03b99H9kP_jCZq/automq-cloud/migrate-to-automq/executing-migration/3.webp?fit=max\&auto=format\&n=6t03b99H9kP_jCZq\&q=85\&s=1979f0dd4d247ff8b1d5dca6b7610440) After creation, you can enter the Kafka Link details to check that the specified Topic and Group have already entered the **synchronization** status. Once Kafka Link is created, it also supports adding new Topics and Consumer Groups. You can add the required business resources for migration as needed. > [!CAUTION] > > If you delete Mirror Topics or Consumer Groups in Kafka Link, the corresponding Topics and Consumer Groups will be deleted from the target cluster (AutoMQ instance). This operation cannot be undone; you will need to recreate them afterward. ![Kafka Link details page showing Topic and Consumer Group synchronization status](https://mintcdn.com/automq/6t03b99H9kP_jCZq/automq-cloud/migrate-to-automq/executing-migration/4.webp?fit=max\&auto=format\&n=6t03b99H9kP_jCZq\&q=85\&s=0ba7b8d06594342777ef3dc00401c928) ### Step 2: Switch producers and consumers, execute migration process When the Kafka Link is created, users need to update the Producer and Consumer configurations, switching the Producer and Consumer from the source cluster to the target cluster. This mainly involves the following three operations: * **Producer Cutover:** Update the producer's access parameters to point to the target cluster. * **Consumer Cutover:** Update the consumer's access parameters to point to the target cluster. * **Promote Mirror Topic Status:** In the AutoMQ console, select the Mirror Topic for status promotion. The promotion operation essentially controls the Kafka Linking component to stop proxying Producer write traffic and replicating data from the source cluster. Specific steps for switching the Producer and Consumer stream can be found below: #### Phase 1: Switch the producer to the target cluster During the migration process, first switch the Producer's access configuration so that the Producer connects to the target cluster (AutoMQ instance). The traffic topology during the switching process is shown in the figure below: ![Traffic topology diagram during Phase 1: producers switching to the target AutoMQ cluster](https://mintcdn.com/automq/6t03b99H9kP_jCZq/automq-cloud/migrate-to-automq/executing-migration/5.webp?fit=max\&auto=format\&n=6t03b99H9kP_jCZq\&q=85\&s=545548738d3f7a8756d67c2452c0b9a7) **Operations steps:** * The producer updates the access parameters in batches and restarts the application, redirecting the production traffic to the designated AutoMQ instance. > [!WARNING] > > This rolling cutover applies only to producers that do not use Kafka transactions. For applications that set `transactional.id` or depend on exactly-once semantics, stop source transactional producers, wait for the target to catch up, promote the related Mirror Topics, and then start the producers on the target. See [Kafka Linking best practices](/automq-cloud/migrate-to-automq/kafka-linking-best-practices#cut-over-transactional-producers) for the full procedure. **Expected Outcome:** * Production traffic is migrated to the target instance in phases, ensuring no downtime or disruption in production traffic. * Consumers in the source cluster continue to consume all messages without interruption. * Messages in the source cluster are synchronized to AutoMQ using replication tasks. **Rollback Operation:** * Producer rollback configuration: switch back to the source cluster. #### Phase 2: Switch the consumer to the target cluster The second stage involves switching the Consumer's access configuration, allowing the Consumer to connect to the target cluster (AutoMQ instance). The traffic topology during the switch is shown in the figure below: ![Traffic topology diagram during Phase 2: consumers switching to the target AutoMQ cluster](https://mintcdn.com/automq/6t03b99H9kP_jCZq/automq-cloud/migrate-to-automq/executing-migration/6.webp?fit=max\&auto=format\&n=6t03b99H9kP_jCZq\&q=85\&s=3e742f56a89e1865e3c357a15ac7be73) **Operations steps:** * Consumers update their connection parameters and use a rolling deployment so that instances gradually connect to the AutoMQ instance. * For standard Consumers that participate in Group management by using `subscribe` and `group.id`, instances moved to the target cannot receive partition assignments or start consuming while the target Mirror Group is `LINKING`. As source instances leave in batches, the remaining source instances must carry the full consumption workload. Control the rollout batch size and monitor source processing capacity and lag. * After every source Consumer instance exits, the data plane detects that the source Group has no active members and automatically promotes the Consumer Group. The data plane schedules registered Groups every 10 seconds. If the source Group still had active members at the previous check, the same Group is checked again after a default minimum interval of 30 seconds. * A brief consumption pause exists until Consumer Group promotion, target rebalance, and partition assignment complete. Wait for the Group to enter `PROMOTED`, then confirm that target Consumers have assignments and their consumption progress is advancing. > [!CAUTION] > > **Before switching Consumers, the following conditions should be met** > > For every partition, confirm that the Consumer's actual startup offset is within the readable range of the current Topic on the AutoMQ instance: > > ```text theme={null} > target earliest offset <= Consumer actual startup offset <= target end offset > ``` > > For example, if a Consumer's actual startup offset for Partition X is 100, it can cut over when the target readable range is `[80, 150]`. A range of `[120, 150]` means that the historical record at offset 100 is no longer readable. A range of `[80, 90]` means that the target has not replicated through offset 100, so wait for the target to catch up. > > The actual startup offset can come from a committed Kafka Consumer Group offset, a Flink checkpoint or savepoint, or application-managed storage. See [Kafka Linking best practices](/automq-cloud/migrate-to-automq/kafka-linking-best-practices#validate-consumer-offset-sources) for the validation procedure. **Expected Outcome:** * Production traffic remains in the same state as the previous phase, continuing to proxy back to the source cluster and synchronize to the target cluster. * The Consumer Group will continue to consume from the offsets of the source cluster and will not be affected. **Rollback Operation:** * For the consumer rollback configuration, switch back to the source cluster. > [!CAUTION] > > Since the consumption offsets of the source cluster will not be updated automatically, it is recommended to reset the offsets before rolling back to avoid potential duplicate consumption. #### Phase 3: Promote Mirror Topic status Once all Producers and Consumers have successfully switched and are functioning as expected, you can elevate the status of the Mirror Topic, stop the traffic proxy, and synchronization. ![AutoMQ console showing the Mirror Topic promotion step](https://mintcdn.com/automq/6t03b99H9kP_jCZq/automq-cloud/migrate-to-automq/executing-migration/7.webp?fit=max\&auto=format\&n=6t03b99H9kP_jCZq\&q=85\&s=539fa10aa86e53c506f430988da2885e) **Operations steps:** * After the Consumer switch is completed, it is recommended to monitor for a certain period to ensure that Producer and Consumer applications are running as expected. * Once confirmed, in the AutoMQ console, click on "Promote Mirror Topic" and stop traffic proxy and replication. > [!CAUTION] > > **Prerequisites for Promoting Mirror Topics:** > > * Every standard Producer instance connects to the target AutoMQ instance, and no workload Producer still writes directly through a source-cluster endpoint. Kafka Linking itself remains connected to the source during `LINKING`, so source-cluster connections alone do not indicate an incomplete workload cutover. > > * For transactional Producers, source instances have stopped, transactions have ended, the target has caught up, and target transactional Producers have not started. > > * Every Consumer instance connects to the target, the source Consumer Group has no active members, Consumer Group promotion is complete, and target consumers are stable. > > * Replication lag has converged, no sustained network, authentication, or request errors remain, and the post-promotion rollback and reconciliation plan is recorded. > > See [Kafka Linking best practices](/automq-cloud/migrate-to-automq/kafka-linking-best-practices#promote-mirror-topics) for the complete gates and validation procedure. **Expected Outcome:** * All read and write operations for mirror topics are centralized in the target cluster, without proxying back to the source cluster. **Rollback Operation:** * If the message data in the target cluster exceeds that of the source cluster after promoting the Mirror Topic, you should be cautious about data inconsistencies during the rollback. ### Step 3: Migration complete, delete Kafka Link After every Mirror Topic and Consumer Group in the Kafka Link is promoted, and production, consumption, and critical business results on the target pass acceptance and the observation window, delete the Kafka Link itself. Deleting the Kafka Link marks the migration as fully complete. ![AutoMQ console showing the Kafka Link deletion step after migration is complete](https://mintcdn.com/automq/6t03b99H9kP_jCZq/automq-cloud/migrate-to-automq/executing-migration/8.webp?fit=max\&auto=format\&n=6t03b99H9kP_jCZq\&q=85\&s=7ab707c3e468a03aa2a3fc2556b02353) > [!CAUTION] > > To complete the migration, delete only the Kafka Link itself. Do not delete promoted Mirror Topics or Consumer Groups from the Kafka Link; doing so deletes the corresponding topic or Group from the target AutoMQ instance. After deleting the Kafka Link, stop new workload writes to the source and retain it in an idle state for an observation period, preserving its data and required access. Reclaim the source cluster resources only after the target remains stable and rollback or data reconciliation is no longer needed. See [Kafka Linking best practices](/automq-cloud/migrate-to-automq/kafka-linking-best-practices#complete-the-migration) for the full exit criteria and checklist. # Overview Source: https://docs.automq.com/automq-cloud/migrate-to-automq/overview Migrate to AutoMQ Cloud with full Kafka compatibility. Adaptive elastic scaling, batch migration, and cost-efficient cloud-native infrastructure for reliable data synchronization. AutoMQ is a next-generation Kafka distribution redesigned based on cloud-native principles and compatible with Apache Kafka®. This article explains the Kafka Linking feature provided by AutoMQ and how to use Kafka Linking to migrate business from Apache Kafka® or other Kafka distributions to AutoMQ. ## Migration scenarios AutoMQ is compatible with Apache Kafka®, enabling Kafka Linking to migrate Kafka distributions provided by other vendors. Details are listed below:
Source Cluster Target Cluster Migration Support
Apache Kafka AutoMQ Support > [!TIP] > > Kafka Linking is compatible with Apache Kafka® versions >= 0.11.
AWS MSK Support > [!TIP] > > Kafka Linking does not support MSK IAM Role authentication mode and only supports the native ACL authentication mode.
Confluent Platform Supported
Alibaba Cloud Kafka Supported
> [!TIP] > > If the current Kafka release version you are using is not listed above, please contact us immediately for support and assistance. ## Overview of Kafka Linking AutoMQ Cloud provides the Kafka migration tool Kafka Linking, which supports migration from Apache Kafka® or other Kafka distributions to AutoMQ without application changes. The Kafka Linking migration tool has the following advantages: * **Non-Stop Migration**: Unlike MirrorMaker2, which requires client downtime for switching, Kafka Linking is equipped with a built-in traffic proxy component that ensures the switching process for Producers does not require downtime. * **Byte-to-byte replication:** Unlike MirrorMaker2, which changes offsets during replication, Kafka Linking preserves partition offsets when it replicates source data to the target. Applications such as Flink jobs that restore offsets from checkpoints, savepoints, or external stores must still verify that every saved offset is readable on the target. See [Kafka Linking best practices](/automq-cloud/migrate-to-automq/kafka-linking-best-practices#validate-consumer-offset-sources) for the validation procedure. * **Synchronized Consumption Progress:** Kafka Linking supports synchronized source cluster consumption progress, allowing consumers to resume consumption from the target cluster post-migration with consistent position information. * **Elastic Scaling on Demand:** Kafka Linking requires no separate deployment and scales with the AutoMQ cluster on demand, reducing operational complexity during migration. * **High Kafka Compatibility:** Kafka Linking supports most historical versions of Apache Kafka (version >=0.11) as well as other commercial editions, allowing transitions to AutoMQ. ## Kafka Linking terminology and concepts Kafka Linking defines a series of terms, listed as follows: ### Kafka Link A Kafka Link is a data synchronization and proxy task for a set of Topics from an external Apache Kafka cluster to an AutoMQ Kafka instance, including the configuration required for data synchronization, real-time operational status, and traffic proxy control. ### Source Cluster The Source Cluster is an abstract configuration defined in Kafka Linking for the migration source cluster. The Source Cluster is described by AutoMQ's console-provided Kafka integration, containing configuration information such as the source cluster's access point, ACL rules, alias, etc. ### Sink Cluster The Sink Cluster is an abstract configuration defined in Kafka Linking for the migration target cluster. The Sink Cluster specifically refers to an AutoMQ instance (Kafka Linking supports only AutoMQ instances as Sink Clusters), containing configuration information such as the target cluster's access point, ACL rules, alias, etc. ### Mirror Topic Mirror Topic is the basic unit used in Kafka Linking to synchronize and migrate a Topic from the source cluster to the target cluster. Each Mirror Topic corresponds to a specific Topic in the source cluster and serves as the unique representation of that Topic in the target cluster. ### Source Topic Source Topic is the expression of the Topic in the source cluster for Kafka Linking. In each Kafka Link, the Source Topic and Mirror Topic correspond one-to-one. ### Consumer Group Kafka Linking supports copying consumption progress information from the source cluster's Consumer Group and synchronizing it to the target cluster. Users can specify the Source Cluster's Consumer Group and configure it to the Sink Cluster's designated Consumer Group. ## Kafka Linking architecture Unlike MirrorMaker2, which implements data synchronization based on Connectors, the Kafka Linking migration tool reconstructs two paths: Byte-to-Byte replication path and Producer proxy path: * **Byte-to-Byte Replication Path:** This is used for synchronizing data from the Source Cluster to the Sink Cluster, ensuring data integrity and position consistency. * **Producer Proxy Path:** Traditional MirrorMaker2 requires Producers to be completely shut down before switching to the target cluster to avoid data disorder caused by simultaneous writing to both clusters. AutoMQ Kafka Linking provides a Producer proxy path that supports traffic proxying back to the source cluster during the switching process and subsequent unified switching, enabling zero-downtime switching. ### Byte-to-Byte replication path ![The data synchronization link of Kafka Linking can achieve the following effects:](https://mintcdn.com/automq/6t03b99H9kP_jCZq/automq-cloud/migrate-to-automq/overview/1.webp?fit=max\&auto=format\&n=6t03b99H9kP_jCZq\&q=85\&s=4944a3c1c369348de8b403d0b8746432) Kafka Linking's data synchronization links can achieve the following effects: * Topic partition numbers are completely consistent. * Message full synchronization, with offsets exactly aligned with the source cluster. * Consumer offsets are synchronized; the specific partitions' consumer offsets for specific Consumer Groups in the source cluster are fully synchronized to the target cluster, maintaining consistency. ### Producer proxy link ![Producer proxy link provided by Kafka Linking has the following capabilities:](https://mintcdn.com/automq/6t03b99H9kP_jCZq/automq-cloud/migrate-to-automq/overview/2.webp?fit=max\&auto=format\&n=6t03b99H9kP_jCZq\&q=85\&s=75c59306668e2232fcbd3116b10d4a3f) Producer proxy link provided by Kafka Linking has the following capabilities: * Supports Producer rolling-switch access point migration, with no downtime during the switch, ensuring no disruption to writing processes. * Supports normal read/write operations on the source cluster during migration, with no impact, allowing applications to switch as needed. ## Next steps To understand the background and functionality of Kafka Linking, it is recommended to follow this sequence: * **Prerequisites sorting:** Identify the characteristics of the source cluster and business relationships that need migration, plan the migration batches, and check prerequisite resources. [Prerequisites▸](/automq-cloud/migrate-to-automq/prerequisites) * **Review migration best practices:** Create a runbook for each batch based on endpoints, client types, offset sources, and rollback requirements. [Kafka Linking best practices▸](/automq-cloud/migrate-to-automq/kafka-linking-best-practices) * **Execute the migration plan:** After completing the prerequisite review, follow the migration plan step by step. [Executing migration▸](/automq-cloud/migrate-to-automq/executing-migration) # Prerequisites Source: https://docs.automq.com/automq-cloud/migrate-to-automq/prerequisites Ensure you verify all prerequisites before migrating to AutoMQ to ensure no impact on production business operations. AutoMQ provides cloud-native scalability and 100% API compatibility with Kafka. Before migrating to AutoMQ, make sure to verify the following conditions and constraints to ensure that your production environment remains unaffected. ## Function compatibility assessment Due to version support differences, AutoMQ provides only Kafka Server services and does not offer managed services for other ecosystem components. Therefore, before migrating to AutoMQ, you need to confirm whether the following functionalities are in use and refer to the following handling guidelines: * **Kafka Server:** AutoMQ offers a more cost-effective and flexible Kafka Server, **compatible with Apache Kafka versions 0.11.x \~ 3.9.x**. If your current Apache Kafka Server version falls outside this supported range, please contact us for support and updates. * **Kafka Client:** AutoMQ is compatible with the original Apache Kafka Client SDK. Ensure that your existing SDK version is **between 0.10.x \~ 3.9.x** to maintain compatibility. In addition to the differences in service components, before migrating to AutoMQ, you need to confirm whether the following functionalities are in use and handle them according to the guidance below. * **Access Point Protocols:** AutoMQ supports protocols such as PLAINTEXT, SASL\_PLAINTEXT, SASL\_SSL, and mTLS for internal network access. If your application uses other protocols to connect to the cluster, it is recommended to consult with AutoMQ technical staff to evaluate the risks associated with modifications. ## Business scope sorting For migrating from Apache Kafka to AutoMQ in a production environment, it is generally recommended to perform the migration in batches. This involves gradually selecting Topics and Consumer Groups from the source cluster and migrating them in batches based on business chains and business scope. Therefore, it is recommended to perform business scope sorting according to the following process: 1. **Inventory of Source Cluster Resources:** It is advisable to use the Kafka Admin CLI or other tools to export all Topics and Consumer Groups from the source cluster and classify and organize them by business system. Clean up invalid or unclaimed Topics and Consumer Groups in advance. > [!TIP] > > It is recommended to check the Topics in the source cluster and clean up Topics and Consumer Groups that have had no writes or subscriptions for a long time in advance to reduce the scope of the migration. 2. **Batch Division by Business System:** In a production environment, it is recommended to plan migration batches by business system. Start by migrating offline and non-core business systems, and gradually expand the migration scope to avoid unexpected risks. 3. **Coordinate with Business Personnel for Migration:** During the process of migrating Apache Kafka® to AutoMQ, it is necessary for business personnel to cooperate in changing access points and restarting applications. Therefore, before executing the migration plan, it is important to coordinate with the business personnel for their cooperation. > [!NOTE] > > Apache Kafka Client does not disconnect from the source cluster after establishing a server connection. Therefore, even if domain names are used to access the server, it is still necessary to restart the client application to connect to the new AutoMQ cluster. ## Cluster environment preparation ### Create an AutoMQ instance and ensure capacity meets your requirements Before executing the migration tasks, an AutoMQ instance needs to be created in advance, and it must be ensured that the AutoMQ instance is in a running state. When creating an AutoMQ instance, please pay attention to the following considerations: * **Network Connectivity Check:** When creating an AutoMQ instance, it is necessary to select a VPC and subnet. Please ensure that the VPC subnet where the AutoMQ instance is located can communicate with the current Apache Kafka. Otherwise, data migration and synchronization cannot be executed subsequently. > [!TIP] > > To utilize Kafka Linking, ensure that your AutoMQ instance version is >= 5.0. If your version is below this requirement, please upgrade the instance version first. * **Instance Capacity Specification Check:** When creating an AutoMQ instance, it is crucial to confirm the throughput scale of the source cluster. Based on the **peak read/write throughput** of the source cluster, select the appropriate AutoMQ instance specifications to avoid system failures due to insufficient capacity during the later stages of migration. > [!TIP] > > When using Kafka Linking, it is recommended to reserve **an additional 50% capacity** on top of the peak throughput specification of the source cluster for the target AutoMQ instance to account for the consumption of cluster capacity by Kafka Linking. > > *Example:* > > *If the peak throughput of the source Kafka cluster is 100MBps, and you are migrating to AutoMQ using Kafka Linking, it is advisable to reserve 100\*150% = 150MBps during migration. After the migration is completed, the capacity can be reduced to match the specifications of the source cluster.* For detailed instructions on creating an instance, please refer to [Experience AutoMQ▸](/automq-cloud/getting-started/experience-automq). ### Retrieve source cluster configuration The principle of migrating from Apache Kafka® to AutoMQ is to use migration tools to synchronize existing data and configurations from the source cluster to the new cluster, then switch client configurations at the appropriate time to enable access to the new cluster. In the process described above, synchronizing data and configurations from the source cluster requires obtaining the source cluster's configuration. Therefore, it is necessary to confirm in advance whether the following configuration information is prepared: * **Source Cluster Access Points:** Configure the source cluster's bootstrap endpoint list. Use stable DNS names or the formal endpoint provided by the Kafka service. Do not use Kubernetes Pod IPs or node IP and NodePort combinations. The AutoMQ data plane must also reach every broker address returned through `advertised.listeners`. See [Kafka Linking best practices](/automq-cloud/migrate-to-automq/kafka-linking-best-practices) for the full validation checklist. * **Source Cluster Access Protocol:** The migration tool needs to access the source cluster, and you must confirm the access protocol used by the source cluster. Currently, Kafka Linking supports PLAINTEXT, SASL\_PLAINTEXT, SASL\_SSL, and mTLS protocols. * **Source Cluster Username and Password (Optional):** If the source cluster requires access using the SASL\_PLAINTEXT or SASL\_SSL protocol, you need to configure the username and password and ensure that the **username has permission to subscribe to all topics**. * **Source Cluster Network Firewall Policy (Optional):** If the source cluster is configured with network firewall or security group policies, the subnet of AutoMQ needs to be allowed. ## Next steps Once the prerequisites are sorted out and met, you can proceed with the subsequent migration process. It is recommended to handle it in the following order: * **Review migration best practices:** Create a batch runbook based on client types, offset sources, and rollback requirements. [Kafka Linking best practices▸](/automq-cloud/migrate-to-automq/kafka-linking-best-practices) * **Implement the migration plan:** After completing the prerequisite review, follow the migration plan step by step. [Executing migration▸](/automq-cloud/migrate-to-automq/executing-migration) # Glossary Source: https://docs.automq.com/automq-cloud/overview/glossary Definitions of the primary resources and concepts used in AutoMQ Cloud. > [!NOTE] > > In this documentation, AutoMQ product service provider, AutoMQ service provider, and AutoMQ refer to AutoMQ HK Limited. ## Terminology Details ### Environment An Environment is the management boundary for the infrastructure, region, network, and authorization settings used by AutoMQ Cloud. AutoMQ resources are created and managed within an Environment. ### Environment Status Environment Status indicates the current lifecycle or operational state of an Environment, such as creating, running, updating, or service disruption. ### Instance An Instance is an AutoMQ service resource that corresponds to an Apache Kafka® cluster. Its configuration defines the cluster lifecycle, capacity, network, security, and feature settings. ### Member A Member is an account identity that can access AutoMQ Cloud resources. AutoMQ Cloud provides the Admin, Operator, and Viewer roles. For more information, see [Identity and access management overview](/automq-cloud/manage-identities-and-access/overview). ### ServiceAccount A ServiceAccount is a non-human AutoMQ Cloud account identity used for programmatic access. It has a name, description, status, and source, and is authorized through AutoMQ identity and access management. ### Connect Cluster A Connect Cluster is a managed Kafka Connect worker cluster. It defines the runtime version, plugins, compute capacity, deployment location, worker configuration, and identity used to run Connectors. ### Connector A Connector is a source or sink workload that runs on a Connect Cluster. It uses a connector plugin and configuration to transfer data between Kafka and an external system. ### OpsTunnel OpsTunnel is a time-bound managed operations channel between an AutoMQ BYOC (Bring Your Own Cloud) environment and the AutoMQ operations service. It is used for authorized troubleshooting access and can be closed by the environment administrator. ### Data Bucket A Data Bucket is an object storage bucket used by an AutoMQ instance to store Kafka data and metadata. ### Ops Bucket An Ops Bucket is an object storage bucket used to store logs, metrics, and diagnostic data for managed operations. Access is controlled separately from the Data Bucket. ### Payment A Payment identifies the payment method associated with an AutoMQ subscription. It records the payment type, display name, and, when applicable, the customer identifier assigned by the payment provider. ### Kafka Links Kafka Links is an AutoMQ capability for continuously replicating Kafka topics between source and destination instances. It can be used for data migration, disaster recovery, and cross-region data distribution. ### EBS (Elastic Block Store) WAL (Write-Ahead Log) EBS WAL is a WAL mode that stores data on Amazon EBS volumes attached to AutoMQ broker nodes. ### NFS WAL NFS WAL is a write-ahead log mode that stores WAL data on a shared Network File System that is accessible to AutoMQ broker nodes. ### S3 WAL S3 WAL is a write-ahead log mode that stores WAL data in S3-compatible object storage. # Restrictions Source: https://docs.automq.com/automq-cloud/overview/restrictions AutoMQ Cloud enforces standardized parameters and quotas across its products. Learn about parameter limits, resource quotas, and deployment region restrictions. ## Overview To prevent various edge cases in production caused by unclear behavior definitions, AutoMQ Cloud enforces and standardizes parameters, quotas, and behaviors across its products. Users should ensure they do not violate these constraints while using the system. If these constraints do not align with actual usage scenarios, please promptly submit a support ticket for assistance, as referenced in [Obtaining Services▸](/automq-cloud/support/obtaining-services). ## Limitations on Parameters The names and descriptions of resources within the following parameters have restricted values that cannot be adjusted. Please adhere strictly to the specifications to prevent system processing anomalies caused by special characters or excessive length. ### Public Parameter Limitations
Parameter Items **Limit Value** **Description**
Instance Name
  • Character Restrictions: Supports only Chinese characters, letters a-z or A-Z, numbers 0-9, underscores (\_), and hyphens (-).
  • Length Restrictions: 3-64 characters.
Names and notes should preferably use simple, common phrases and abbreviations. Avoid using special characters that may cause display issues.
Instance Description
  • Character Restrictions: UTF-8 visible characters.
  • Length limit: 0 to 255 characters.
Environment Member Name
  • Character Restrictions: Only supports letters a-z or A-Z, digits 0-9, underscores (\_), and hyphens (-).
  • Length Restrictions: 3-64 characters.
Environment Member Password
  • Character Restrictions: Only supports visible characters.
  • Length restriction: 8 to 16 characters.
### Instance-Level Configuration
Parameter Items **Limit Value** **Description**
[log.retention.ms](https://kafka.apache.org/34/documentation.html#brokerconfigs_log.retention.ms) Message Retention Period
  • Default value: 7 days
  • Range: 1 hour \~ 60 days
  • Can be customized and modified
The message retention period affects storage space consumption and cost. It is advisable for businesses to assess this carefully. If unsatisfactory, please [Obtaining Services▸](/automq-cloud/support/obtaining-services) Seek assistance.
[message.max.bytes](https://kafka.apache.org/34/documentation.html#brokerconfigs_message.max.bytes) Maximum message size
  • Default: 20 MiB
  • Constraint Value: 0 B \~ 50 MiB
  • Custom modification supported
If the current parameter limit does not meet your needs, please [Obtaining Services▸](/automq-cloud/support/obtaining-services) seek assistance.
[offsets.retention.minutes](https://kafka.apache.org/34/documentation.html#brokerconfigs_offsets.retention.minutes) Consumption Progress Retention Duration
  • Limit: 7 days
  • Customization not supported
[fetch.max.bytes](https://kafka.apache.org/34/documentation.html#brokerconfigs_fetch.max.bytes) Single Data Fetch Limit
  • Limit: 55 MB
  • Custom modifications are not supported.
Single partition write throughput limit
  • Limit: 4 MBps
  • Custom modifications are not supported.
There are limitations on single partition read/write throughput. It is recommended that applications use different message keys to distribute the read/write load across different partitions to avoid partition hotspots. Please [Obtaining Services▸](/automq-cloud/support/obtaining-services) Seeking Assistance.
Single Partition Read Throughput Limit
  • Limit: 4 MBps
  • Customization not supported
[auto.create.topics.enable](https://kafka.apache.org/34/documentation.html#brokerconfigs_auto.create.topics.enable) Auto-create Topic Switch
  • Default value: true
  • Constraint range: true/false
  • Can be customized and modified
It is recommended to disable the automatic creation of topics and instead manage all topics through the control system and Admin API to prevent them from becoming unmanageable.
[num.partitions](https://kafka.apache.org/34/documentation.html#brokerconfigs_num.partitions) Default number of partitions for created topics
  • Default value: 1
  • * Limit range: 1-1024
  • Can be customized and modified
The default number of partitions to create for a topic when using automatic topic creation should be set reasonably at the cluster level to avoid consuming too many of the partition quota with automatically created topics.
automq.zone.cidr.blocks Client source CIDR availability zone identification
    * Default value: None * Limit range: None
  • Can be customized and modified
The server matches the CIDR set in the current rule with the client's source IP to determine the client's corresponding availability zone. This configuration is used to optimize and eliminate cross-availability zone traffic for clients. The format specification for CIDR is \{zoneId}@\{cidr}\<>\{zoneId}@\{cidr}. Different availability zones are separated by "\<>", while multiple CIDR segments under the same availability zone are separated by ",". Example:
  • Configuring multiple availability zones: az-1\@10.0.0.1/30\<>az-2\@10.0.0.2/30.
  • Multiple CIDR segments under the same availability zone: az-1\@10.0.0.1/30,10.0.0.2/30
> [!TIP] > > In the AWS environment, the availability zone identifier should be set as ZoneID rather than ZoneName. Regarding the difference between the two > [Reference Documentation](https://docs.aws.amazon.com/global-infrastructure/latest/regions/az-ids.html) > .
### Topic-Level Configuration
Parameter Items **Limit Value** **Description**
[compression.type](https://kafka.apache.org/34/documentation.html#topicconfigs_compression.type)
  • Default value: producer
  • Constraint Value:
    • Zstd
    • lz4
    • Producer
    • Uncompressed
    • Snappy
    • gzip
      • Custom modification supported
Set the final compression type for the Topic. This configuration supports ('gzip', 'snappy', 'lz4', 'zstd'); in addition to these options, it also supports 'uncompressed', meaning no compression is applied. The 'producer' configuration value refers to retaining the compression type set by the producer.
[cleanup.policy](https://kafka.apache.org/34/documentation.html#topicconfigs_cleanup.policy) Message cleanup policy
  • Default value: delete
  • Range limitation:
    • delete: Periodically remove the oldest messages based on the retention time.
    • compact: Periodically merge messages based on their keys, retaining only the latest version.
      • Can be customized and modified
In most business scenarios, it is recommended to use the delete type, and only use the compact type in scenarios where preserving state data is required.
[retention.ms](https://kafka.apache.org/34/documentation.html#topicconfigs_retention.ms)
  • Default Value: Uses current cluster configuration
  • Limit value: 1 hour to 60 days.
  • Custom modification supported
Configure a custom retention period for messages in a topic, applicable only to topics with a deletion clean-up policy. This configuration will override the default cluster settings.
[max.message.bytes](https://kafka.apache.org/34/documentation.html#topicconfigs_max.message.bytes)
  • Default Value: Uses current cluster configuration
  • Constraint Value: 0 B \~ 50 MiB
  • Custom modification supported
Set the maximum allowable record batch size for the current topic, and any messages exceeding this limit will be rejected.
[message.timestamp.type](https://kafka.apache.org/34/documentation.html#topicconfigs_message.timestamp.type)
  • Default value: CreateTime
  • Constraint Value:
    • LogAppendTime
    • CreateTime
      • Can be customized and modified
Define whether the timestamp in the message corresponds to the message's creation time or the log append time. This value should be either 'create time' or 'log append time'.
[retention.bytes](https://kafka.apache.org/34/documentation.html#topicconfigs_retention.bytes)
  • Default value: -1
  • Custom modification supported
This setting applies to topics with a delete cleanup policy and controls the maximum retention space for each partition. By default, there is no size limit, only a time limit. This restriction is at the partition level, so multiply it by the number of partitions to compute the topic-level retention space. This configuration overrides the cluster's default settings.
[delete.retention.ms](https://kafka.apache.org/34/documentation.html#topicconfigs_delete.retention.ms)
  • Default value: 1 day
  • Limit value: 0 hours \~ 60 days
  • Custom modification supported
Set the retention time for deletion tombstones for Compact-type Topics, applicable only to Compact-type Topics. This configuration requires consumers to read messages within this timeframe to obtain the last valid snapshot; otherwise, they may read incomplete data.
Topic Naming
  • Character Restrictions: Only supports letters a\~z or A\~Z, numbers 0\~9, underscores (\_), hyphens (-), and dots (.).
  • Length Limit: 1\~250 characters.
  • Other restrictions: Cannot start with an underscore (\_).
None.
Topic Notes
  • Character restrictions: Only supports Chinese characters, letters a\~z or A\~Z, numbers 0\~9, and underscore (\_).
  • Length restrictions: 1\~256 characters.
## Resource Quota Limits AutoMQ Cloud has established initial constraints on certain performance metrics and parameters based on its operational experience in large-scale production environments. In most cases, the default constraint range will meet your needs. However, if there are special circumstances where these do not suffice, please promptly submit a support ticket for assistance. ### Environmental Public Resource Quota Limits
**Limit Item** **Limit Value** **Description**
Total number of product instances allowed within a single environment Refer to subscription plan version constraints If current constraints are not met, seek help through a support ticket. [Obtaining Services▸](/automq-cloud/support/obtaining-services) .
Number of member accounts in a single environment: 100
### Instance Quota Limitations: AutoMQ Cloud has established initial constraints on certain performance metrics and parameters based on its operational experience in large-scale production environments. In most cases, the default constraint range will meet your needs. However, if there are special circumstances where these do not suffice, please promptly submit a support ticket for assistance.
**Limit Item** **Limit Value** **Description**
Single Instance (Cluster) Computing Specification 3AKU to 500AKU, offering the following capabilities:
  • Write Throughput: 60MBps\~10000MBps
  • Read Throughput: 60MBps\~10000MBps
The instance's compute specification denotes the maximum throughput capacity for sending and receiving messages on a single instance (cluster). If there's a need for larger-scale clusters, please [Obtaining Services▸](/automq-cloud/support/obtaining-services) apply to raise the specification limits.
Limits on the Number of Topics per Instance Defined by the compute specifications of the instance; see specification limits for further details. [Billing Instructions for BYOC▸](/automq-cloud/subscriptions-and-billings/byoc-env-billings/billing-instructions-for-byoc) . For security and stability purposes, it's advisable to separate different business operations into distinct instances to avoid consolidating all operations into one instance.
Maximum Number of Partitions per Single Instance (Cluster)
Maximum Request QPS per Single Instance (Cluster)
## AutoMQ BYOC Deployment Region Restrictions > [tab] AWS > > | **Code** | **Name** | > | - | - | > | us-east-1 | US East (N. Virginia) | > | us-east-2 | US East (Ohio) | > | us-west-1 | US West (N. California) | > | us-west-2 | US West (Oregon) | > | af-south-1 | Africa (Cape Town) | > | ap-east-1 | Asia Pacific (Hong Kong) | > | ap-south-2 | Asia Pacific (Hyderabad) | > | ap-southeast-3 | Asia Pacific (Jakarta) | > | ap-southeast-5 | Asia Pacific (Malaysia) | > | ap-southeast-4 | Asia Pacific (Melbourne) | > | ap-south-1 | Asia Pacific (Mumbai) | > | ap-northeast-3 | Asia Pacific (Osaka) | > | ap-northeast-2 | Asia Pacific (Seoul) | > | ap-southeast-1 | Asia Pacific (Singapore) | > | ap-southeast-2 | Asia Pacific (Sydney) | > | ap-northeast-1 | Asia Pacific (Tokyo) | > | ca-central-1 | Canada (Central) | > | ca-west-1 | Canada West (Calgary) | > | eu-central-1 | Europe (Frankfurt) | > | eu-west-1 | Europe (Ireland) | > | eu-west-2 | Europe (London) | > | eu-south-1 | Europe (Milan) | > | eu-west-3 | Europe (Paris) | > | eu-south-2 | Europe (Spain) | > | eu-north-1 | Europe (Stockholm) | > | eu-central-2 | Europe (Zurich) | > | il-central-1 | Israel (Tel Aviv) | > | me-south-1 | Middle East (Bahrain) | > | me-central-1 | Middle East (UAE) | > | sa-east-1 | South America (São Paulo) | > [tab] GCP > > | Region ID | Name | > | - | - | > | us-west-1 | Oregon | > | asia-south1 | Mumbai | > | asia-south2 | Delhi | > | asia-east1 | Changhua County | > | asia-east2 | Hong Kong | > | asia-northeast1 | Tokyo | > | asia-northeast2 | Osaka | > | asia-northeast3 | Seoul | > | asia-southeast1 | Jurong West | > | australia-southeast1 | Sydney | > | australia-southeast2 | Melbourne | > | europe-central2 | Warsaw | > | europe-north2 | Hamina | > | europe-southwest1 | Madrid | > | europe-west1 | St. Ghislain | > | europe-west2 | London | > | europe-west3 | Frankfurt | > | europe-west4 | Eemshaven | > | europe-west6 | Zurich | > | europe-west8 | Milan | > | europe-west9 | Paris | > | northamerica-northeast1 | Montréal | > | northamerica-northeast2 | Toronto | > | southamerica-east1 | Osasco | > | us-central1 | Council Bluffs | > | us-east1 | Moncks Corner | > | us-east4 | Ashburn | > | us-west1 | The Dalles | > | us-west2 | Los Angeles | > | us-west3 | Salt Lake City | > | us-west4 | Las Vegas | > [tab] Azure > > | Region ID | Name | > | - | - | > | eastus | East US | > | westus2 | West US 2 | > | westeurope | West Europe | > | southeastasia | Southeast Asia | > | japaneast | Japan East | > | australiaeast | Australia East | > | germanywestcentral | Germany West Central | > | uaenorth | UAE North | # What Is AutoMQ Cloud Source: https://docs.automq.com/automq-cloud/overview/what-is-automq-cloud AutoMQ Cloud is the portal for creating and managing AutoMQ BYOC environments in your cloud account. ## Overview AutoMQ Cloud is an environment management portal provided by AutoMQ HK Limited. Use the portal to obtain control plane installation commands and to create and manage AutoMQ BYOC (Bring Your Own Cloud) environments in your cloud account. AutoMQ BYOC deploys Apache Kafka-compatible control plane and data plane workloads in your cloud account. AutoMQ provides managed operations capabilities for deployment, version upgrades, scaling, observability, and incident response. Because the AutoMQ BYOC control plane and data plane run in your cloud account, Kafka data remains in the virtual private cloud (VPC) and object storage resources that you control. ![](https://mintcdn.com/automq/6t03b99H9kP_jCZq/automq-cloud/overview/what-is-automq-cloud/1.webp?fit=max\&auto=format\&n=6t03b99H9kP_jCZq\&q=85\&s=03f02dbc04fee9e669f84208a67e4d8a) ## Core Advantages AutoMQ Cloud offers the following advantages: #### Pay-as-you-go, with a 50% Reduction on Cloud Bills AutoMQ's new cloud-native architecture fully leverages **object storage** and cloud **elastic computing** resources, providing significant cost advantages over Apache Kafka and other competitor solutions. By enabling AutoMQ Cloud, you can fully utilize resources on demand and pay-as-you-go, with a 50% reduction on cloud bills. #### Managed Operations and SLA Support AutoMQ BYOC includes managed operations for deployment, configuration changes, version upgrades, monitoring, and incident response. The AutoMQ team provides 24/7 operations support and the service-level commitments defined in the applicable agreement. #### Supports BYOC, Resources Deployed in User VPC, No Cross-network Data The BYOC model of AutoMQ Cloud means that cloud resources are deployed in the user's VPC. Users can access AutoMQ without cross-network connectivity and can also utilize existing cloud account resource discounts. #### Enterprise-Level Capabilities Out of the Box AutoMQ Cloud enhances AutoMQ Open Source with enterprise-level features such as auto-scaling, seconds-level partition reassignment, and integrated system observability. Users can use these enhancements immediately upon service activation without additional development. #### Native Multi-Cloud Support The cloud-native architecture of AutoMQ relies solely on Public Cloud-based object storage and virtual machine products, inherently supporting multi-cloud deployments. Enterprise customers can activate and use AutoMQ Cloud within mainstream cloud environments. ## Choosing the Service Version AutoMQ offers AutoMQ BYOC and AutoMQ Software for enterprise customers. AutoMQ BYOC is a fully managed cloud service deployed in your cloud account. AutoMQ Software is a software distribution for private data center deployments. Enterprise customers can refer to the table below to select the most suitable service version. | Comparison item | AutoMQ BYOC | AutoMQ Software | | - | - | - | | Service model | Fully managed BYOC service \[1] | Self-managed software \[2] | | Deployment environment | Public cloud | Private data center | | Resource ownership | IaaS resources are owned by your cloud account | Infrastructure resources are owned by you | | Data sovereignty | Data remains within your VPC | Data remains within your private network | | Operations | AutoMQ provides deployment, version upgrades, parameter tuning, monitoring and alerts \[3], and online incident response \[4] | You perform all operations; AutoMQ provides remote technical support | | Payment method | Pay-as-you-go or annual subscription | Annual subscription or perpetual license | | Cost structure | AutoMQ subscription fee and cloud resource charges paid to the cloud provider | Software license fee and customer-provided infrastructure costs | | Technical support | Expert technical support and 24/7 online emergency response | Expert technical support and 8/5 online emergency response | | Recommended use | Public cloud workloads that require resources and data to remain in the customer's cloud account | Workloads that require private data center deployment and complete environment isolation | **Annotation Notes:** \[1] AutoMQ BYOC deploys the AutoMQ control plane and data plane in your cloud account and provides a fully managed service. \[2] AutoMQ Software deploys the control plane and data plane in your private data center. You are responsible for operations, and AutoMQ provides technical support and version upgrades. \[3] In BYOC environments, logs, metrics, and diagnostic data are stored in a separate Ops Bucket. You authorize the AutoMQ service account to access this bucket so that the AutoMQ operations platform can analyze service health and support managed operations. \[4] AutoMQ Cloud monitors instance health and can isolate unhealthy nodes automatically. The AutoMQ engineering team performs subsequent root-cause analysis when required. ## Related Content * **Quick Experience of AutoMQ Cloud:** [Overview▸](/automq-cloud/getting-started/overview) # Prepaid Billing Overview Source: https://docs.automq.com/automq-cloud/subscriptions-and-billings/byoc-env-billings/billing-instructions-for-byoc AutoMQ's detailed billing guide explains prepaid subscription fees based on AKU cluster size in a BYOC environment, emphasizing cloud-native scalability, Kafka compatibility, and cost-efficient resource allocation. The billing overview section offers detailed information about the billing components associated with the AutoMQ Cloud product in a BYOC (Bring Your Own Cloud) environment. > [!NOTE] > > The terms cloud vendors and public cloud vendors mentioned in this document refer to major cloud service providers such as AWS, Google Cloud, Azure, Alibaba Cloud, OCI, etc. ## AutoMQ Subscription Fees (Payable to AutoMQ) To use AutoMQ Cloud in a BYOC environment, users are required to pay subscription fees based on the actual cluster size. AutoMQ evaluates subscription fees with the following scale indicators: * **Message Processing Specification AKU (AutoMQ Kafka Unit):** Mandatory, the AKU message processing specification is used to measure the scale of computing resources allocated during the sending and receiving of messages within a Kafka cluster. The AKU specification is directly proportional to the cluster's scale pressure. ### Message Processing Specification AKU Costs #### Metric Constraints The Message Processing Specification AKU refers to the computational processing resources allocated within a cluster during message transmission. AKU considers resource consumption factors such as computational power, storage IOPS, and network throughput. Allocating the appropriate AKU specifications for each AutoMQ instance ensures that the required message transmission throughput capacity is achieved. According to benchmark performance test results, adding 1 AKU specification delivers the following performance capabilities:
Capabilities Provided by 1 AKU Description
Read/Write Throughput Write 30 MiB/s or Read 60 MiB/s Core performance metrics and load for message read/write calls. If the predefined specifications are exceeded, it may result in slower service response times, increased RT, or rate-limiting failures. > [!TIP] > > *Example: For a specific AutoMQ instance, the write throughput is 60 MiB/s and the read throughput is 240 MiB/s. This instance's write throughput consumes 60/30 = 2 AKU, read throughput consumes 240/60 = 6 AKU, totaling 8 AKU.*
Client Request Rate 800 requests per second The application interacts with the server using the Kafka Producer and Consumer SDK, managing request rate and load. If the rate surpasses the predefined specifications, it may lead to throttling or longer response times (RT). Request types include:
  • Produce
  • FetchConsumer
  • CommitOffset
Upper limit on partition count 1125 pieces The number of partitions limits the amount of metadata an instance can handle simultaneously. Exceeding the specified limit may result in the following situations:
  • Inability to create new topics or expand partitions.
> [!TIP] > > AutoMQ, using an S3-based shared storage architecture, compared to Apache Kafka at the same cluster scale, > supports 10 times > Partition performance, without concerns about performance degradation due to an excessive number of partitions. > > If the default number of partitions is insufficient for your requirements, please > [Obtaining Services▸](/automq-cloud/support/obtaining-services) > contact us.
> [!NOTE] > > In a production environment, it is recommended that applications strictly adhere to the aforementioned specifications for processing capacity to evaluate resource consumption. This will allow for prompt scaling up or down as needed. This approach helps prevent excessive usage from overloading the cluster, which could impact service stability. #### Calculation Rules Each AutoMQ instance (cluster) allows you to specify the desired AKU specifications when creating or modifying its specifications. The billing system records the real-time consumption of AKU numbers for each instance. * Scope of Statistics: The count of AKUs for each AutoMQ Kafka instance. * Statistics Method: An hourly cycle is used to record the peak value within each cycle. * Aggregation Method: Statistics are aggregated at the instance level. ## Cloud resource fees (paid to cloud providers) Deploying an AutoMQ instance involves resource consumption costs in addition to the subscription fee. Using Alibaba Cloud as an example: | **Cloud Product** | **Specifications and Usage** | **Dependency Description** | | - | - | - | | VM (Virtual Machine) |
  • Specifications: Varies depending on the region.
  • Usage: Scales with the size of the user cluster.
|
  • AutoMQ Kafka's VM consumption changes with the size of the user cluster.
  • At least 1 VM is consumed to deploy the management interface even if no instance is created.
| | Elastic Block Service (Cloud Disk) |
  • Specifications: PL1 type
  • Usage: Each Kafka data node uses 40GB.
|
  • AutoMQ Kafka uses cloud disks to store temporary message data.
| | Object Storage |
  • Specifications: Standard disaster recovery storage
  • Usage: Two buckets per environment; storage capacity scales with user environment resource consumption.
|
  • Core storage dependency of the message cluster.
  • Charges to cloud provider are based on actual space usage and call volume.
| # Usage-Based Billing for AWS Source: https://docs.automq.com/automq-cloud/subscriptions-and-billings/byoc-env-billings/usage-based-billing AutoMQ BYOC supports usage-based billing in AWS environments, where you pay only for what you consume with automatic tiered pricing discounts. This document describes the usage-based billing model for AutoMQ BYOC (Bring Your Own Cloud) environments. With usage-based billing, you pay only for the resources you actually consume, with no upfront commitment or capacity reservation required. > [!NOTE] > > As of August 2026, usage-based billing is available only for AWS environments. For other cloud environments, refer to [Prepaid Billing](/automq-cloud/subscriptions-and-billings/byoc-env-billings/billing-instructions-for-byoc). ## Overview AutoMQ BYOC supports a usage-based billing model that charges based on your actual resource consumption. This model is designed for customers who prefer pay-as-you-go flexibility without the need to estimate capacity in advance. Key characteristics of usage-based billing: * **Pay for what you use.** Charges are calculated based on actual consumption metrics, including data ingress, data egress, data retention, and cluster uptime. * **Tiered pricing.** Unit prices decrease automatically as your monthly usage increases. The more you use, the lower the per-unit cost. * **No partition fees.** AutoMQ does not charge for the number of partitions in your cluster. ## Billing Items The following table summarizes the billing items under the usage-based billing model. | **Billing Item** | **Unit** | **Description** | | - | - | - | | Data Ingress | Per GiB | The volume of data written to the cluster, measured after compression. | | Data Egress | Per GiB | The volume of data read from the cluster, measured after compression. | | Data Retention | Per GiB | The volume of data retained in the cluster. | | Cluster Uptime | Per hour | The running duration of the cluster. As of August 2026, only the Pro tier is available. | > [!TIP] > > All data volume metrics (ingress, egress, and retention) are measured based on compressed data size. For detailed pricing, visit the [AutoMQ Pricing](https://www.automq.com/pricing) page. ## Billing Rules ### Tiered Pricing Usage-based billing applies a tiered pricing structure. As your monthly usage increases, the applicable unit price for each billing item decreases automatically. You do not need to select a pricing tier manually — the system applies the appropriate tier based on your cumulative monthly usage. ### Billing Cycle * **Metering period:** Usage is metered continuously and aggregated on a monthly basis. * **Invoice cycle:** Invoices are generated monthly through AWS Marketplace. * **Settlement:** Payments are processed through your AWS Marketplace account according to your AWS billing schedule. ### Cluster Tier As of August 2026, AutoMQ usage-based billing provides only the Pro cluster tier. | **Cluster Tier** | **Description** | | - | - | | Pro | Suitable for production workloads with higher availability requirements. | ## Configure Usage-Based Billing ### Prerequisites Before configuring usage-based billing, ensure the following: * You have registered an [AutoMQ Cloud](https://www.automq.com) account. * You have an AWS account with permissions to subscribe to products on AWS Marketplace. ### Configure Payment Method Usage-based billing is settled through an AWS Marketplace subscription. The AWS Marketplace subscription corresponds to a payment method in AutoMQ Cloud. You can complete the configuration through either of the following approaches: * **Option 1: Subscribe directly from AWS Marketplace.** Visit the [AutoMQ BYOC - Usage-Based Billing](https://aws.amazon.com/marketplace/pp/prodview-mtkwt73meb222?trk=176b570f-20dd-4b84-aa7e-cae53990fe91\&sc_channel=el\&source=automq) product page on AWS Marketplace, complete the subscription, and bind it to your AutoMQ Cloud account. * **Option 2: Add a payment method from the AutoMQ Cloud Console.** Sign in to the AutoMQ Console, navigate to the **Billing** page, choose **Add Payment Method**, and follow the prompts to subscribe and bind through AWS Marketplace. #### Steps 1. Visit the [AutoMQ BYOC - Usage-Based Billing](https://aws.amazon.com/marketplace/pp/prodview-mtkwt73meb222?trk=176b570f-20dd-4b84-aa7e-cae53990fe91\&sc_channel=el\&source=automq) product page and review the product information and pricing terms. 2. Choose **Subscribe** to complete the subscription. 3. After the subscription is created, choose **Set up your account** and follow the on-screen instructions to bind the subscription to your AutoMQ Cloud account. > [!NOTE] > > Ensure that your AWS account has a valid payment method configured so that AWS Marketplace can process charges. ### Start Using AutoMQ After the payment method is configured, you can create clusters in your BYOC environment. Usage metering begins automatically when a cluster is running. No additional configuration is required. ### View Invoices and Usage You can review your usage and billing details through the following channels: * **AutoMQ Console:** Navigate to the **Billing** page to view usage summaries and billing breakdowns by cluster. * **AWS Marketplace:** Sign in to the [AWS Marketplace Console](https://console.aws.amazon.com/marketplace) and navigate to **Manage subscriptions** to view invoices and payment history. # Overview Source: https://docs.automq.com/automq-cloud/subscriptions-and-billings/overview Billing items, billing models, and payment methods for AutoMQ BYOC. This article describes the billing components and payment methods for AutoMQ BYOC (Bring Your Own Cloud). > [!NOTE] > > In this article, the terms AutoMQ product service provider, AutoMQ service provider, and AutoMQ specifically refer to AutoMQ HK Limited. ## Billing Items Using AutoMQ BYOC incurs the following two types of fees: | **Fee Type** | **Coverage** | **Payment Relationship** | | - | - | - | | **Subscription Fees** | AutoMQ provides AutoMQ BYOC product and technical services | Users pay AutoMQ | | **Cloud Resource Fees** | Fundamental cloud resources consumed by the environment, including but not limited to:
  • Virtual Hosts
  • Block Storage
  • Network Traffic, etc.
| Users pay public cloud providers directly | ## Billing Models AutoMQ BYOC supports two billing models for subscription fees: **Usage-Based Billing** and **Prepaid Billing**. Choose the model that meets your workload and cost management requirements. ### Usage-Based Billing Usage-based billing charges you based on your actual resource consumption, with no upfront commitment required. This model applies automatic tiered pricing — the more you use, the lower the per-unit cost. > [!NOTE] > > As of August 2026, usage-based billing is available only for AWS environments. Support for Google Cloud, Azure, and additional cloud environments is planned. Under this model, the following billing items apply: | **Billing Item** | **Unit** | **Description** | | - | - | - | | Data Ingress | Per GiB | The volume of data written to the cluster, measured after compression. | | Data Egress | Per GiB | The volume of data read from the cluster, measured after compression. | | Data Retention | Per GiB | The volume of data retained in the cluster. | | Cluster Uptime | Per hour | The running duration of the cluster, billed by cluster tier. As of August 2026, only the Pro tier is available. | For detailed information, refer to [Usage-Based Billing▸](/automq-cloud/subscriptions-and-billings/byoc-env-billings/usage-based-billing). ### Prepaid Billing (AKU-Based) The prepaid billing model requires you to purchase a subscription plan in advance on a **monthly or yearly** basis. Subscription fees are based on the AKU (AutoMQ Kafka Unit) specification, which measures the computing resources allocated for message processing within a Kafka cluster. No additional subscription fees are incurred during the subscription period. This model is available for all supported cloud environments. For detailed information about AKU specifications and calculation rules, refer to [Prepaid Billing▸](/automq-cloud/subscriptions-and-billings/byoc-env-billings/billing-instructions-for-byoc). ## Payment Methods ### Usage-Based Billing Usage-based billing is settled through AWS Marketplace on a monthly basis. After subscribing to the AutoMQ product on AWS Marketplace, usage is metered automatically and invoices are generated monthly. For configuration instructions, refer to [Usage-Based Billing▸](/automq-cloud/subscriptions-and-billings/byoc-env-billings/usage-based-billing). ### Prepaid Billing Depending on your requirements, prepaid subscription plans can be purchased through the following channels: * Purchase subscription plans via the cloud marketplace. * Purchase subscription plans through offline business contracts. In prepaid mode, purchase a subscription and use the corresponding ProductSecret to activate the AutoMQ BYOC environment. # Overview Source: https://docs.automq.com/automq/architecture/overview AutoMQ's Shared Storage architecture leverages cloud-native advantages to offer 10x cost efficiency and 100x operational gains over Kafka, with streamlined scalability and stateless brokers. # Architecture Apache Kafka was developed in 2011 for traditional data centers, employing a classic Shared Nothing architecture to solve horizontal scalability challenges. Over time, it has evolved into a Tiered Storage architecture to capitalize on the cost advantages of cloud storage. Today, AutoMQ introduces a Shared Storage architecture that fully leverages the benefits of cloud-native technologies. Compared to Apache Kafka, it provides ten times more cost efficiency and a hundredfold increase in operational efficiency. ## Shared Nothing Architecture ![](https://mintcdn.com/automq/1QgM5miUDiCjXCsL/automq/architecture/overview/1.webp?fit=max\&auto=format\&n=1QgM5miUDiCjXCsL\&q=85\&s=4fbe0c217b636fa09e94e6295185ad4c) The Shared Nothing architecture, a hallmark of Apache Kafka, addresses scalability issues in distributed storage software within traditional data center environments via a compute-storage integration approach. Kafka utilizes an ISR-based replication mechanism to ensure data reliability and system availability. As cloud computing has matured, the demand for business elasticity has grown, revealing the limitations of the classic Shared Nothing architecture. Scaling out Apache Kafka’s Broker nodes involves extensive data replication to complete reassignment, which typically takes several hours. Additionally, Apache Kafka relies on three-replica replication. When deployed on the cloud, users are presented with two storage options: * Selecting cloud storage like EBS for Brokers is costly. EBS's inherent three-replica mechanism, coupled with ISR replication, results in data being stored nine times, leading to significant waste of storage space. * Opting for local disks as the storage medium for Brokers offers more manageable costs, but users face high operational expenses, which negates the benefits of cloud adoption. ## Tiered Storage Architecture ![](https://mintcdn.com/automq/1QgM5miUDiCjXCsL/automq/architecture/overview/2.webp?fit=max\&auto=format\&n=1QgM5miUDiCjXCsL\&q=85\&s=fc45e7e34330ea8ed5b43e734d2d9cb6) As cloud computing has matured and expanded in scale, the initial beneficiary has been object storage. Featuring low storage costs and a pay-as-you-go model, object storage has driven significant evolution in storage software towards the Tiered Storage architecture. As the name suggests, this architecture introduces a secondary storage layer. Here, data is asynchronously transferred to the secondary storage after being initially stored in the primary storage. This approach can partially leverage the cost advantages of object storage while mitigating the elasticity issues of the Shared Nothing architecture. However, the Tiered Storage architecture doesn't fundamentally address the challenges of Apache Kafka for several reasons: * While space usage for primary storage can be decreased, the scope of this reduction varies depending on the scenario, necessitating a thorough capacity evaluation. Additionally, the high EBS costs related to ISR replication are not fully alleviated. * The problem of slow scalability persists; scaling up or down requires reassigning data in primary storage, potentially reducing the time needed from several tens of hours to just a few hours. In simple terms, the primary storage in the Tiered Storage architecture isn't fundamentally different from a Shared Nothing architecture; aside from space reductions, the partition storage layout on the file system and the ISR replication mechanism remain the same. ## Shared Storage Architecture ![](https://mintcdn.com/automq/1QgM5miUDiCjXCsL/automq/architecture/overview/3.webp?fit=max\&auto=format\&n=1QgM5miUDiCjXCsL\&q=85\&s=e1ac39fe61c45c24e7a04cc3a32f39d1) AutoMQ's Shared Storage architecture entirely replaces the Apache Kafka storage layer, innovatively offloading data to cloud storage, which makes Brokers stateless. AutoMQ's shared storage architecture comprises both WAL storage and object storage, with all data being stored in near real-time into object storage. In this architecture: * Object storage serves as the primary data repository, offering elastic, pay-as-you-go, and low-cost data storage solutions. * Due to the high latency and low IOPS characteristics of object storage, AutoMQ introduces a WAL storage layer to enhance data write efficiency and reduce IOPS consumption. * WAL storage can utilize multiple storage services across different cloud platforms. Options include Regional EBS services with multi-AZ disaster recovery, file storage services like AWS EFS and FSx, and even object storage serving simultaneously as WAL and main data storage. AutoMQ encapsulates these storage modules into a custom-developed streaming storage library—**S3Stream**—and replaces Apache Kafka's native Log storage with S3Stream, resulting in completely stateless Broker nodes. This facilitates features like second-level partition reassignment, automatic scaling, and continuous traffic rebalancing. For this purpose, AutoMQ integrates several Controller components within the kernel, such as Auto Scaling and Auto Balancing components, which are responsible for cluster scaling and traffic rebalancing, respectively. It's important to note that AutoMQ Open Source supports only S3-compatible storage services as WAL storage options. This means AutoMQ Open Source is a cloud-native Kafka implementation that relies solely on object storage, leading to a simplified deployment architecture. In contrast, AutoMQ commercial editions offer different WAL options across various cloud providers to support a wider range of workloads. ## Reference \[1]. Kafka ISR Replication Mechanism: [https://kafka.apache.org/documentation/#replication](https://kafka.apache.org/documentation/#replication) \[2]. WAL Wiki:[https://en.wikipedia.org/wiki/Write-ahead\_logging](https://en.wikipedia.org/wiki/Write-ahead_logging) # Overview Source: https://docs.automq.com/automq/architecture/s3stream-shared-streaming-storage/overview AutoMQ's S3Stream offloads Kafka's log storage to cloud storage, combining flexible WAL options and S3 for low-latency, high-throughput, cost-effective stream storage with near-infinite capacity. # S3Stream: Shared Streaming Storage S3Stream is a core stream storage component in AutoMQ, adhering to AutoMQ's concept of decoupling storage and computation. It offloads Apache Kafka's built-in ISR-based log storage layer to object storage and provides accelerated WAL storage capabilities. S3Stream is a stream storage library rather than a distributed storage service. AutoMQ innovatively implements a set of core stream storage APIs on top of object storage, including position management, Append, Fetch, and Trim data. The following code snippet shows several core interfaces of these APIs. ```java theme={null} public interface Stream { /** * Get stream id */ long streamId(); /** * Get stream start offset. */ long startOffset(); /** * Get stream next append record offset. */ long nextOffset(); /** * Append RecordBatch to stream. */ CompletableFuture append(RecordBatch recordBatch); /** * Fetch RecordBatch list from a stream. */ CompletableFuture fetch(long startOffset, long endOffset, int maxBytesHint); /** * Trim stream. */ CompletableFuture trim(long newStartOffset); } ``` ## Core Characteristics of Stream Storage All data on the internet is generated in a streaming manner, then stored and computed in streams to extract the business value of real-time data. This also implies that stream data imposes at least the following requirements on storage: * Low Latency: The greatest value of streaming data lies in its freshness. For example, businesses related to ad recommendations have very high real-time requirements. The faster data is stored and computed, the more value it can provide. * High Throughput: Since all data is generated in a streaming manner, stream storage must support extremely high throughput. Many businesses require at least GiB/s bandwidth. * Low Cost: Massive amounts of streaming data mean high storage costs. Additionally, many businesses need data playback and re-computation capabilities, making daily storage of stream data a business norm. Object storage offers significant advantages in terms of scalability and cost for big data, particularly within data lake ecosystems. However, inherent characteristics of object storage, such as 100ms-level latency per API call and billing by API usage, limit its application in low-latency and high-IOPS storage scenarios, which are critical requirements for stream storage. To overcome this limitation and make object storage suitable for stream storage scenarios, AutoMQ introduces a WAL (Write-Ahead Log) storage module within S3Stream. This module leverages centralized storage to mix data from all partitions of a node into a single WAL file or object, achieving high write efficiency and low IOPS consumption. AutoMQ innovatively combines WAL storage and object storage, addressing the deficiencies of object storage in stream storage scenarios by providing low latency, high throughput, low cost, and nearly unlimited capacity for stream storage. ## S3Stream Architecture ![](https://mintcdn.com/automq/1QgM5miUDiCjXCsL/automq/architecture/s3stream-shared-streaming-storage/overview/1.webp?fit=max\&auto=format\&n=1QgM5miUDiCjXCsL\&q=85\&s=d4650e8f8376ae073152cfc5464efa35) In the core architecture of S3Stream, data is first durably written to the WAL and then almost in real-time uploaded to S3 storage. Additionally, to efficiently support both Tailing Read and Catch-up Read models, S3Stream incorporates a data caching component to accelerate read operations. * WAL Storage: Select different storage media based on your business's latency and durability requirements; options include block storage, object storage, or file storage. * S3 Storage: The largest object storage service offered by cloud providers is selected to provide high-throughput and cost-effective primary data storage services. * Data Caching: Both hot data and prefetched cold data are stored in the cache to accelerate reads. At the same time, an efficient eviction mechanism based on consumer focus ensures optimal memory utilization. Notably, for AutoMQ Open Source, only S3-compatible storage services are supported as a WAL storage option. This indicates that AutoMQ Open Source is a cloud-native Kafka implementation dependent solely on object storage, offering a highly streamlined deployment architecture. For AutoMQ commercial editions, various WAL storage options are provided across different cloud providers to support a broader range of workloads. # S3 Storage Source: https://docs.automq.com/automq/architecture/s3stream-shared-streaming-storage/s3-storage AutoMQ leverages S3 storage for cost-efficient, scalable data storage, ensuring rapid fault recovery with Kafka compatibility. Achieve seamless, real-time traffic balancing and effortless scaling. In the S3Stream repository, S3 storage serves as a core component. The Write-Ahead Log (WAL) is used solely for write acceleration and fault recovery, while S3 is the actual storage location for data. With vast amounts of data migrating to the cloud, object storage has become the de facto storage engine for big data and data lake ecosystems. Today, we see numerous data-intensive software applications transitioning from file APIs to object APIs, and streaming data integration into data lakes, represented by Kafka, is a prevailing trend. S3Stream leverages the Object API to provide efficient streaming data ingestion and retrieval. By employing a storage-compute separation architecture, it integrates Apache Kafka's storage layer with object storage. This approach fully capitalizes on the technical and cost advantages brought by shared storage: * Based on AWS public pricing, Amazon S3 Standard storage is priced at approximately $0.023/GiB/month — roughly one-ninth the price of Amazon EBS gp3 ($0.20/GiB/month) on a per-GiB single-replica basis. Additionally, object storage inherently offers multi-availability zone availability and durability, eliminating the need for additional data replication. Compared to the traditional 3-replica architecture based on EBS gp3 (approximately \$0.60/GiB/month total), this can reduce storage costs by roughly 26×. * The shared storage architecture, in contrast to the Shared-Nothing architecture, truly embodies storage-compute separation, where data is not bound to computing nodes. Consequently, AutoMQ can perform partition reassignment without data duplication, achieving truly lossless partition reassignment in seconds. This capability is fundamental to supporting AutoMQ's real-time traffic self-balancing and second-level node horizontal scaling. ## S3 Storage Architecture ![](https://mintcdn.com/automq/1QgM5miUDiCjXCsL/automq/architecture/s3stream-shared-streaming-storage/s3-storage/1.webp?fit=max\&auto=format\&n=1QgM5miUDiCjXCsL\&q=85\&s=2061872f804c3fd4d1f8655171fc7491) All data in AutoMQ is stored in object storage through S3Stream, defining two types of Objects within object storage: * Stream Set Object: When uploading WAL data, the majority of smaller Streams are consolidated and uploaded as a single Stream Set Object. * Stream Object: The Stream Object contains data from a single Stream, facilitating precise data deletion for Streams with different lifecycles. Data from a single Kafka partition is mapped onto multiple Streams, with two core components: * **Metadata Stream**: This stream stores data indices, Kafka LeaderEpoch snapshots, Producer snapshots, and other metadata. * **Data Stream**: This stream holds the complete Kafka data within the partition. Metadata information of objects on S3 is stored in KRaft. To reduce the scale of metadata in scenarios involving a large number of partitions, the S3Stream internally provides two compaction mechanisms to merge small objects and thereby reduce the metadata scale. ### StreamSet Object Compact **StreamSet Object Compaction** is performed periodically in the background on the Broker at 20-minute intervals. Similar to RocksDB SST, StreamSet Object Compaction selects an appropriate list of StreamSet Objects on the current Broker based on certain policies and merges them using a merge sort method: * Streams that exceed 16MiB after merging will be split into individual Stream Objects and uploaded separately; * The remaining Streams are merged and written into a new StreamSet Object using merge sort. Merge sorting for StreamSet Object compaction can merge up to 15TiB of StreamSet Objects under the constraints of 500MiB memory usage and a 16MiB read/write range size. Through StreamSet Object Compact, fragmented small stream data segments are merged into larger data segments, significantly reducing API calls and enhancing read efficiency for cold data catch-up read scenarios. ### Stream Object Compact The core purpose of Stream Object Compact is to minimize the total amount of metadata required to maintain object mapping in the cluster and to improve the aggregation of Stream Object data, thereby reducing API call costs for cold data catch-up read. Stream Objects involved in Compact are typically already 16MB, meeting the minimum part limit of object storage. Stream Object Compact uses the MultiPartCopy API of object storage to directly perform range copy uploads, avoiding the waste of network bandwidth from reading and then writing back to object storage. ## Multi-Bucket Architecture As one of the most critical storage services offered by various cloud providers, object storage provides twelve nines of data durability and up to four nines of availability. However, software failures can never be completely eliminated, and object storage can still experience significant software failures, rendering AutoMQ services unavailable. On the other hand, multi-cloud, multi-region, and even hybrid cloud architectures are gradually emerging to meet enterprises' more flexible IT governance needs. In view of this, AutoMQ commercial editions innovatively adopt a multi-bucket architecture to further enhance system availability and meet enterprises' more flexible IT governance needs. ![](https://mintcdn.com/automq/1QgM5miUDiCjXCsL/automq/architecture/s3stream-shared-streaming-storage/s3-storage/2.webp?fit=max\&auto=format\&n=1QgM5miUDiCjXCsL\&q=85\&s=5f178ab93bd2d854187ad0b86ead0c6e) AutoMQ commercial editions support configuring one or multiple buckets for data storage, and S3Stream supports four different write strategies to meet various business scenarios. ### **Round Robin** Multiple Buckets are treated equally, and data is written to them in a round-robin manner. This method is generally used to bypass the bandwidth limitations imposed by Cloud providers on a single Bucket or account. For instance, if a single Bucket supports only 5 GiB/s of bandwidth, combining two Buckets can achieve 10 GiB/s of bandwidth, supporting ultra-high traffic business scenarios. ### **Failover** Object storage can still experience failures, and software-level failures can sometimes be more severe than zone-level failures. For business scenarios with extremely high availability requirements, data can be written to two Buckets using a failover approach. The Bucket configuration in a failover scenario might be: * One as the primary Bucket, located in the same region as the business, where data is preferentially written. * Another as a standby Bucket, created in a different region or even on a different Cloud. Connectivity between the primary and standby regions is established through dedicated lines or the public internet. When the primary region's object storage is unavailable, new data is submitted to the standby Bucket. Although the standby link incurs higher network costs, these costs are relatively controllable since they only occur when the primary Bucket is unavailable. This write strategy significantly enhances AutoMQ's disaster recovery scenarios, enabling AutoMQ to build multi-region disaster recovery, multi-cloud disaster recovery, and even hybrid cloud disaster recovery architectures at a low cost. ### **Replication** A failover-based multi-bucket architecture only redirects write traffic during failures, while read operations must wait for delayed reads. If your business cannot tolerate read delays during failures and requires an active-active read/write architecture, you can configure the write strategy to be in a replication mode, where data is synchronously written to multiple buckets. This approach is very costly and is only suitable for mission-critical applications. ### Dynamic Sharding Data is written to multiple buckets in a dynamic, adjustable ratio, with round-robin being a specific scenario of this strategy. Dynamic sharding write methods are often suitable for multi-cloud and hybrid cloud architectures. In this architecture, you configure buckets across different cloud services or combine Public Cloud and Private Cloud object storage. By dynamically adjusting the traffic ratio, the architecture can always maintain the flexibility for multi-cloud migration or even cloud exit. # WAL Storage Source: https://docs.automq.com/automq/architecture/s3stream-shared-streaming-storage/wal-storage AutoMQ’s WAL storage offers scalable, low-latency data persistence with Kafka compatibility. Supports EBS, S3 WAL, and innovative multi-WAL solutions for cost efficiency. In the stream storage repository S3Stream, WAL is one of the core components. WAL storage primarily addresses issues such as high latency when using object storage as the main data store and low efficiency in writing to multiple partitions. It has two primary responsibilities: * Providing low-latency, high-performance data persistence writes. Once the data is successfully written to WAL, confirmation is returned to the client. * During a Broker node failure that requires failover, it recovers data from WAL that has not been timely uploaded to S3. ## WAL Storage Implementation **WAL** is implemented as a fixed-size, cyclically written storage space. Various storage media can be selected, but the implementation mainly considers the following points: * Centralized writes, unlike Apache Kafka®, AutoMQ does not need to write separate log files for each partition. By mixing the data from all partitions into the WAL, it supports efficient writing in scenarios with a large number of partitions. * Sequential writes and group commits, data is written sequentially into the WAL, combined with the group commit mechanism, requiring only a small amount of IOPS to achieve high-throughput writes. * **Direct IO Writing:** Data is directly written through to the storage medium to fully utilize the durability of cloud storage. Write operations are considered successful only upon confirmation, unaffected by the operating system's Page Cache dirty page collection. * **Support for Raw Device Writing\[1]:** AutoMQ needs to write only one file. If EBS is used as the storage medium, it can be used directly as a raw device for writing, without the need to mount a file system, thereby avoiding additional overhead brought by the file system. This ensures optimal performance and latency. Through the aforementioned technology, WAL storage significantly reduces the dependency of stream storage systems on IOPS, addressing the issues of low write efficiency and high API call costs associated with object storage, thus making S3Stream widely applicable. AutoMQ supports both latency-sensitive and high-throughput systems. ## WAL Storage Medium Selection Public Cloud providers generally offer three types of storage services, namely: * **Block storage**, such as AWS EBS, Azure Zone-redundant Disk, GCP Regional Persistent Disk, and Alibaba Cloud Regional ESSD. Among these services, EBS adopts a single AZ multi-copy architecture, while the other block storages use a multi-AZ multi-copy architecture, collectively referred to as Regional EBS. * **Object storage** is the most standard storage service provided by cloud providers, with virtually all cloud providers supporting the standard S3 protocol. * File storage, primarily NFS protocol-based file storage services, is also widely used in big data and other business scenarios, such as AWS EFS and AWS FSx series. ![](https://mintcdn.com/automq/1QgM5miUDiCjXCsL/automq/architecture/s3stream-shared-streaming-storage/wal-storage/1.webp?fit=max\&auto=format\&n=1QgM5miUDiCjXCsL\&q=85\&s=9381acec274aebdba6449ba40dd02d35) The aforementioned storage mediums can be used as WAL storage mediums, with specific differences as shown in the table below. | - | EBS & Regional EBS WAL | S3 WAL | NFS WAL | | - | - | - | - | | Multi AZ |
  • EBS has a single AZ multi-replica architecture
  • Regional EBS has a multi AZ multi-replica architecture
| S3 offers both single AZ and multi AZ product options | NFS offers both single AZ and multi AZ product options | | Durability | Between 5 nines and 9 nines | Around 11 nines | Around 11 nines | | Latency | Sub-millisecond | Hundred-millisecond | Millisecond-level | | Cost | Low | Low | Moderate | | Applicable Scenarios | Regional EBS is suitable for all Kafka use cases | Suitable for most latency-insensitive scenarios, such as logging and monitoring | Low-latency solutions on AWS, such as core transaction matching scenarios | In scenarios where AutoMQ chooses S3 WAL, S3 simultaneously offers both WAL storage and primary storage services. The WAL storage is optimized for writes, requiring fewer S3 API calls. Especially in environments with numerous partitions, S3 WAL provides efficient data ingestion capabilities, while the primary storage component supports efficient data consumption through various compaction mechanisms. Notably, for AutoMQ Open Source, only S3-compatible storage services are supported as WAL storage options. This indicates that AutoMQ Open Source is a cloud-native Kafka implementation that relies solely on object storage, with a minimal deployment architecture. For AutoMQ commercial editions, different WAL options are available on various cloud providers to support more workloads. ## References \[1]. How AutoMQ Achieves High-Performance WAL Based on Raw Devices: [https://www.automq.com/blog/principle-analysis-how-automq-implements-high-performance-wal-based-on-raw-devices](https://www.automq.com/blog/principle-analysis-how-automq-implements-high-performance-wal-based-on-raw-devices) \[2]. Azure Regional EBS: [https://learn.microsoft.com/en-us/azure/virtual-machines/disks-redundancy#zone-redundant-storage-for-managed-disks](https://learn.microsoft.com/en-us/azure/virtual-machines/disks-redundancy#zone-redundant-storage-for-managed-disks) \[3]. GCP Regional EBS: [https://cloud.google.com/compute/docs/disks/regional-persistent-disk](https://cloud.google.com/compute/docs/disks/regional-persistent-disk) \[4]. Alibaba Cloud Regional EBS: [https://developer.aliyun.com/special/live/regionalessd\_bdrc](https://developer.aliyun.com/special/live/regionalessd_bdrc) \[5]. AWS EFS: [https://aws.amazon.com/efs/](https://aws.amazon.com/efs/) \[6]. AWS FSx: [https://aws.amazon.com/fsx/netapp-ontap/](https://aws.amazon.com/fsx/netapp-ontap/) # 5x Catch-up Read Efficiency Source: https://docs.automq.com/automq/architecture/technical-advantage/5x-catch-up-read-efficiency AutoMQ offers 5x catch-up read efficiency over Apache Kafka with cold and hot data isolation, cloud-native scalability, Kafka compatibility, and better cost efficiency. Apache Kafka users have long been plagued by KAFKA-7504\[1], a performance issue that remains unresolved to this day. When a cold read occurs in an Apache Kafka cluster, if it cannot be quickly resolved, more and more tail read operations will also be slowed down, gradually exerting a significant impact on the traffic write operations. ## Apache Kafka Cold Read Issue ![](https://mintcdn.com/automq/1QgM5miUDiCjXCsL/automq/architecture/technical-advantage/5x-catch-up-read-efficiency/1.webp?fit=max\&auto=format\&n=1QgM5miUDiCjXCsL\&q=85\&s=8217ff95558da5779cea873b0fd495c4) Apache Kafka's read and write paths introduce two key technologies: Page Cache\[2] and zero-copy SendFile\[3] system call. * The Page Cache greatly simplifies Kafka's memory management burden, which is entirely handled by the kernel. However, there is an issue where hot and cold data cannot be separated. If a service continuously performs cold reads, it will compete for memory resources with hot data, leading to a continuous decline in tail read capabilities. * SendFile is a critical technology for Kafka's zero-copy feature, but this call occurs in Kafka's network thread pool. If SendFile needs to copy data from the disk (in a cold read scenario), it will partially block this thread pool. Since this thread pool handles Kafka requests, including write requests, the blocking behavior of SendFile will significantly impact Kafka's write operations. ## AutoMQ Cold and Hot Data Isolation Architecture ![](https://mintcdn.com/automq/TNthwGcCx3_sZs9Z/automq/architecture/technical-advantage/5x-catch-up-read-efficiency/2.gif?s=4053b329786011a4938828f45c11e2a2) From the very first day of its design, AutoMQ fully considered the cold and hot data isolation issue faced by asynchronous message middleware. In AutoMQ's architecture, there are three key data paths: * Write Path: Data is persistently written into WAL storage in the form of Direct IO, without relying on Page Cache. The data is written through to WAL before returning success to the client, completely separating it from the data read path. * Tail Read Path * Cold Read Path ## Cold Read Performance Evaluation of AutoMQ The following table results are derived from the actual benchmark of AutoMQ vs. Kafka ([Benchmark: AutoMQ vs. Apache Kafka▸](/automq/benchmarks/automq-vs-apache-kafka-benchmarks-and-cost)), demonstrating that under the same load and machine types, AutoMQ maintains the same level of cold read performance as Kafka without affecting write throughput and latency. | Comparison Item | Send Latency During Cold Read | Impact on Send Traffic During Cold Read | Cold Read Efficiency (Time to Read 4TiB Data) | | - | - | - | - | | AutoMQ | Less than **3ms** | Read-write isolation, maintains **800 MiB/s** | 42 minutes | | Apache Kafka | Approximately **800ms** | Mutual impact, drops to **150 MiB/s** | 215 minutes | From the results, it can be seen that AutoMQ has no impact on send latency during cold reads, whereas Apache Kafka deteriorates to second-level latency, and write traffic continuously drops. In terms of cold read efficiency, reading 4TiB of data, AutoMQ offers a 5-fold improvement in efficiency. ## Advantages of Hot and Cold Data Isolation After resolving performance issues related to hot and cold data isolation, AutoMQ's architecture becomes more tenant-friendly. Although AutoMQ benefits from second-level scalability, it is recommended to configure separate clusters for each business to avoid mixing workloads, thereby reducing costs. However, for businesses with very low traffic, mixing workloads within a single cluster can effectively reduce the number of clusters. AutoMQ's hot and cold data isolation feature completely addresses stability issues in multi-tenant scenarios. Additionally, AutoMQ fully leverages the high throughput characteristics of object storage, achieving a 5-fold increase in cold read efficiency. This allows for quick data replay to meet business needs promptly. ## Reference \[1] Kafka Cold Read Performance Issue: [https://issues.apache.org/jira/browse/KAFKA-7504](https://issues.apache.org/jira/browse/KAFKA-7504) \[2] Linux Page Cache: [https://en.wikipedia.org/wiki/Page\_cache](https://en.wikipedia.org/wiki/Page_cache) \[3] Linux SendFile: [https://man7.org/linux/man-pages/man2/sendfile.2.html](https://man7.org/linux/man-pages/man2/sendfile.2.html) # Continuous Self-Balancing Source: https://docs.automq.com/automq/architecture/technical-advantage/continuous-self-balancing AutoMQ offers cloud-native scalability and seamless Kafka compatibility with second-level partition reassignment, ensuring efficient, automatic data self-balancing and optimal traffic distribution. In an online Apache Kafka® cluster, fluctuations in traffic, Topic creation and deletion, and Broker failures and restarts are constantly occurring. These changes can lead to an uneven distribution of traffic across cluster nodes, resulting in resource wastage and impacting business stability. It is essential to proactively reassign different partitions of a Topic across nodes to balance traffic and data. ## Challenges Faced by Open Source Solutions Apache Kafka has always faced significant challenges in achieving self-balancing of data. The community has two solutions: * The official Apache Kafka partition reassignment tool requires operations personnel to devise specific reassignment plans. For Kafka clusters with hundreds or thousands of nodes, it is nearly impossible to manually monitor the cluster state and create a comprehensive partition reassignment plan. * The community also offers third-party external plugins such as Cruise Control\[1] to assist in generating reassignment plans. However, due to the extensive variables involved in Apache Kafka's self-balancing process (replica distribution, leader traffic distribution, node resource utilization, etc.) and the resource contention and hours-to-days-long duration caused by data synchronization, existing solutions are complex and have low decision timeliness. Implementing data self-balancing strategies still relies on operations personnel's review and continuous monitoring, failing to truly address the challenges posed by Apache Kafka data self-balancing. ## AutoMQ's Architectural Advantages Thanks to AutoMQ's deep integration with cloud-native capabilities, we have reimplemented Apache Kafka's underlying storage entirely based on cloud object storage, upgrading from a Shared Nothing architecture to a Shared Storage architecture. This enables second-level partition reassignment capabilities, greatly simplifying the factors involved in reassignment planning: * There is no need to consider node disk resources. * No need to consider the leader distribution and replica distribution of partitions. * The reassignment of partitions does not involve data synchronization and copying. Therefore, we have the opportunity to implement a built-in, lightweight automatic data balancing component within AutoMQ, which continuously monitors cluster status and automatically performs partition reassignment. ## AutoMQ Data Self-Balancing Implementation ![](https://mintcdn.com/automq/1QgM5miUDiCjXCsL/automq/architecture/technical-advantage/continuous-self-balancing/1.webp?fit=max\&auto=format\&n=1QgM5miUDiCjXCsL\&q=85\&s=de2d4454c8a7891ebe7e54d7706b3017) The figure above is the architecture diagram of AutoMQ's built-in Auto Balancing component. This architecture collects cluster metrics, automatically generates partition reassignment plans, and continuously balances the cluster's traffic. AutoMQ implements Apache Kafka's MetricsReporter interface, monitoring all built-in metrics information of Apache Kafka. It periodically samples metrics of interest (such as network ingress and egress traffic, CPU utilization, etc.) and pre-aggregates these metrics on the Broker side. The aggregated metrics are serialized into a Kafka message and sent to a designated internal Topic. The AutoMQ Controller maintains an in-memory cluster state model to describe the current state of the cluster, including Broker status, Broker resource capacity, and the traffic information of Topic-Partition managed by each Broker. By listening to KRaft Log event information, the cluster state model can promptly sense changes in the status of Broker and Topic-Partition and update the model accordingly to remain consistent with the actual cluster state. Meanwhile, the metrics collector in the AutoMQ Controller consumes messages from the internal Topic in real-time, deserializes the messages into specific metrics, and updates them into the cluster state model, thereby constructing all the prerequisite information needed for data self-balancing. AutoMQ Controller's scheduler periodically captures snapshots of the cluster state model and identifies overutilized or underutilized brokers based on predefined "goals." It then attempts to reassign or exchange partitions to achieve traffic self-balancing. ## AutoMQ Data Self-Balancing Example ![](https://mintcdn.com/automq/1QgM5miUDiCjXCsL/automq/architecture/technical-advantage/continuous-self-balancing/2.webp?fit=max\&auto=format\&n=1QgM5miUDiCjXCsL\&q=85\&s=5d8432cb4441f39fc8db657b00e0b52d) Consider a three-node AutoMQ cluster. Initially, each of the three nodes handles approximately 40MiB/s of write traffic. In the second phase, the traffic for Broker-0 is increased to about 80MiB/s, Broker-1 to about 120MiB/s, and Broker-2 remains at 40MiB/s. As shown in the figure above, automatic load balancing is triggered in the second phase, and the traffic across the three brokers gradually converges to a balanced range. > [!NOTE] > > NOTE: In this scenario, to facilitate observation, the partition reassignment cooldown time is manually extended. With the default configuration, the traffic balancing time is approximately 1 minute. ## Quick Experience Refer to [Example: Continuous Data Self-Balancing▸](/automq/getting-started/explore-automq/example-continuous-data-self-balancing) to experience the continuous data self-balancing capabilities of AutoMQ. ## References \[1]. LinkedIn's open-source Cruise Control tool: [https://github.com/linkedin/cruise-control](https://github.com/linkedin/cruise-control) # Native Compatible with Apache Kafka Source: https://docs.automq.com/automq/architecture/technical-advantage/native-compatible-with-apache-kafka AutoMQ ensures 100% compatibility with Apache Kafka's protocol and semantics, providing cloud-native scalability, cost-efficient storage solutions, and seamless integration. Currently, many industry products are compatible with the Apache Kafka® protocol, such as Redpanda and Kafka on Pulsar. AutoMQ believes that starting from scratch to adapt to the Kafka protocol can hardly achieve complete compatibility in every detail, and would also involve a significant amount of repetitive and unnecessary intellectual effort. The Kafka protocol has 113 ErrorCodes and 68 APIs, with the Fetch API alone having 15 versions. Achieving 100% compatibility with the Kafka protocol and semantics is extremely challenging. Furthermore, as Apache Kafka® evolves, maintaining compatibility with the Kafka protocol over time is also a major challenge. Compatibility with the Kafka protocol and semantics is a critical consideration for users when choosing Kafka products. Therefore, the architectural design of AutoMQ mandates 100% compatibility with the Apache Kafka® protocol and semantics, and ensures continuous alignment with Apache Kafka®. ## Current State of the Apache Kafka® Protocol Apache Kafka® has been developed for over 10 years, with contributions from over 1000+ contributors, leading to 1059 KIPs \[1]. The entire codebase contains hundreds of thousands of lines of code, incorporating numerous features, optimizations, and fixes. Building a Kafka-compatible API protocol and semantics from scratch would not only require extensive development effort but is also prone to errors. The Apache Kafka® architecture is composed of a compute layer and a storage layer: * Compute Layer: Constitutes 98% of the total codebase, carrying Kafka's API protocol and features. Additionally, the compute layer has numerous system optimizations tailored for stream storage, such as end-to-end batch design and zero-copy mechanisms, enabling 1GiB/s throughput with just 2 CPU cores. * Storage Layer: Makes up 2% of the total codebase and is responsible for the high-durability storage of messages. As a stream processing pipeline, Apache Kafka® stores vast amounts of data over time. The majority of the cost for an Apache Kafka® cluster stems from data storage expenses and the costs associated with machines deployed for compute-storage integration. ## AutoMQ Natively Supports the Kafka Protocol AutoMQ aims to upgrade Apache Kafka® to a shared storage architecture by adopting a compute-storage separation architecture. The optimal solution is to replace Kafka’s storage layer while retaining its native compute layer. The advantages of this approach include: * It allows for the reuse of 98% of Apache Kafka's compute layer code, ensuring API protocol & semantic compatibility and feature alignment. * It enables the replacement of the storage layer with cloud-native storage services, leveraging the technical and cost benefits of shared storage and cloud-native technologies. ![](https://mintcdn.com/automq/1QgM5miUDiCjXCsL/automq/architecture/technical-advantage/native-compatible-with-apache-kafka/1.webp?fit=max\&auto=format\&n=1QgM5miUDiCjXCsL\&q=85\&s=59c156584d07f9d2bf2f9738d3d5b57b) Although Apache Kafka exposes a stream abstraction modeled by Partitions at the business logic layer, internally, Kafka’s log recovery, transaction indexing, timestamp indexing, and reading operations are all based on Log Segments. This means that Log Segment is the smallest operational unit of Kafka storage. Therefore, Segment is the optimal cut point to implement the compute-storage separation architecture in AutoMQ. By implementing shared Segment semantics based on S3Stream, we can reuse the logic of upper-layer LocalLog, LogCleaner, and Partition, thereby maximizing the reuse of Apache Kafka code. In addition to achieving native support for Kafka protocol in terms of architectural design, AutoMQ has also passed Apache Kafka's 500+ system test cases (KRaft mode). This test suite covers Kafka functionalities (message sending/receiving, consumer management, Topic Compaction, etc.), client compatibility (>= 0.9), operations (partition reassignment, rolling restart, etc.), Stream, and Connector testing. This ensures 100% protocol and semantic compatibility for AutoMQ from a practical operational standpoint. ## References \[1]. Apache Kafka KIP List: [https://cwiki.apache.org/confluence/display/kafka/kafka+improvement+proposals](https://cwiki.apache.org/confluence/display/kafka/kafka+improvement+proposals) # Overview Source: https://docs.automq.com/automq/architecture/technical-advantage/overview AutoMQ offers cloud-native scalability and efficiency with 100% Kafka API compatibility, enabling second-level scaling, seamless partition reassignment, and continuous self-balancing. AutoMQ adopts a storage-compute separation approach, evolving Apache Kafka® from a Shared Nothing architecture to a Shared Storage architecture. This shift enables full utilization of cloud-native technology and cost advantages. Technically, the shared storage architecture offers inherent benefits in addressing operational challenges like partition reassignment and automatic scaling. AutoMQ leverages these benefits through product capabilities, as shown in the table below. | Advantages | AutoMQ | Apache Kafka® | | - | - | - | | Native support for Kafka protocol | ✅ Natively supported, reuses protocol layer code | ✅ Natively supported | | Second-level partition reassignment | ✅ Shared storage, no need to copy data during reassignment | ❌ Reassigns local data, typically takes hours per partition | | Second-level smooth scaling | ✅ Achieves second-level scaling by bulk reassigning partitions | ❌ Due to data copying during partition reassignment, cannot support fast scaling, typically takes tens of hours | | Continuous self-balancing | ✅ Built-in Auto Balancing component, dynamically adjusts traffic to eliminate hotspots | ❌ Prone to local hotspots, affecting stability | | Stateless Broker | ✅ Data offloaded to shared storage, Brokers are stateless and can use Spot instances | ❌ Local disk state, requires extensive data transfer for decommissioning | | Cold-hot isolation, 5x cold read efficiency | ✅ Out-of-the-box cold-hot isolation capability, supports multi-tenant business scenarios | ❌ Cold and hot data affect each other, exacerbating system degradation, cannot support multi-tenant scenarios | # Partition Reassignment in Seconds Source: https://docs.automq.com/automq/architecture/technical-advantage/partition-reassignment-in-seconds AutoMQ enables second-level partition reassignments with its shared storage architecture, ensuring real-time scalability, high cost efficiency, and full Kafka compatibility for seamless cloud-native operations. Partitions are the core resource model in Apache Kafka®, serving as the primary conduit for client read and write traffic. As the number of partitions in a cluster increases, uneven partition distribution and hotspot partitions can occur. Consequently, partition reassignments are a common high-frequency operation in the day-to-day maintenance of Apache Kafka®. In the Shared Nothing architecture of Apache Kafka®, partition reassignment involves replicating large amounts of data. For example, a Kafka partition with a 100MiB/s traffic rate generates approximately 8.2TB of data in one day. If this partition needs to be reassigned to another broker, the entire dataset must be replicated. Even with nodes that have 1 GBps bandwidth, this reassignment would take hours to complete, rendering Apache Kafka® clusters nearly incapable of real-time elasticity. Thanks to AutoMQ's shared storage architecture, partition reassignments require syncing only a small amount of data, reducing reassignment time to seconds. ## How AutoMQ Achieves Second-Level Partition Reassignments ![](https://mintcdn.com/automq/1QgM5miUDiCjXCsL/automq/architecture/technical-advantage/partition-reassignment-in-seconds/1.webp?fit=max\&auto=format\&n=1QgM5miUDiCjXCsL\&q=85\&s=bbfd1dfed2f9dac0457d404f7284d1a8) In AutoMQ's shared storage architecture, almost all data is stored in object storage, with minimal data temporarily residing in WAL storage. During a partition reassignment, only the data that has not yet been uploaded to object storage and is temporarily held in WAL needs to be forcibly uploaded. This process allows the partition to be safely transferred to another node, typically within about 1.5 seconds. The specific reassignment process is illustrated in the figure above, using the example of reassigning partition P1 from Broker-0 to Broker-1: 1. When the KRaft Controller receives a partition reassignment command, it constructs the corresponding PartitionChangeRecord and commits it to the KRaft Log layer. This action removes Broker-0 from the Leader Replica list and adds Broker-1 to the Follower Replica list. Broker-0, upon syncing the KRaft Log and detecting the P1 partition change, initiates the partition shutdown process. 2. During the partition shutdown, if P1 contains data that has not yet been uploaded to object storage, a forced upload is triggered. In a stable running cluster, this data typically amounts to a few hundred megabytes. Given the burst network bandwidth capabilities provided by current cloud providers, this process usually takes only seconds. Once P1's data upload is complete, the partition can be safely closed and deleted from Broker-0. 3. After the Broker completes its shutdown, it will proactively trigger a leader election. At this point, Broker-1, being the sole Replica, is promoted to the Leader of P1, and the partition recovery process begins. 4. During partition recovery, the metadata corresponding to P1 is fetched from the object storage to restore the relevant Checkpoint for P1. Depending on P1's shutdown state (whether it was a Cleaned Shutdown), the corresponding data recovery is performed. 5. At this point, the partition reassignment is complete. ## Significance of Second-Level Partition Reassignment In a production environment, a Kafka cluster typically serves multiple applications. Fluctuations in application traffic and partition distribution can cause cluster capacity issues or machine hotspots. Kafka operations personnel need to expand the cluster and reassign hotspot partitions to idle nodes to ensure the availability of cluster services. The time taken for partition reassignment determines the efficiency of emergency response and maintenance: * The shorter the partition reassignment time, the shorter the duration from cluster expansion to meeting capacity demands, and the shorter the service disruption time. * Faster partition reassignment results in shorter observation times for operations personnel, enabling quicker operational feedback and decision-making for subsequent actions. In the architecture of AutoMQ, partition reassignment within seconds is the foundation for many automation capabilities, including automatic scaling, descaling, and continuous self-balancing of traffic. ## Quick Experience Refer to [Example: Partition Reassignment in Seconds▸](/automq/getting-started/explore-automq/example-partition-reassignment-in-seconds) to experience the partition reassignment capabilities of AutoMQ in seconds. # Scale-out/in in Seconds Source: https://docs.automq.com/automq/architecture/technical-advantage/scale-outin-in-seconds AutoMQ offers rapid, cloud-native scalability in seconds with seamless Kafka compatibility, reducing resource waste and ensuring cost efficiency with automatic scaling based on business traffic. In the cloud-native era, leveraging the elasticity provided by cloud providers, we can efficiently scale a cluster at the node level using AWS Auto Scaling Groups \[1] or Alibaba Cloud's ESS Auto Scaling Groups \[2]. However, due to the need for traffic reassignment, Apache Kafka® clusters often cannot directly utilize the elasticity provided by cloud providers and require manual intervention from operations personnel to move the traffic, which typically takes hours. For online clusters with frequent traffic fluctuations, this makes it almost impossible to scale on demand. To ensure cluster stability, operations personnel have to pre-deploy according to maximum capacity to avoid risks associated with untimely scaling during traffic peaks, leading to significant resource wastage. ## How AutoMQ Achieves Smooth Scaling in Seconds ![](https://mintcdn.com/automq/1QgM5miUDiCjXCsL/automq/architecture/technical-advantage/scale-outin-in-seconds/1.webp?fit=max\&auto=format\&n=1QgM5miUDiCjXCsL\&q=85\&s=bee3bd0b0cc83e4d9d199c6f3a91a5fb) AutoMQ's capability for rapid scaling relies on an atomic capability, namely partition reassignment in seconds (see [Partition Reassignment in Seconds▸](/automq/architecture/technical-advantage/partition-reassignment-in-seconds)). When using Auto Scaling Groups (ASG) or Kubernetes' Horizontal Pod Autoscaler (HPA)\[3] to add nodes, you only need to reassign some partitions in the cluster to the new nodes to achieve traffic self-balancing (see [Continuous Self-Balancing▸](/automq/architecture/technical-advantage/continuous-self-balancing)), which can often be completed within ten seconds. ### Triggering Scaling Taking AWS Auto Scaling Groups (ASG) as an example, by configuring traffic threshold monitoring, when the cluster traffic reaches the scaling threshold, new broker nodes are automatically launched. At this point, the Controller detects the traffic imbalance and automatically moves partitions to the newly created brokers, completing the traffic redistribution. The figure below shows the change in the number of brokers in an AutoMQ Kafka cluster as the traffic increases. It can be seen that brokers are dynamically created and added to the cluster to balance the load as traffic increases linearly. ![](https://mintcdn.com/automq/1QgM5miUDiCjXCsL/automq/architecture/technical-advantage/scale-outin-in-seconds/2.webp?fit=max\&auto=format\&n=1QgM5miUDiCjXCsL\&q=85\&s=f97fda6734651824a7b9e8db84bdd139) The figure below shows the traffic changes across broker nodes during traffic increases. It can be seen that the newly created brokers complete traffic rebalancing within ten seconds. ![](https://mintcdn.com/automq/1QgM5miUDiCjXCsL/automq/architecture/technical-advantage/scale-outin-in-seconds/3.webp?fit=max\&auto=format\&n=1QgM5miUDiCjXCsL\&q=85\&s=7006252244c0ee496da638e1e1a1f573) ### Triggering Scale Down Taking AWS Auto Scaling Groups as an example, when the cluster traffic reaches the scale-down threshold, the Broker node to be scaled down will undergo a graceful shutdown process. During this time, the partitions on the Broker will be reassigned in a round-robin manner to the remaining Brokers within seconds, completing the graceful shutdown and traffic transfer. The figure below shows the change in the number of Brokers in an AutoMQ Kafka cluster as traffic decreases. You can observe that as traffic linearly decreases, Brokers are dynamically shut down to save resources. ![](https://mintcdn.com/automq/1QgM5miUDiCjXCsL/automq/architecture/technical-advantage/scale-outin-in-seconds/4.webp?fit=max\&auto=format\&n=1QgM5miUDiCjXCsL\&q=85\&s=6d3b097c238bdabb51694de63c8c350c) The figure below illustrates the changes in traffic across Broker nodes during traffic decline. It is evident that the load on the shutting down Broker is transferred to the remaining Brokers (whenever a Broker is shut down, the traffic on the remaining Brokers significantly increases). ![](https://mintcdn.com/automq/1QgM5miUDiCjXCsL/automq/architecture/technical-advantage/scale-outin-in-seconds/5.webp?fit=max\&auto=format\&n=1QgM5miUDiCjXCsL\&q=85\&s=3565759aa5974ca4831bdefbc6f0661c) > [!NOTE] > > In the above example, to facilitate observation, the ASG's scale-up and scale-down cooldown times were artificially increased, and process startup and destruction delays were added. ## Advantages of Automatic Scaling AutoMQ's shared storage architecture inherently supports rapid automatic scaling, which is also the foundation for achieving Serverless. The automatic scaling capabilities of AutoMQ provide at least the following advantages: * Cost advantages: There is no need to prepare resources based on peak demand. Resources automatically scale according to business traffic, effectively handling tidal and burst-type workloads, with payment based on usage and no wasted idle resources. * Stability advantages: Seamless scaling without causing additional traffic pressure on the cluster. This allows for lossless scaling even under high watermarks. In contrast, scaling in Apache Kafka® is a high-risk operation that can only be performed under low watermarks. * Multi-tenant advantages: Clusters with automatic scaling capabilities eliminate the need to mix multiple businesses to improve resource utilization. It is entirely possible to configure an independent cluster for each business. Each independent cluster can scale according to its own traffic model. This ensures cost advantages while preventing global impact if a particular business encounters issues. ## References \[1]. AWS Auto Scaling Groups: [https://docs.aws.amazon.com/autoscaling/ec2/userguide/auto-scaling-groups.html](https://docs.aws.amazon.com/autoscaling/ec2/userguide/auto-scaling-groups.html) \[2]. Alibaba Cloud ESS Elastic Scaling Group: [https://www.aliyun.com/product/ecs/ess](https://www.aliyun.com/product/ecs/ess) \[3]. Kubernetes HPA Component for Scaling: [https://kubernetes.io/docs/tasks/run-application/horizontal-pod-autoscale/](https://kubernetes.io/docs/tasks/run-application/horizontal-pod-autoscale/) # Stateless Broker Source: https://docs.automq.com/automq/architecture/technical-advantage/stateless-broker AutoMQ leverages cloud-native scalability by separating storage and compute, making Broker nodes stateless and reducing costs with Spot instances. Fully Kafka-compatible. AutoMQ utilizes the separation of storage and compute to offload Kafka's storage layer to cloud storage via S3Stream, making Broker nodes stateless. Stateless Brokers have significant advantages in operations and scalability. Additionally, stateless AutoMQ can be deployed using Spot instances on the cloud, further reducing computing costs. ## Advantages of Statelessness Storage software that adopts a storage-compute integrated architecture is generally stateful software, facing significant challenges in operations, scaling, and downsizing. AutoMQ transforms Apache Kafka® into stateless storage software, making operating AutoMQ as simple as managing a microservice application. * Simplified Operations: For AutoMQ, daily operations become sufficiently simple. After a Broker node shuts down, its state is completely transferred, with clients entirely unaffected. Operations personnel have ample time to decide whether the shut-down Broker needs to be brought back online or decommissioned permanently. Cluster upgrades can also be completed at low cost and risk through rolling updates. * Automatic Scaling: Stateless AutoMQ can scale up or down freely, similar to a microservice application or a Kubernetes Deployment, achieving true auto-scaling and saving significant costs. * Use of Spot Instances: Cloud providers offer Spot instances at significantly lower prices than regular virtual machines in many regions. However, due to the nature of Spot instances being subject to termination at any time, only stateless applications can take advantage of them. # AutoMQ vs. Apache Kafka Benchmarks and Cost Source: https://docs.automq.com/automq/benchmarks/automq-vs-apache-kafka-benchmarks-and-cost AutoMQ offers cloud-native scalability with complete Kafka API compatibility, achieving up to 14x cost efficiency compared to Apache Kafka, maintaining a 1GiB/s throughput. AutoMQ is a cloud-native reimplementation of Apache Kafka's storage layer utilizing cloud storage. It not only maintains complete compatibility with Apache Kafka's API but also achieves a 17x cost efficiency compared to Apache Kafka under 1GiB/s traffic. The monthly TCO decreases from 226,671 USD for Apache Kafka to 12,899 USD. The detailed cost breakdown is shown in the table below: | Comparison Item | AutoMQ | Apache Kafka | | - | - | - | | Compute | \$2,859 | \$18,447 | | Storage | \$5,961 | \$69,984 | | S3 API | \$3,952 | \$0 | | Cross-availability zone traffic cost | \$128 | \$138,240 | | Total | \$12,899 | \$226,671 | ## Benchmark Preparation Conduct performance testing on a Topic with 256 partitions at a traffic speed of 1 GiB/s for both production and consumption. ### AutoMQ Cluster AutoMQ can be deployed on Kubernetes using the Bitnami Kafka Helm Chart. You can refer to [Install AutoMQ by Helm Chart](https://github.com/AutoMQ/automq/blob/main/chart/bitnami/README.md) to deploy a 3-availability zone AutoMQ cluster on AWS: * A total of 6 nodes, including 3 servers and 3 brokers, are evenly distributed across 3 availability zones; * The selected physical node type is m7g.4xlarge, featuring a specification of 16 cores and 64GB of RAM, a network baseline of 960 MiB/s, and priced at \$476.544 per month. ### Load Tester Stress machines are deployed across 3 availability zones, with one m7g.4xlarge in each zone, simulating multi-availability zone business loads. The performance testing is conducted using the `automq-perf-test.sh` script provided by AutoMQ, configured as follows: ```bash theme={null} KAFKA_HEAP_OPTS="-Xmx32g -Xms32g" nohup ./bin/automq-perf-test.sh --bootstrap-server $bootstrap_server --record-size 1024 --topics 1 --partitions-per-topic 256 --topic-prefix perf --producers-per-topic 20 --groups-per-topic 1 --consumers-per-group 20 --send-rate 349525 --warmup-duration 2 --test-duration 30 --producer-configs batch.size=1048576 linger.ms=100 buffer.memory=67108864 max.request.size=33554432 client.id='automq_az=apse1-az1' --consumer-configs fetch.max.bytes=104857600 max.partition.fetch.bytes=104857600 client.id='automq_az=apse1-az1' --reset &> nohup.log & KAFKA_HEAP_OPTS="-Xmx32g -Xms32g" nohup ./bin/automq-perf-test.sh --bootstrap-server $bootstrap_server ... client.id='automq_az=apse1-az2' --await-topic-ready false &> nohup.log & KAFKA_HEAP_OPTS="-Xmx32g -Xms32g" nohup ./bin/automq-perf-test.sh --bootstrap-server $bootstrap_server ... client.id='automq_az=apse1-az3' --await-topic-ready false &> nohup.log & ``` With this configuration, the load tester simulates the following scenario: * A total of 60 Producers and 60 Consumers are evenly distributed across 3 availability zones, marked with `client.id=automq_az=apse1-az1` to indicate the availability zone affiliation of the client. * Send 1,048,575 Records per second, each of 1 KiB in size, totaling 1 GiB/s of data. * Sending parameters are additionally configured with `batch.size=1048576` and `linger.ms=100` to achieve better batching performance, suitable for most high-throughput Kafka scenarios. ## Costs In a scenario where data is retained for 3 days (`log.retention.hours=72`), using AWS us-east-1 region as an example, the total cost of ownership for AutoMQ is \$12,899 per month. The total cost includes expenses for computation, storage, S3 API, and cross-availability zone traffic. * Computation: AutoMQ utilized 6 m7g.xlarge instances in this benchmarking scenario, totaling a computing resource cost of 6 \* \$476.544 = \$2,859 per month. * Storage: Traffic \* 3 days \* S3 price per unit = 1 \* (60 \* 60 \* 24 \* 3) \* 0.023 = \$5,961 per month. * S3 API: Under this traffic, the average Get is 1,278/s and Put is 202.662/s, resulting in a cost of \$3,952 per month. ![](https://mintcdn.com/automq/1QgM5miUDiCjXCsL/automq/benchmarks/automq-vs-apache-kafka-benchmarks-and-cost/1.webp?fit=max\&auto=format\&n=1QgM5miUDiCjXCsL\&q=85\&s=f29daf711782e54f09616d5cb10da32a) * Cross-availability zone traffic: Although AutoMQ is designed for clients to send and receive messages only with Brokers within the same availability zone, there is still a small amount of RPC requests between Brokers to synchronize KRaft metadata and forward ZoneRouterProduceRequest. We collected cross-availability zone traffic on Broker nodes using `iftop -t -s 60 -L 100`. The average cross-availability zone Network In + Network Out for one node is 0.84 MiB/s. Therefore, the cross-availability zone traffic cost for 6 nodes is 0.84 / 1024 \* 6 \* (60 \* 60 \* 24 \* 30) \* 0.01 \~= \$127 per month. The total cost of AutoMQ is calculated as follows: compute + storage + S3 API + cross Availability Zone (AZ) traffic \~= \$12,899 per month. ## Compared to Apache Kafka, This Represents a 14x Cost Reduction. The same workload on Apache Kafka requires \$65,385 per month, which is 14 times that of AutoMQ. The total cost of ownership includes compute, storage, and Inter-Zone traffic. * Storage: To store 253.125 TiB of data (calculated as 1 / 1024 \* (60 \* 60 \* 24 \* 3)), and considering three replicas, 759.375 TiB of space is needed. Taking into account buffer and uneven data distribution, and assuming a 50% effective disk utilization rate, 1,518.75 TiB of disk space is necessary. To save on disk storage costs, st1 storage medium is used, leading to a storage cost calculation of 1,518.75 \* 1024 \* 0.045 = \$69,984 per month. * Compute: With a maximum EBS volume size of 16 TiB, at least 95 volumes are needed, corresponding to 95 Brokers. Following production practices, the minimum recommended instance type is r4.xlarge, costing \$18,447.1 per month. * Cross Availability Zone traffic: Assuming a uniform distribution of partitions and traffic, 2/3 of production traffic is sent across AZs. Consumption can be optimized to avoid cross AZ traffic using Fetch From Follower. Fetch From Follower implies that replicas are distributed across 3 AZs, generating two additional sets of production traffic among Broker ISR. Overall, cross AZ traffic is calculated as: production traffic \* (2 / 3 + 2) \* 30d = 1024 \* (2 / 3 + 2) / 1024 \* (60 \* 60 \* 24 \* 30) \* 0.02 = \$138,240 per month. The total cost of Apache Kafka is: compute + storage + cross AZ traffic = \$226,671 per month. In addition to reducing static costs, the stateless architecture of AutoMQ delivers further cost advantages: * AutoBalancing: AutoMQ includes a load balancing component within the Controller, which automatically balances the load based on traffic between nodes. Partition reassignment is completed in less than 2 seconds, eliminating the need for manual load balancing by operations personnel. * No Overprovisioning: With stateless nodes and second-level partition reassignments, AutoMQ can scale up or down within minutes—most of the time is spent on resource preparation. After expansion, load balancing is completed in seconds. AutoMQ does not require pre-reserving resources for peak times or handling load balancing at the hour level. ## Performance: The CPU utilization of each AutoMQ Broker is at 50%. There is ample idle CPU capacity to handle traffic spikes and more small packet requests. ![](https://mintcdn.com/automq/1QgM5miUDiCjXCsL/automq/benchmarks/automq-vs-apache-kafka-benchmarks-and-cost/2.webp?fit=max\&auto=format\&n=1QgM5miUDiCjXCsL\&q=85\&s=d6d0d34253ddd173e818a1a2b9ce1aa1) AutoMQ uses 8MiB / 250ms batching parameters by default when writing to S3. The Producer uses ack=all, and a record is only acknowledged as successful to the client after it is persisted to S3. In this test, the latency performance is as follows: | - | AVG | P50 | P99 | P999 | | - | - | - | - | - | | Produce | 472ms | 465ms | 823ms | 1049ms | | E2E | 631ms | 602ms | 1189ms | 1549ms | If lower latency is needed, you can adjust the `batchInterval` parameter in the configurations of `s3.wal.path` and `automq.zonerouter.channels` to reduce the wait time for batching writes to S3. However, achieving lower latency will increase the cost of S3 APIs. # Broker and Controller Configuration Source: https://docs.automq.com/automq/configuration/broker-and-controller-configuration Optimize AutoMQ deployment with advanced broker and controller configurations, leveraging cloud-native scalability and Kafka compatibility to reduce costs. This document aims to explain the configuration parameters involved in the deployment of AutoMQ. It includes configuration definitions, descriptions, setting ranges, and specifications to aid developers in making necessary custom adjustments in production environments. AutoMQ implements a storage-compute separation based on object storage and is fully compatible with Apache Kafka. Therefore, Kafka's functional configurations (e.g., ACL, network, etc.) can be referred to from the [official configuration documentation](https://kafka.apache.org/documentation/#brokerconfigs). This document only lists the configuration parameters related to the new storage module added by AutoMQ. ## Public Configuration ### elasticstream.enable | Item | Description | | - | - | | Configuration Description | Whether to enable AutoMQ, this parameter must be set to true. | | Value Type | boolean | | Default Value | false | | Valid Input Range | N/A | | Importance Level | High, requires careful configuration | ### automq.zonerouter.channels By enabling cross-AZ (Availability Zone) request routing, you can reduce cross-AZ data transmission and decrease traffic costs. For more details, refer to [Overview▸](/automq/eliminate-inter-zone-traffics/overview). | Item | Description | | - | - | | Configuration Description | Configuration for Inter-Zone channel. By configuring Inter-Zone routing components, the cost caused by cross-zone traffic can be significantly reduced. Currently, only object storage is supported. The format is: `0@s3://$bucket?region=$region[&batchInterval=250][&maxBytesInBatch=8388608]` | | Value Type | string | | Default Value | null | | Valid Input Range | N/A | | Importance Level | High, requires careful configuration | ## S3Stream Related Configuration ### s3.data.buckets | Item | Description | | - | - | | Configuration Description | The URI for data plane object storage. The format is: `0@s3://$bucket?region=$region[&endpoint=$endpoint][&pathStyle=$enablePathStyle][&authType=$authType][&accessKey=$accessKey][&secretKey=$secretKey][&checksumAlgorithm=$checksumAlgorithm]`. For configurations from different vendors, see: [Object Storage Configuration▸](/automq/configuration/object-storage-configuration). | | Value Type | string | | Default Value | null | | Valid Input Range | N/A | | Importance Level | High, requires careful configuration | ### s3.ops.buckets | Item | Description | | - | - | | Configuration Description | The URI for control plane object storage. The format is: `1@s3://$bucket?region=$region[&endpoint=$endpoint][&pathStyle=$enablePathStyle][&authType=$authType][&accessKey=$accessKey][&secretKey=$secretKey][&checksumAlgorithm=$checksumAlgorithm]`. For configurations from different vendors, see: [Object Storage Configuration▸](/automq/configuration/object-storage-configuration). | | Value Type | string | | Default Value | null | | Valid Input Range | N/A | | Importance Level | High, requires careful configuration | ### s3.wal.path | Item | Description | | - | - | | Configuration Description | The mount path for block storage devices used for storing local WAL, with the format: `0@s3://$bucket?region=$region[&batchInterval=250][&maxBytesInBatch=8388608]` For details on different vendors, refer to: [Object Storage Configuration▸](/automq/configuration/object-storage-configuration) | | Value Type | string | | Default Value | null | | Valid Input Range | N/A | | Importance Level | High, requires careful configuration | ### s3.wal.cache.size | Item | Description | | - | - | | Configuration Description | WAL (Write-Ahead Logging) cache is a FIFO (first-in-first-out) queue that contains data which has not been uploaded to object storage, as well as data that has been uploaded but not yet evicted from the cache. When the cache data that has not been uploaded fills up the entire capacity, storage will exert backpressure on subsequent requests until the data upload is completed. By default, it sets a reasonable value based on memory. | | Value Type | long, measured in bytes | | Default Value | -1, automatically set by the program to a suitable parameter value | | Legal Input Range | \[1, ...] | | Importance Level | Low, set relatively broad | ### s3.wal.upload.threshold | Item | Description | | - | - | | Configuration Description | The threshold that triggers WAL uploads to object storage. The configuration value needs to be less than `s3.wal.cache.size`. The larger the configuration value, the higher the data aggregation degree, leading to lower metadata storage costs. By default, it sets a reasonable value based on memory. | | Value Type | long, measured in bytes | | Default Value | -1, automatically set by the program to a suitable parameter value | | Legal Input Range | \[1, ...] | | Importance Level | Low, set relatively broad | ### s3.block.cache.size | Item | Description | | - | - | | Configuration Description | `s3.block.cache.size` is the size of the block cache. The block cache is used to cache cold data read from object storage. It is recommended to set this configuration item to more than 4MB \* the number of concurrent cold reads per partition to achieve better cold read performance. By default, it sets a reasonable value based on memory. | | Value Type | long, measured in bytes | | Default Value | -1, automatically set by the program to a suitable parameter value | | Legal Input Range | \[1, ...] | | Importance Level | Low, set relatively broad | ### s3.stream.object.compaction.interval.minutes | Item | Description | | - | - | | Configuration Description | The interval period for compaction in Stream objects. The larger the interval, the lower the cost of API calls, but it increases the size of metadata storage. | | Value Type | int, measured in minutes | | Default Value | 30 | | Legal Input Range | \[1, ...] | | Importance Level | Low, set relatively broad | ### s3.stream.object.compaction.max.size.bytes | Item | Description | | - | - | | Configuration Description | Stream object compaction allows for the maximum size of synthetic objects. The larger this value, the higher the cost of API calls, but the smaller the scale of metadata storage. | | Value Type | long, measured in bytes | | Default Value | 10737418240 | | Legal Input Range | \[1, ...] | | Importance Level | Low, set relatively broad | ### s3.stream.set.object.compaction.interval.minutes | Item | Description | | - | - | | Configuration Description | Sets the interval for stream object compaction. The smaller this value, the smaller the scale of the metadata storage, and the data becomes compacted sooner. However, the final stream objects will undergo compaction more frequently. | | Value Type | int, measured in minutes | | Default Value | 5 | | Legal Input Range | \[1, ...] | | Importance Level | Low, set relatively broad | ### s3.stream.set.object.compaction.cache.size | Item | Description | | - | - | | Configuration Description | The size of memory available during the stream object compaction process. The larger this value, the lower the cost of API calls. | | Value Type | long, in bytes | | Default Value | 209715200 | | Legal Input Range | \[1048576, ...] | | Importance Level | Low, set relatively broad | ### s3.stream.set.object.compaction.stream.split.size | Item | Description | | - | - | | Configuration Description | During the Stream object compaction process, if the data volume within a single Stream exceeds this threshold, the Stream's data will be directly split and written into individual Stream objects. The smaller this value, the earlier the data is split from the Stream set object, resulting in lower subsequent API call costs for Stream object compaction, but leading to higher API call costs for the split. | | Value Type | long, measured in bytes | | Default Value | 8388608 | | Legal Input Range | \[1, ...] | | Importance Level | Low, set relatively broad | ### s3.network.baseline.bandwidth | Item | Description | | - | - | | Configuration Description | The total available bandwidth for object storage requests. This is used to prevent stream set object compaction and catch-up reads from occupying normal read-write traffic. Production and consumption will also individually consume inbound and outbound traffic. For instance, if this value is set to 100MB/s and normal read-write traffic is 80MB/s, then the available traffic for stream set object compaction would be 20MB/s. | | Value Type | long, measured in byte/s | | Default Value | 1073741824 | | Legal Input Range | \[1, ...] | | Importance Level | Low, set relatively broad | ### s3.stream.allocator.policy | Item | Description | | - | - | | Configuration Description | S3Stream memory allocator policy. Note that when configured to use DIRECT memory, the heap size in the virtual machine options (e.g., -Xmx) and the direct memory size (e.g., -XX:MaxDirectMemorySize) need to be adjusted. You can set them via the environment variable KAFKA\_HEAP\_OPTS. | | Value Type | string | | Default | POOLED\_HEAP | | Valid Values | POOLED\_HEAP, POOLED\_DIRECT | | Importance Level | Low, set relatively broad | ### s3.telemetry.metrics.level | Item | Description | | - | - | | Configuration Description | Sets the level of Metrics logging. The "INFO" level includes metrics that most users should be concerned with, such as throughput and latency of common stream operations. The "DEBUG" level includes detailed metrics useful for diagnostics, such as latencies at various stages when writing to underlying block devices. | | Value Type | string | | Default Value | INFO | | Valid Input Range | INFO, DEBUG | | Importance Level | Low, set relatively broad | ### s3.telemetry.exporter.report.interval.ms | Item | Description | | - | - | | Configuration Description | Sets the interval for Metrics export. | | Value Type | int, in milliseconds | | Default Value | 30000 | | Valid Input Range | N/A | | Importance Level | Low, set relatively broad | ### s3.telemetry.metrics.base.labels | Item | Description | | - | - | | Configuration Description | Multi-dimensional labels for metrics, used to attach static multi-dimensional labels to all monitoring metrics, enabling categorization, aggregation, and fine-grained analysis of metrics. The format is: key1=value1,key2=value2. | | Value Type | string | | Default Value | null | | Valid Input Range | N/A | | Importance level | Medium, requires careful configuration | ### s3.telemetry.metrics.exporter.uri | Item | Description | | - | - | | Configuration description | The export URI for Metrics. The format is: `$type://?$param1=$value1&$param2=$value2`. Currently the supported types for 'type' are prometheus and otlp. The format for prometheus: `prometheus://?host=$hostname&port=$port` The format for otlp: `otlp://?endpoint=$endpoint&protocol=$protocol&compression=$compression` | | Value Type | string | | Default Value | null | | Valid Input Range | N/A | | Importance Level | High, requires careful configuration | ## Persistent Data Rebalancing Configuration ### metric.reporters | Item | Description | | - | - | | Configuration Description | A list of classes for metrics reporters. By implementing the `org.apache.kafka.common.metrics.MetricsReporter` interface, you can dynamically load new metrics. `JmxReporter` is always included to register JMX statistics. To enable AutoBalancing, `metric.reporters` must include `kafka.autobalancer.metricsreporter.AutoBalancerMetricsReporter`. | | Value Type | list | | Default Value | "" | | Valid Input Range | N/A | | Importance Level | Low, set relatively broad | ### autobalancer.reporter.metrics.reporting.interval.ms | Item | Description | | - | - | | Configuration Description | Interval for reporting data by Metrics Reporter. | | Value Type | long, unit is milliseconds | | Default Value | 10000 | | Legal Input Range | \[1000, ...] | | Importance Level | High, requires careful configuration | ### autobalancer.controller.enable | Item | Description | | - | - | | Configuration Description | Whether to enable automatic rebalancing. | | Value Type | boolean | | Default Value | true | | Valid Input Range | N/A | | Importance Level | High, requires careful configuration | ### autobalancer.controller.anomaly.detect.interval.ms | Item | Description | | - | - | | Configuration description | The minimum interval for the Controller to check if a data rebalance is needed. The actual time for the next rebalance also depends on the number of partitions that have been reassigned. Reducing the minimum check interval can increase the sensitivity of data rebalancing. This value should be greater than the broker metrics reporting interval to prevent the controller from missing recent reassignment results. | | Value Type | long, unit is milliseconds | | Default Value | 60000 | | Legal Input Range | \[1, ...] | | Importance Level | High, requires careful configuration | ### autobalancer.controller.exclude.topics | Item | Description | | - | - | | Configuration Description | List of Topics to be excluded from data rebalancing. | | Value Type | list | | Default Value | "" | | Valid Input Range | N/A | | Importance Level | High, requires careful configuration | ### autobalancer.controller.exclude.broker.ids | Item | Description | | - | - | | Configuration Description | List of Broker Ids that should be excluded from data rebalancing. | | Value Type | list | | Default Value | "" | | Valid Input Range | N/A | | Importance Level | High, requires careful configuration | ## Table Topic > [!TIP] > > Table Topic is a core feature designed by AutoMQ for modern data lake architectures. It integrates streaming data with data lake storage through architectural innovation, addressing traditional challenges such as the separation of streaming and batch processing, complex ETL processes, and high costs. For more details, see [Overview▸](/automq/table-topic/overview). For the current Table Topic configuration model, including topic-level settings, record conversion, transformations, error handling, Schema Registry client options, Catalog authentication, and Catalog-specific options, see [Table Topic Configuration▸](/automq/table-topic/table-topic-configuration). # Object Storage Configuration Source: https://docs.automq.com/automq/configuration/object-storage-configuration Optimize your data storage with AutoMQ, the cloud-native Kafka-compatible solution utilizing leading cloud object storage for superior cost efficiency and scalability. AutoMQ is a cloud-native, redesigned distribution of Kafka that fully utilizes cloud object storage services. It can build the storage layer using object storage from major cloud providers or storage software. ### Object Storage URI Construction The URI is a unique identifier used by AutoMQ to represent writes to object storage, adhering to established standards to reconcile differences among various object storage service providers. The URI components are as follows: `s3` specifies the protocol; `xxx_bucket` indicates the specific bucket; `region` and `endpoint` are additional parameters used by different vendors to locate the bucket. Ultimately, replace the variables in the configuration templates `global.config` and `global.envs` from [Deploy Multi-Nodes Cluster on Linux▸](/automq/deployment/deploy-multi-nodes-cluster-on-linux) to generate the final configuration files. | Provider | Type | URI Example | | - | - | - | | AWS | Cloud Provider | s3://xxx\_bucket?region=us-east-1 | | AWS-CN | Cloud Provider | s3://xxx\_bucket?region=cn-northwest-1\&endpoint=[https://s3.amazonaws.com.cn](https://s3.amazonaws.com.cn) | | ALIYUN | Cloud Provider | s3://xxx\_bucket?region=oss-cn-shanghai\&endpoint=[https://oss-cn-shanghai.aliyuncs.com](https://oss-cn-shanghai.aliyuncs.com) | | OCI | Cloud Provider | s3://xxx\_bucket?region=us-ashburn-1\&endpoint=[https://xxx\_namespace.compat.objectstorage.us-ashburn-1.oraclecloud.com\&pathStyle=true](https://xxx_namespace.compat.objectstorage.us-ashburn-1.oraclecloud.com\&pathStyle=true) | | CEPH | Storage Software | s3://xxx\_bucket?region=us-west-2\&endpoint=[http://127.0.0.1:80](http://127.0.0.1:80) | | CubeFS | Storage Software | s3://xxx\_bucket?region=us-west-2\&endpoint=[http://10.1.0.240:17410](http://10.1.0.240:17410) | | MinIO | Storage Software | s3://xxx\_bucket?region=us-west-2\&pathStyle=true\&endpoint=[http://10.1.0.240:9000](http://10.1.0.240:9000) | > [!TIP] > > If the `s3.wal.path` is set, you can also include the `batchInterval` and `maxBytesInBatch` parameters in the URI to control the submit interval and the maximum size of bytes per batch, respectively. The default settings are `batchInterval=250` milliseconds and `maxBytesInBatch=8388608` bytes. ### Cloud Object Storage Configuration > [tab] AWS > > It is recommended to refer to the [Policy](https://docs.aws.amazon.com/AmazonS3/latest/userguide/access-policy-language-overview.html) and [Endpoint & Region](https://docs.aws.amazon.com/general/latest/gr/s3.html) links in the AWS documentation to get detailed configuration instructions for IAM and S3. > > > [!NOTE] > > > > In a production environment, it is advisable to scope IAM Policy permissions to specific buckets to avoid unintended authorizations. > > ```json theme={null} > { > "Version": "2012-10-17", > "Statement": [ > { > "Sid": "VisualEditor0", > "Effect": "Allow", > "Action": [ > "s3:PutObject", > "s3:GetObject", > "s3:AbortMultipartUpload", > "s3:DeleteObject", > "s3:ListBucket" > ], > "Resource": [ > "*" > ] > } > ] > } > > ``` > [tab] Aliyun > > It is recommended to refer to the official Alibaba Cloud documentation on [RAM Permission Policy Language Overview](https://www.alibabacloud.com/help/en/ram/user-guide/policy-overview) and [OSS Endpoints and Regions](https://www.alibabacloud.com/help/en/oss/regions-and-endpoints) for detailed instructions on configuring RAM permissions and OSS. > > > [!NOTE] > > > > In a production environment, it is advisable to scope RAM policy permissions to specific buckets (OSS storage spaces) to avoid overly broad authorization and reduce security risks. > > ```json theme={null} > { > "Version": "1", > "Statement": [ > { > "Effect": "Allow", > "Action": [ > "oss:PutObject", > "oss:AbortMultipartUpload", > "oss:GetObject", > "oss:DeleteObject", > "oss:PutObjectTagging" > ], > "Resource": [ > "acs:oss:*:*:examplebucket" > ] > } > ] > } > > ``` > [tab] GCP > > Since the AWS S3 SDK cannot directly access GCP Cloud Storage, AutoMQ Open Source cannot run directly on Google Cloud Storage. If you need to run AutoMQ on GCP, [contact the AutoMQ team](https://www.automq.com/contact) for support. AutoMQ BYOC supports GCP Cloud Storage. > [tab] Azure > > [Azure Blob Storage](https://azure.microsoft.com/en-us/products/storage/blobs) is not compatible with the AWS S3 network protocol; therefore, AutoMQ Open Source cannot run directly on Azure Blob Storage. Users can address this as follows: > > * Set up your own S3 Proxy to access Blob Storage. > > * [Contact the AutoMQ team](https://www.automq.com/contact) for support. AutoMQ BYOC supports Azure Blob Storage. > [tab] OCI > > We recommend checking the official website for more detailed information. > > It is advisable to consult the [Policy](https://docs.oracle.com/en-us/iaas/Content/Security/Reference/objectstorage_security.htm#iam-policies), [Detailed Policy](https://docs.oracle.com/en-us/iaas/Content/Identity/Reference/objectstoragepolicyreference.htm#Details), and [Endpoint & Region](https://docs.oracle.com/en-us/iaas/Content/Object/Tasks/s3compatibleapi.htm#usingAPI) links, and review OCI documentation for more detailed configuration instructions on IAM and Object Storage. > > ```text theme={null} > Allow group 'AutoMQ PoC' to manage objects in tenancy where any {target.bucket.name='automq-data', target.bucket.name='automq-ops'} > ``` > [tab] Other Cloud Providers > > To deploy AutoMQ in other public cloud environments, make sure that the cloud provider's object storage service is compatible with the S3 protocol. You can contact the AutoMQ team via [this form](https://www.automq.com/contact) to obtain the necessary assistance and best practices. ### Storage Software Configuration If you wish to deploy AutoMQ in a private data center, you can also use storage software like MinIO, Ceph, or CubeFS that supports the S3 protocol to provide object storage services. # Performance Tuning for Client Source: https://docs.automq.com/automq/configuration/performance-tuning-for-client Optimize AutoMQ for peak performance with its cloud-native scalability and Kafka compatibility, ensuring cost efficiency and enterprise-grade low-latency support. AutoMQ does not rely on local disks; instead, it writes data directly to object storage. In comparison to writing to local disks, file creation operations in object storage exhibit higher latency. For example, our empirical data shows that when writing a 4MiB file to S3, the P99 latency is approximately 400 milliseconds. Due to this, in some throughput-prioritized scenarios, it is necessary to suitably adjust client parameters to meet the system's performance goals ([Little’s Law](https://en.wikipedia.org/wiki/Little's_law)). > [!TIP] > > Note: > > The configurations listed in this document are for reference only. Users need to consider their specific scenario demands and system goals comprehensively to reasonably adjust the corresponding parameter values. > > If your scenario is sensitive to message read and write latency, contact the AutoMQ team through [this form](https://www.automq.com/contact) for support. AutoMQ BYOC and AutoMQ Software support single-digit millisecond low-latency data reads and writes. ### Producer Configuration | **Producer Configuration Option** | **Description** | **Recommended Value** | | - | - | - | | linger.ms | The delay time for the Producer to batch send messages, enhancing the efficiency of each request by accumulating more messages. | 100 | | metadata.max.age.ms | The forced refresh time for metadata to prevent routing errors due to metadata expiration. | 60000 | | batch.size | The maximum number of bytes in a single batch, directly affecting the number of network requests and throughput. | 1048576 | | max.request.size | The maximum number of bytes in a single request, limiting the size of messages the Producer can send. | 16777216 | ### Consumer Configuration | **Consumer Configuration Options** | **Description** | **Recommended Value** | | - | - | - | | metadata.max.age.ms | The forced refresh time for metadata to prevent route errors due to expired metadata. | 60000 | | max.partition.fetch.bytes | Limits the maximum amount of data returned in a Fetch request from a single partition, working together with fetch.max.bytes to control fetch granularity. | 8388608 | # AutoMQ Benchmark Source: https://docs.automq.com/automq/deployment/automq-benchmark Test AutoMQ cluster performance using Kafka CLI tools or the AutoMQ performance testing tool. Covers tail read and catch-up read scenarios. AutoMQ uses an S3 shared storage architecture that separates compute and storage. It provides 100% compatibility with Apache Kafka while offering rapid scalability, cost efficiency, and high performance, especially in cold read scenarios. This document describes how to conduct performance testing on an AutoMQ cluster. ## Prerequisites Before conducting cluster performance testing, the following conditions must be met: 1. **Complete the installation and deployment of the AutoMQ cluster.** You can refer to the following methods for installing and deploying AutoMQ. * [Deploy Multi-Nodes Cluster on Linux▸](/automq/deployment/deploy-multi-nodes-cluster-on-linux) * [Deploy Multi-Nodes Cluster on Kubernetes▸](/automq/deployment/deploy-multi-nodes-cluster-on-kubernetes) 2. **Prepare necessary load generators.** It is recommended to create a certain number of load generators within the same VPC network to ensure that network throughput and the CPU of the load generators do not become bottlenecks in the testing scenario. ## Test Scenario ### Scenario 1: Tail Read Tail Read, commonly referred to as "hot read," evaluates conditions where the offset difference between the Producer and Consumer is minimal. The essential metrics for hot write and hot read scenarios are as follows: * **Read/Write Throughput:** Real-time read/write scenarios are typical for Kafka. Achieving higher throughput with the same hardware resources implies improved performance. * **Write and E2E Latency:** Given constant network throughput, lower message write latency is desirable. Similarly, reduced E2E latency (the time taken from production to consumption of a message) is advantageous. In the Tail Read scenario, messages sent by the Producer are consumed immediately after being written to the Broker. Here, messages consumed by the Consumer are retrieved directly from the AutoMQ Log Cache, which eliminates the need to read from object storage, thereby reducing resource consumption. ### Scenario 2: Catch-Up Read Catch-Up Read, also known as a "catch-up read" or "cold read," evaluates the scenario where the Consumer's consumption offset significantly lags behind the Producer's offset. In this scenario, the Consumer is initially paused and, after accumulating a certain number of messages, consumption resumes. At this point, messages consumed by the Consumer are fetched from object storage, with Block Cache handling pre-reading and caching. In this test scenario, the following metrics are primarily focused on: * **Is the catch-up read speed fast enough**? Determine whether the consumption speed of each Consumer Group exceeds the Producer's write speed. Only if it does can it be said that the Consumer is capable of catching up with the Producer. * **Is Write Throughput Affected During Catch-Up Reads?** Check to see if there's a reduction in the message flow from the Producer during catch-up reads and if there's an increase in send latency. ## Testing with Kafka CLI Users can perform performance tests using Kafka CLI tools by running `kafka-producer-perf-test.sh` and `kafka-consumer-perf-test.sh`. If your previous AutoMQ cluster was deployed following the guide [Deploy Multi-Nodes Cluster on Linux▸](/automq/deployment/deploy-multi-nodes-cluster-on-linux), the resulting cluster bootstrap address will look something like "**192.168.0.1:9092,192.168.0.2:9092,192.168.0.3:9092**". > [!TIP] > > Adjust the bootstrap-server addresses below to match your actual cluster configuration. ### Create Topic ```bash theme={null} ./kafka-topics.sh --create --topic test-topic --bootstrap-server 192.168.0.1:9092,192.168.0.2:9092,192.168.0.3:9092 ``` ### Send Message ```bash theme={null} ./kafka-producer-perf-test.sh --topic test-topic --num-records=1024000 --throughput 5120 --record-size 1024 --producer-props bootstrap.servers=192.168.0.1:9092,192.168.0.2:9092,192.168.0.3:9092 ``` > [!TIP] > > The parameters `linger.ms` and `batch.size` are crucial for performance tuning. You can consult [Performance Tuning For Client▸](/automq/configuration/performance-tuning-for-client) to adjust these settings according to your specific needs. ### Consume Message ```bash theme={null} ./kafka-consumer-perf-test.sh --topic test-topic --show-detailed-stats --timeout 300000 --messages=1024000 --reporting-interval 1000 --bootstrap-server=192.168.0.1:9092,192.168.0.2:9092,192.168.0.3:9092 ``` ## Testing with the AutoMQ Performance Testing Tool (Recommended) The AutoMQ team has enhanced the Kafka performance testing CLI tool provided by the community and released a one-click performance testing tool. This tool draws on the OpenMessaging Benchmark framework, providing the following advantages: * **Support for single-process multiple clients to enhance benchmarking density and efficiency:** Unlike Apache Kafka's built-in kafka-producer-perf-test.sh and kafka-consumer-perf-test.sh scripts, the automq-perf-test.sh script allows for multiple Producers and Consumers to run within a single process, thereby sending and receiving messages across multiple Topics. This approach better mirrors real-world scenarios and improves ease of use. * **One-click execution without distributed deployment:** In contrast to the OpenMessaging Benchmark testing framework, automq-perf-test.sh eliminates the need for distributed deployment of multiple Workers, enabling you to execute tests with a single click on a single machine. This simplifies deployment and use in testing scenarios where large scale is not required. * **Provides Catch Up Read test scenarios:** Furthermore, the automq-perf-test.sh script can handle more complex cold read test scenarios by permitting multiple Consumer Groups to start consumption at different offsets. This setup helps prevent cache reuse during cold reads, allowing for performance testing under more rigorous conditions. * **Open and neutral:** This testing script exclusively utilizes the Apache Kafka Client, which ensures compatibility with performance testing on stream systems like Apache Kafka, MSK, and other platforms supporting the Kafka protocol. ### Scenario 1: Tail Read The following use case tests the Tail Read performance of AutoMQ. This test case involves: * A production and consumption traffic ratio of 1:1. * Data is written to a total of 1,280 partitions across 10 topics. * Writing 1600 messages per second, each 51 KiB in size (without any batching), resulting in a write speed of 80 MiB/s. Note that before executing the script below, you need to replace the `--bootstrap-server` address with the actual AutoMQ access point address. ```bash theme={null} KAFKA_HEAP_OPTS="-Xmx12g -Xms12g" ./bin/automq-perf-test.sh \ --bootstrap-server 0.kf-v8tj9bmunqdo1og8.wanshao-for-aws.automq.private:9092,1.kf-v8tj9bmunqdo1og8.wanshao-for-aws.automq.private:9092,2.kf-v8tj9bmunqdo1og8.wanshao-for-aws.automq.private:9092 \ --producer-configs batch.size=0 \ --consumer-configs fetch.max.wait.ms=1000 \ --topics 10 \ --partitions-per-topic 128 \ --producers-per-topic 1 \ --groups-per-topic 1 \ --consumers-per-group 1 \ --record-size 52224 \ --send-rate 1600 \ --warmup-duration 10 \ --test-duration 5 \ --reset ``` ### Scenario 2: Catch-Up Read The following use case tests the Catch-Up Read performance of AutoMQ, structured as follows: * The production-to-consumption traffic ratio is 1:3. * Data is written to a total of 1,280 partitions across 10 topics. * 800 messages, each sized at 64 KiB, are written per second (with no batching), resulting in a write speed of 50 MiB/s. * Buffer 600 seconds of data (\~30 GiB) before beginning to catch up, then initiate 3 Consumer Groups to start catching up, with each Group's starting point staggered by 30 seconds (\~1.5 GiB). Note that before executing the script below, you need to replace the `--bootstrap-server` address with the actual AutoMQ access point address. ```bash theme={null} KAFKA_HEAP_OPTS="-Xmx12g -Xms12g" ./bin/automq-perf-test.sh \ --bootstrap-server 0.kf-hsd29pri8q5myud5.wanshao-for-aws.automq.private:9092,1.kf-hsd29pri8q5myud5.wanshao-for-aws.automq.private:9092,2.kf-hsd29pri8q5myud5.wanshao-for-aws.automq.private:9092 \ --producer-configs batch.size=0 \ --consumer-configs fetch.max.wait.ms=1000 \ --topics 10 \ --partitions-per-topic 128 \ --producers-per-topic 1 \ --groups-per-topic 3 \ --consumers-per-group 1 \ --record-size 65536 \ --send-rate 800 \ --backlog-duration 600 \ --group-start-delay 30 \ --warmup-duration 5 \ --reset ``` ### Startup Parameters * `--bootstrap-server`: Specifies the initial connection nodes for the Kafka cluster, provided in the format "host1:port1,host2:port2". It should be noted that these addresses are only used for the initial connection to obtain cluster metadata, so you do not need to provide the addresses of all Brokers in the cluster. Just a few running and accessible addresses will suffice. * `--common-configs`: Specifies the common configuration for Kafka Admin Client, Producer, and Consumer, including authentication-related configurations. * `--topic-configs`: Specify configurations related to topics, such as message retention time, etc. * `--producer-configs`: Specify configurations related to producers, like batch size, batch duration, compression method, etc. * `--consumer-configs`: Specify configurations related to consumers, including the maximum size of messages fetched in a single operation, etc. * `--reset`: Determines whether to delete all existing topics in the cluster before executing the benchmark. * `--topic-prefix`: The prefix for topics used during the test. * `--topics` : The number of topics created during testing. * `--partitions-per-topic` : The number of partitions in each topic. The total number of partitions used for testing is calculated as `--topics` \* `--partitions-per-topic`. * `--producers-per-topic` : The number of producers created for each topic. The total number of producers used for testing is calculated as `--topics` \* `--producers-per-topic`. * `--groups-per-topic` : The number of consumer groups created for each topic, which also represents the read-write ratio (fan-out) during testing. * `--consumers-per-group` : The number of consumers in each consumer group. The total number of consumers used for testing is calculated as `--topics` \* `--groups-per-topic` \* `--consumers-per-group`. * `--record-size`: The size of each message sent by the Producer, measured in bytes. * `--send-rate`: The total number of messages sent per second by all Producers. The product of `--record-size` and `--send-rate` represents the write throughput during testing. * `--random-ratio`: The proportion of random data in messages, commonly used for testing scenarios where the Producer has enabled compression. The value ranges between 0.0 and 1.0; the larger the value, the more random data in messages, theoretically resulting in poorer compression efficiency. The default value is 0.0, meaning each message is entirely identical. * `--random-pool-size`: The size of the random message pool. A message is randomly selected from this pool each time a message is sent. This option is only effective when `--random-ratio` is greater than 0. * `--backlog-duration`: Used in catch-up read test scenarios to control the duration of message accumulation, measured in seconds. The product of `--record-size`, `--send-rate`, and `--backlog-duration` represents the size of accumulated messages before the catch-up reading begins. * `--group-start-delay`: Used in catch-up read test scenarios to control the interval at which each Consumer Group begins consumption. Measured in seconds, this option can stagger the consumption progress of each Consumer Group to prevent cache reuse, thereby more accurately simulating real catch-up read scenarios. * `--send-rate-during-catchup`: Used in catch-up read test scenarios to control the sending rate of the Producer during the catch-up read period. By default, it mirrors the setting of `--send-rate`. * `--warmup-duration`: Specifies the duration of the warm-up period before conducting the test, measured in minutes. During the warm-up period, the first 50% gradually increases the Producer's sending rate to the level specified by `--send-rate`, and the latter 50% maintains it at `--send-rate`. Metrics collected during the warm-up period are excluded from the final results. To effectively warm up the JVM, it is advised to set `--warmup-duration` to at least 10 minutes. * `--test-duration`: Indicates the duration of the actual test, measured in minutes. This parameter is applicable only in non-catch-up read test scenarios (when `--backlog-duration` is less than or equal to 0). * `--reporting-interval`: Determines the frequency for collecting statistics of related metrics during the test, measured in seconds. ## Performance Optimization and Technical Support The performance of an AutoMQ cluster is influenced by various factors, including computing resource specifications and kernel parameter tuning. Performance optimization and baseline calibration for production environments can be quite complex. You can reach out to the AutoMQ team via [this form](https://www.automq.com/contact) to acquire performance test reports and best practices for performance optimization in production scenarios. # Deploy Multi-Nodes Cluster on Kubernetes Source: https://docs.automq.com/automq/deployment/deploy-multi-nodes-cluster-on-kubernetes Deploy a scalable, cost-efficient AutoMQ cluster on Kubernetes. Explore Kafka-compatible features and a 30-day free cloud trial. Contact us for guidance. This topic introduces how to deploy a multi-node AutoMQ cluster using Kubernetes, allowing users to validate cluster-related features such as partition reassignment and data auto-balancing in this development environment. In addition to the Kubernetes deployment solution, users can refer to the following documentation to explore other deployment options: * [Deploy Multi-Nodes Cluster on Linux▸](/automq/deployment/deploy-multi-nodes-cluster-on-linux) > [!TIP] > > Deploying AutoMQ and tuning parameters for production load is relatively complex. You can contact the AutoMQ team through [this form](https://www.automq.com/contact) to receive necessary assistance and best practices. Moreover, if you wish to completely avoid the burden of installation and deployment, you can experience the fully managed cloud service provided by the AutoMQ team through the following link. Currently, all cloud markets offer a free 30-day trial. * [Experience AutoMQ Cloud for free from AWS Marketplace](/automq-cloud/getting-started/install-byoc-environment/aws/install-automq-on-aws). ## Prerequisites This document provides examples for deploying a 5-node AutoMQ cluster. In this setup, 3 nodes will run both the Controller and Broker, while the other 2 nodes will run only the Broker. Ensure the following conditions are met: * Prepare a Kubernetes cluster with at least 5 nodes, recommending network-optimized virtual machines with 4 cores and 16GB of RAM for subsequent Pod creation and other operations. * Helm chart requires version v3.8.0 or later. Refer to the [Helm Chart Quickstart](https://helm.sh/docs/intro/quickstart/). * Utilize the Bitnami Helm repository. AutoMQ is fully compatible with Bitnami's Helm Charts, enabling you to customize the AutoMQ Kubernetes cluster using Bitnami's values.yaml. * Prepare 2 object storage buckets: one for storing message data and another for storing system logs and metric data. ## Deploy AutoMQ Cluster ### Step 1: Edit the Configuration File Create an empty `automq-values.yaml` file, edit it, and add specific parameters. For guidance, refer to [demo-values.yaml](https://github.com/AutoMQ/automq-labs/blob/main/opensource-examples/setup/kubernetes/bitnami/demo-values.yaml) and check recommended configuration examples for different scenarios in its subdirectories. For more details, consult the [README.md](https://github.com/AutoMQ/automq-labs/blob/main/opensource-examples/setup/kubernetes/bitnami/README.md). * Substitute `${ops-bucket}`, `${data-bucket}`, `${region}`, and `${endpoint}` with specific values for object storage. For more details, refer to [Object Storage Configuration▸](/automq/configuration/object-storage-configuration). * Replace `${access-key}` and `${secret-key}` with the actual values. You can also choose alternative authorization methods such as IAM Role. * For production-grade deployments, it is recommended to use dedicated nodes for AutoMQ (to avoid network bandwidth and other resource competition with other Pods). It is advisable to match using node affinity (nodeAffinity) and tolerations tags. * For multi-availability zone deployments, you can use the `topologySpreadConstraints` parameter to ensure Pods are evenly distributed across the specified availability zones. ```yaml theme={null} controller: topologySpreadConstraints: - maxSkew: 1 topologyKey: "topology.kubernetes.io/zone" whenUnsatisfiable: DoNotSchedule labelSelector: matchLabels: app: automq ``` * To avoid cross Availability Zone traffic, `brokerRackAssignment` will ultimately set the AutoMQ Broker's `broker.rack`. Clients need to be configured accordingly to eliminate cross-Availability Zone traffic costs. For example, the following configuration can be used in AWS EKS: ```yaml theme={null} brokerRackAssignment: aws-az ``` * Several other server-side parameters can be set as needed in `controller.extraConfig` and `broker.extraConfig`. For more details, refer to: [Broker And Controller Configuration▸](/automq/configuration/broker-and-controller-configuration). ### Step 2: Install AutoMQ Install or upgrade the AutoMQ Helm Chart using a custom YAML file: It is recommended to use the `--version` flag to specify the Bitnami Helm Chart version [31.x.x (31.1.0 \~ 31.5.0)](https://artifacthub.io/packages/helm/bitnami/kafka) when installing AutoMQ. ```bash theme={null} helm install automq-release oci://registry-1.docker.io/bitnamicharts/kafka -f demo-values.yaml --version 31.5.0 --namespace automq --create-namespace ``` Wait for the AutoMQ cluster to be ready: ```bash theme={null} kubectl --namespace automq rollout status statefulset --watch ``` When the AutoMQ cluster is ready, the output should look like the following: ```text theme={null} statefulset rolling update complete 2 pods at revision automq-kafka-broker-6c756696dd... statefulset rolling update complete 3 pods at revision automq-kafka-controller-c574d5fd5... ``` Check the Pod list: ```bash theme={null} ~/.kube kubectl get pods NAME READY STATUS RESTARTS AGE data-automq-kafka-controller-0 1/1 Running 0 16m data-automq-kafka-controller-1 1/1 Running 0 16m data-automq-kafka-controller-2 1/1 Running 0 16m data-automq-kafka-broker-0 1/1 Running 0 13m data-automq-kafka-broker-0 1/1 Running 0 13m ``` ## Test Message Sending and Receiving After the Helm execution is complete, the access address for the cluster and the commands for testing message sending and receiving will be displayed. This allows you to perform Topic message sending and consumption tests using `kafka-console-producer.sh` and `kafka-console-consumer.sh`. ![](https://mintcdn.com/automq/1QgM5miUDiCjXCsL/automq/deployment/deploy-multi-nodes-cluster-on-kubernetes/1.webp?fit=max\&auto=format\&n=1QgM5miUDiCjXCsL\&q=85\&s=a381482f5f6a2559f5f73010535eb8c1) ## Stop and Uninstall the AutoMQ Cluster * After completing the tests, AutoMQ clusters can be stopped and uninstalled using `helm uninstall`. ```bash theme={null} helm uninstall automq-release -n automq ``` * If historical data is no longer needed, it's necessary to delete the cluster's PVC and Bucket data altogether to prevent leftover data from affecting the next deployment. ## Precautions for Production Environment ### Lock Chart Version To avoid unexpected changes during deployment, it is recommended to lock the Helm Chart version. Locking the version means specifying an exact version at deployment instead of using the latest or unspecified version. Locking the Helm Chart version aids in: * **Ensure Compatibility**: Make sure the application's performance in the deployed environment aligns with its behavior during testing, even if new Chart versions are released. * **Prevent Unintended Updates**: Prevent automatic updates that may introduce changes incompatible with your current deployment or operational practices. ### Name Override When deploying multiple instances of the same Helm Chart within a Kubernetes cluster, name conflicts may occur. Use `nameOverride` and `fullnameOverride` to distinguish between different instances. For example, using distinct names for your production and staging environments can help avoid confusion. * Using `nameOverride`, the StatefulSet name will be `-`. * Using `fullnameOverride`, the StatefulSet name will be ``. ```yaml theme={null} nameOverride: 'automq-prod' fullnameOverride: 'automq-instance-prod' ``` ### Docker Image Bitnami provides the Docker image for AutoMQ deployment, with the default image being `bitnami/kafka:latest`. You should replace it with a custom AutoMQ image specifying a particular version: ```yaml theme={null} global: security: allowInsecureImages: true image: registry: automqinc repository: automq tag: 1.5.5-bitnami pullPolicy: Always ``` ### Scheduling Strategy For AutoMQ, a refined scheduling strategy in Kubernetes can be implemented using node affinities and tolerations. We suggest that a production-level AutoMQ operates exclusively without co-locating with other applications. It is advisable to tailor label matching rules based on node types: #### Tolerance It is recommended to add a taint to the Kubernetes node group: `key: "dedicated", operator: "Equal", value: "automq", effect: "NoSchedule"`. ```yaml theme={null} controller: tolerations: - key: "dedicated" operator: "Equal" value: "automq" effect: "NoSchedule" broker: tolerations: - key: "dedicated" operator: "Equal" value: "automq" effect: "NoSchedule" ``` #### Node Affinity Override the default values in the controller/broker configuration to match the node labels (e.g., `node-type: m7g.xlarge`): ```yaml theme={null} controller: affinity: nodeAffinity: requiredDuringSchedulingIgnoredDuringExecution: nodeSelectorTerms: - matchExpressions: - key: "node-type" operator: In values: ["m7g.xlarge"] ``` #### Pod Anti-affinity Ensure that the controller component and the broker component are not scheduled on the same node by using the `podAntiAffinity` parameter: ```yaml theme={null} controller: affinity: podAntiAffinity: requiredDuringSchedulingIgnoredDuringExecution: - labelSelector: matchExpressions: - key: app.kubernetes.io/instance operator: In values: - automq - key: app.kubernetes.io/component operator: In values: - controller-eligible - broker topologyKey: kubernetes.io/hostname ``` ### Scaling #### Controller The number of instances is configured through `controller.replicas`, which supports horizontal scaling. By default, the cluster deploys 3 Controller Pods, but users can customize the number of Controller replicas. > [!CAUTION] > > Note: Once the cluster deployment is complete, adjusting the replicas for the Controller is not recommended to avoid unexpected risks. #### Broker The number of instances is configured through `broker.replicas`, which supports horizontal scaling. #### AutoScaling (HPA) HPA is disabled by default. To enable it, you can configure parameters in `broker.autoscaling.hpa`: ```yaml theme={null} broker: autoscaling: hpa: enabled: true # Enable HPA minReplicas: "1" # Minimum Replicas maxReplicas: "3" # Maximum Replicas targetCPU: "60" # Target CPU Utilization Rate (%) targetMemory: "" # Target Memory Utilization (% Optional) ``` > [!CAUTION] > > Note: We do not recommend configuring Controller HPA because the Controller in Kafka KRaft mode relies on the Raft protocol to maintain metadata consistency, which does not support automated Raft membership changes. Therefore, configuring Controller HPA could lead to quorum failure or make the cluster unavailable. ### Resource Configuration It is recommended that each Pod for AutoMQ runs on resources of 4Core16GB. Adjust resource parameters through the following configurations: ```yaml theme={null} controller: replicaCount: 3 resources: requests: cpu: "3000m" memory: "12Gi" limits: cpu: "4000m" memory: "16Gi" heapOpts: -Xmx6g -Xms6g -XX:MaxDirectMemorySize=6g -XX:MetaspaceSize=96m ``` ```yaml theme={null} broker: replicaCount: 2 resources: requests: cpu: "3000m" memory: "12Gi" limits: cpu: "4000m" memory: "16Gi" heapOpts: -Xmx6g -Xms6g -XX:MaxDirectMemorySize=6g -XX:MetaspaceSize=96m ``` ### Security and Authentication Each listener configured in Kafka can have a different authentication protocol. For instance, you can use `sasl_tls` authentication for client communications and `tls` for inter-Controller and Broker communications. The table below lists available protocols and their security features (see more details in [Kafka Security Authentication](https://github.com/bitnami/charts/blob/main/bitnami/kafka/README.md#enable-security-for-kafka)): | Method | Authentication Method | Encrypted via TLS | | - | - | - | | plaintext | None | No | | tls | None | Yes | | mtls | Yes (Mutual Authentication) | Yes | | sasl | Yes (via SASL) | No | | sasl\_tls | Yes (via SASL) | Yes | ### External Access Additional listeners and advertised listeners must be configured, and a specific service must be created for each Kafka Pod. There are three ways to configure external access: by using LoadBalancer services, NodePort services, or ClusterIP services. For more information, refer to the [Kafka External Access](https://github.com/bitnami/charts/blob/main/bitnami/kafka/README.md#accessing-kafka-brokers-from-outside-the-cluster) section. ### **Monitoring** The primary focus is on the integration of this Chart with Prometheus. For more details, refer to the section [Enable Prometheus Metrics](https://github.com/bitnami/charts/tree/main/bitnami/kafka#prometheus-metrics). ### Table Topic Feature The Table Topic feature supports integration between topic streaming data and a static data lake. To enable the Table Topic feature in an AutoMQ cluster, refer to [Overview▸](/automq/table-topic/overview). # Deploy Multi-Nodes Cluster on Linux Source: https://docs.automq.com/automq/deployment/deploy-multi-nodes-cluster-on-linux Deploy a scalable, multi-node AutoMQ cluster on Linux with full Kafka compatibility. Benefit from object storage integration and cloud-native performance. This document outlines how to deploy a multi-node AutoMQ cluster on a Linux host (utilizing object storage services from cloud vendors or S3-compatible storage software). In this development environment, users can test cluster-related features such as partition reassignment and automatic data balancing. In addition to the Linux host deployment plan, users can refer to the following documents to explore other deployment options: * [Deploy Multi-Nodes Cluster on Kubernetes▸](/automq/deployment/deploy-multi-nodes-cluster-on-kubernetes) > [!TIP] > > Deploying AutoMQ for production workloads and optimizing its parameters can be relatively complex. You can reach out to the AutoMQ team through [this form](https://www.automq.com/contact) for necessary assistance and best practices. Moreover, if you want to completely eliminate the installation and deployment effort, you can try the fully managed cloud services provided by the AutoMQ team through the link below. Currently, all cloud markets offer a free 30-day trial. * [Get a free AutoMQ Cloud trial from AWS Marketplace](https://docs.automq.com/automq-cloud/getting-started/install-byoc-environment/aws/install-automq-on-aws). ## **Prerequisites** This documentation example is intended to deploy a 5-node AutoMQ cluster, where 3 nodes run both the Controller and Broker, and the remaining 2 nodes run only the Broker. Ensure the following prerequisites: * Five Linux hosts, preferably network-optimized virtual machines with 4 CPUs and 16GB of RAM, for deploying the AutoMQ cluster. Make sure the system disk storage space is at least 20GB, and data volume disk space is no less than 20GB (required only for deploying Controller nodes). An example is as follows: | Role | IP | Node ID | System Volume | Metadata Volume | | - | - | - | - | - | | Controller + Broker | 192.168.0.1 | 0 | EBS 20GB | EBS 20GB | | Controller + Broker | 192.168.0.2 | 1 | EBS 20GB | EBS 20GB | | Controller + Broker | 192.168.0.3 | 2 | EBS 20GB | EBS 20GB | | Broker | 192.168.0.4 | 1000 | EBS 20GB | Not applicable | | Broker | 192.168.0.5 | 1001 | EBS 20GB | Not applicable | * Download the binary installation package to set up AutoMQ. Refer to [Software Artifact▸](/automq/releases/software-artifact). * Create two custom-named object storage buckets, such as automq-data and automq-ops, as used in this document. * Create an IAM user and generate an Access Key ID and Access Key Secret for it. Then, ensure that the IAM user has full read and write permissions to the previously created object storage bucket. * Install jemalloc to optimize memory allocation. Refer to [Getting-started](https://github.com/jemalloc/jemalloc/wiki/getting-started). > [!TIP] > > AutoMQ relies on the Kafka KRaft component for maintaining cluster metadata; therefore, in production scenarios, each cluster requires the deployment of at least 3 nodes (running both Controller and Broker). ## Install and Launch the AutoMQ Cluster ### Step 1: Create a Cluster Deployment Project AutoMQ provides the `automq-cli.sh` tool for managing AutoMQ clusters. By using the command `automq-cli.sh cluster create [project]`, a cluster configuration template will be automatically created in the directory `clusters/[project]/topo.yaml`. ```bash theme={null} bin/automq-cli.sh cluster create poc ``` An example of the execution result is as follows: ```text theme={null} Success create AutoMQ cluster project: poc ======================================================== Please follow the steps to deploy AutoMQ cluster: 1. Modify the cluster topology config clusters/poc/topo.yaml to fit your needs 2. Run ./bin/automq-cli.sh cluster deploy --dry-run clusters/poc , to deploy the AutoMQ cluster ``` ### Step 2: Edit the Cluster Configuration Template Edit the configuration template generated in Step 1 during cluster creation. An example of the configuration template is as follows: ```yaml theme={null} global: clusterId: '' # Bucket URI Pattern: 0@s3://$bucket?region=$region&endpoint=$endpoint # Bucket URI Example: # AWS : 0@s3://xxx_bucket?region=us-east-1 # OCI: 0@s3://xxx_bucket?region=us-ashburn-1&endpoint=https://xxx_namespace.compat.objectstorage.us-ashburn-1.oraclecloud.com&pathStyle=true config: | s3.data.buckets=0@s3://xxx_bucket?region=us-east-1 s3.ops.buckets=1@s3://xxx_bucket?region=us-east-1 s3.wal.path=0@s3://xxx_bucket?region=us-east-1 log.dirs=/root/kraft-logs envs: - name: KAFKA_S3_ACCESS_KEY value: 'xxxxx' - name: KAFKA_S3_SECRET_KEY value: 'xxxxx' controllers: # The Controllers Default Are Combined Nodes Which Roles Are Controller and Broker. # The Default Controller Port Is 9093 and the Default Broker Port Is 9092 - host: 192.168.0.1 nodeId: 0 - host: 192.168.0.2 nodeId: 1 - host: 192.168.0.3 nodeId: 2 brokers: - host: 192.168.0.5 nodeId: 1000 - host: 192.168.0.6 nodeId: 1001 ``` * `global.clusterId`: A randomly generated unique ID, which does not require modification. * `global.config`: This is the custom incremental configuration for all nodes within the cluster. You need to specify actual values for `s3.data.buckets`, `s3.ops.buckets`, and `s3.wal.path`. Additional configuration items can be added with line breaks. For details on configuring object storage parameters for different cloud providers, refer to [Object Storage Configuration▸](/automq/configuration/object-storage-configuration). * `global.envs`: These are the environment variables for the node. Replace `KAFKA_S3_ACCESS_KEY` and `KAFKA_S3_SECRET_KEY` with actual values. * `controllers`: This is a list of Controller nodes that must be updated with actual values. * `brokers`: This is a list of Broker nodes that also need to be updated with actual values. ### Step 3: Start AutoMQ Execute the cluster pre-check command to generate the final startup command. ```bash theme={null} bin/automq-cli.sh cluster deploy --dry-run clusters/poc ``` This command will initially verify the S3 configuration for accuracy, ensure successful access to S3, and then output the startup commands for each node. An example output is as follows: ```text theme={null} Host: 192.168.0.1 KAFKA_S3_ACCESS_KEY=xxxx KAFKA_S3_SECRET_KEY=xxxx ./bin/kafka-server-start.sh -daemon config/kraft/server.properties --override cluster.id=JN1cUcdPSeGVnzGyNwF1Rg --override node.id=0 --override controller.quorum.voters=0@192.168.0.1:9093,1@192.168.0.2:9093,2@192.168.0.3:9093 --override advertised.listeners=PLAINTEXT://192.168.0.1:9092 --override s3.data.buckets='0@s3://xxx_bucket?region=us-east-1' --override s3.ops.buckets='1@s3://xxx_bucket?region=us-east-1' --override s3.wal.path='0@s3://xxx_bucket?region=us-east-1' --override log.dirs='/root/kraft-logs' ... ``` To start the cluster, sequentially execute the list of commands provided in the previous step on the designated CONTROLLER or BROKER hosts. For instance, on 192.168.0.1, begin the first CONTROLLER process by executing the corresponding command from the generated startup command list for that host. ```bash theme={null} KAFKA_S3_ACCESS_KEY=xxxx KAFKA_S3_SECRET_KEY=xxxx ./bin/kafka-server-start.sh -daemon config/kraft/server.properties --override cluster.id=JN1cUcdPSeGVnzGyNwF1Rg --override node.id=0 --override controller.quorum.voters=0@192.168.0.1:9093,1@192.168.0.2:9093,2@192.168.0.3:9093 --override advertised.listeners=PLAINTEXT://192.168.0.1:9092 --override s3.data.buckets='0@s3://xxx_bucket?region=us-east-1' --override s3.ops.buckets='1@s3://xxx_bucket?region=us-east-1' --override s3.wal.path='0@s3://xxx_bucket?region=us-east-1' --override log.dirs='/root/kraft-logs' ``` ## Test Message Sending and Receiving After installing and starting the AutoMQ cluster, you can test message sending, consumption, and other functionalities by executing the Kafka CLI commands available in the bin directory of the installation package. 1. Execute the following command to run kafka-topics.sh and create a Topic. ```bash theme={null} bin/kafka-topics.sh --create --topic quickstart-events --bootstrap-server 192.168.0.1:9092,192.168.0.2:9092,192.168.0.3:9092 ``` 1. Execute the following command to run kafka-console-producer.sh and send test messages. ```bash theme={null} bin/kafka-console-producer.sh --topic quickstart-events --bootstrap-server 192.168.0.1:9092,192.168.0.2:9092,192.168.0.3:9092 ``` 1. Execute the following command to run kafka-console-consumer.sh and consume test messages. ```bash theme={null} bin/kafka-console-consumer.sh --topic quickstart-events --from-beginning --bootstrap-server 192.168.0.1:9092,192.168.0.2:9092,192.168.0.3:9092 ``` ## Stop and Uninstall the AutoMQ Cluster. After completing the tests, you can refer to the following steps to stop and uninstall the AutoMQ cluster. 1. Run the following command on each node to terminate the process. ```bash theme={null} bin/kafka-server-stop.sh ``` 2. You can automatically clear data in `s3-data-bucket` and `s3-ops-bucket` by setting lifecycle rules for object storage, and then remove these buckets. 3. Delete the created compute instances along with their respective system volumes and data volumes. 4. Remove the IAM user set up for testing along with its Access Key ID and Access Key Secret. > [!TIP] > > Table Topic is a core feature designed by AutoMQ for modern data lake architectures. It integrates streaming data with static data lakes and addresses traditional stream-batch separation, complex ETL processes, and high costs through architectural innovation. For instructions on enabling Table Topic in the cluster, refer to [Overview▸](/automq/table-topic/overview). # Introduction and Deployment Recommendations for AutoMQ Open Source Image Source: https://docs.automq.com/automq/deployment/deployment-recommendations AutoMQ offers cloud-native scalability and Kafka protocol compatibility, enabling flexible deployments in complex environments with Kubernetes lifecycle tools for efficient resource management. ## Introduction AutoMQ is a cloud-native streaming platform that is fully compatible with the Apache Kafka protocol. This topic describes that when deploying a multi-node AutoMQ cluster based on Kubernetes, it is possible to use Kubernetes application lifecycle management tools such as custom ` Helm Chart ` , ` Operator ` to flexibly transform and adapt relevant dependent resources and configurations, and finally complete the deployment in a complex environment. ## Analysis of Differences between AutoMQ & Apache Kafka Docker Images ### Init & Startup | - | Apache Kafka Open Source Image | AutoMQ Open Source Image | | - | - | - | | Startup Mode | encapsulates the default startup logic and is Out Of The Box | Compatible with the startup logic of the Apache Kafka Docker image, Out Of The Box | | Configuration Method |
  • Provides configuration conversion logic for environment variables with specific [rules](https://github.com/apache/kafka/blob/trunk/docker/examples/README.md#using-environment-variables)
  • Fixed mount path: /opt/kafka/config/server.properties
|
  • Configuration conversion logic for environment variables compatible with Apache Kafka docker image
  • server.properties can also be flexibly injected using other methods such as Helm Chart/Operator
  • The mount path of the configuration file is consistent with that of the Apache Kafka Docker image
| | Simple example | [Apache Kafka Docker Hub](https://hub.docker.com/r/apache/kafka#overriding-the-default-broker-configuration) | [AutoMQ for Apache Kafka](https://github.com/AutoMQ/automq-labs/tree/main/opensource-examples/setup/docker-compose/kafka) | ### AutoMQ-specific configuration AutoMQ employs a shared storage architecture and requires additional startup configuration parameters. It is important to note that all parameters detailed later in this chapter fall under these additional requirements and are mandatory for proper operation. #### S3 primary storage Required shared storage parameters: ```properties theme={null} # Object Storage settings. You will need to replace the placeholder values (marked with `${...}`), such as the S3 bucket names (`ops-bucket`, `data-bucket`), bucket region, and endpoint. s3.data.buckets=0@s3://${data-bucket}?region=${region}&endpoint=${endpoint} s3.wal.path=0@s3://${data-bucket}?region=${region}&endpoint=${endpoint} s3.ops.buckets=1@s3://${ops-bucket}?region=${region}&endpoint=${endpoint} elasticstream.enable=true ``` #### Kraft ##### node.id Among the many Kubernetes application lifecycle management tools, there is already a feature that dynamically injects node.id into server.properties based on the Kubernetes Statefulset ID prefix; however, additional necessary generation rules are still required: * Controller node.id needs to increment starting from 0 (min.id=0) * Broker node.id needs to increment starting from 1000 (min.id=1000) ```properties theme={null} # controller node.id start with 0 node.id=0 # broker node.id start with 1000 node.id=1000 ``` ##### role We recommend that Controller serve as both controller and broker roles simultaneously ```properties theme={null} process.roles=broker,controller ``` #### Listener AutoMQ is fully compatible with the Kafka Listener system and can be customized to set `PLAINTEXT` , `SASL` , `TLS` , `mTLS` protocols, with the default being `PLAINTEXT` . It is worth noting that if the `inter-broker` protocol is not PLAINTEXT, you need to set the corresponding inter-broker authentication protocol (taking SASL\_PLAINTEXT as an example) for the `AutoBalancer` component of AutoMQ in the configuration: ```properties theme={null} # need replace SASL_PLAINTEXT "inter_broker_user" and "interbroker-password-placeholder" autobalancer.client.auth.sasl.mechanism=PLAIN autobalancer.client.auth.sasl.jaas.config=org.apache.kafka.common.security.plain.PlainLoginModule required username="${inter_broker_user}" password="${interbroker-password-placeholder}" user_inter_broker_user="${interbroker-password-placeholder}"; autobalancer.client.auth.security.protocol=SASL_PLAINTEXT autobalancer.client.listener.name=INTERNAL ``` ### AutoMQ-specific Env Configure and use the `AK/SK` with read and write permissions to access your Bucket: ```yaml theme={null} - name: "AWS_ACCESS_KEY_ID" value: "yourAccessKey" - name: "AWS_SECRET_ACCESS_KEY" value: "yourSecretKey" ``` > The actual AK/SK can be stored in Kubernetes Secrets and referenced to ensure the security of AK/SK ### No configuration required AutoMQ, which builds its core architecture on object storage, has fundamental differences from traditional Kafka: object storage itself provides high durability and redundancy capabilities. Therefore, some replica-related parameters in traditional Kafka that are used to ensure data reliability, the following replica-related configurations are no longer needed or have no effect in AutoMQ: ```properties theme={null} offsets.topic.replication.factor=3 transaction.state.log.replication.factor=3 transaction.state.log.min.isr=2 default.replication.factor=1 min.insync.replicas=1 ``` ### Resource request Due to the difference in architecture, AutoMQ relies more on object storage compared to Kafka. In contrast, AutoMQ no longer requires local Data Log disk storage Therefore, when only ` Metadata PV ` is retained for the Controller, all other ` PVCs ` can be removed. ### Observability AutoMQ provides a complete set of methods for building an observable system. For details, see: [AutoMQ Observability](https://docs.automq.com/automq/observability/overview) # Deployment Recommendations When using your custom Helm Chart or Operator, it is best to first try using [ AutoMQ Labs ](https://hub.docker.com/r/apache/kafka#overriding-the-default-broker-configuration) for deployment experience, which demonstrates the unified configuration pass-through method by setting Env and reusing the Apache Kafka Docker Image. This will help you better use your custom Kubernetes application lifecycle management tool to deploy AutoMQ. ### Image Specify the AutoMQ Docker Image for your main [container](https://hub.docker.com/r/automqinc/automq/tags?name=-kafka) Reference ```text theme={null} automqinc/automq:1.6.0-rc0-kafka ``` ### Config & Env We recommend uniformly using Env to set the above-mentioned specific dependency configuration for AutoMQ (the way to pass in the configuration of the Apache Kafka Docker Image), and `using KAFKA_` as the prefix to set the key-value pairs that we ultimately want to pass through to server.properties. ```yaml theme={null} - name: "KAFKA_PROCESS_ROLES" value: "controller,broker" - name: "KAFKA_S3_DATA_BUCKETS" value: "0@s3://${data-bucket}?region=${region}&endpoint=${endpoint}" - name: "KAFKA_S3_WAL_PATH" value: "0@s3://${data-bucket}?region=${region}&endpoint=${endpoint}" - name: "KAFKA_S3_OPS_BUCKETS" value: "1@s3://${ops-bucket}?region=${region}&endpoint=${endpoint}" - name: "KAFKA_ELASTICSTREAM_ENABLE" value: "true" ``` and the Env actually needed ```yaml theme={null} - name: "AWS_ACCESS_KEY_ID" value: "yourAccessKey" - name: "AWS_SECRET_ACCESS_KEY" value: "yourSecretKey" ``` ## Other production-level recommendations ### Production Deployment #### Server Resource Configuration We recommend that each Pod for resource deployment of AutoMQ be deployed exclusively and run on resources of 2Core16GB or higher, and appropriately adjust the `requests` and `limits` of the AutoMQ server (Statefulset) in Kubernetes. > [!TIP] > > Note: The specific resource configuration method depends on the capabilities and entry points provided by your Kubernetes application lifecycle management tool #### Scheduling Policy Through ` nodeAffinities ` , ` tolerations ` , ` podAntiAffinities ` strategies, AutoMQ can implement fine-grained scheduling strategies in Kubernetes. We recommend that production-level AutoMQ be exclusive and non-mixed deployment. > [!TIP] > > Note: The specific way to set up scheduling depends on the capabilities and entry points provided by your Kubernetes application lifecycle management tool. #### Replicas Through the Kafka cluster of your Kubernetes application lifecycle management tool, it supports modifying configurations such as ` replicas ` to achieve the purpose of horizontal volume expansion and contraction. > [!CAUTION] > > Note: However, we recommend that the cluster be deployed with 3 Controller Pods and several Broker Pods by default, and do not recommend dynamically adjusting the replicas of the Controller to avoid unexpected risks. #### AutoScaling (HPA) Use your Kubernetes application lifecycle management tool to set and enable `HPA ` for dynamic volume expansion and contraction. > [!CAUTION] > > Note: We also do not recommend configuring Controller HPA because the Controller in Kafka KRaft mode relies on the Raft protocol to maintain metadata consistency and does not support automated Raft member changes. Therefore, configuring Controller HPA may cause Quorum failure or cluster unavailability. ### Performance optimization AutoMQ also supports setting additional properties parameters and ENV for performance optimization. For details, see: [Performance Tuning for Broker](/automq/deployment/performance-tuning-for-broker) # Deploy Multi-Nodes Cluster on Kubernetes with Strimzi Source: https://docs.automq.com/automq/deployment/multi-nodes-cluster-with-strimzi Deploy a multi-node AutoMQ cluster on Kubernetes with Strimzi. Covers Kafka-compatible features, scheduling, scaling, and a free 30-day AWS trial. This topic describes how to use Strimzi to deploy a multi-node AutoMQ cluster, where users can verify cluster-related features such as partition migration and automatic data balancing in this Development Environment. In addition to the Strimzi-based Kubernetes deployment solution, users can refer to the following documents to experience other deployment solutions: * [Deploy Multi-Nodes Cluster on Kubernetes](https://docs.automq.com/automq/deployment/deploy-multi-nodes-cluster-on-kubernetes) * [Deploy Multi-Nodes Cluster on Linux](https://docs.automq.com/automq/deployment/deploy-multi-nodes-cluster-on-linux) > [!TIP] > > Deploying AutoMQ for production environment workloads and tuning its parameters are relatively complex. You can contact the AutoMQ team via [the form here](https://www.automq.com/contact) to obtain the necessary assistance and best practices. Additionally, if you wish to completely avoid the workload of installation and deployment, you can experience the full-service Cloud as a Service provided by the AutoMQ team via the following link. Currently, all cloud marketplaces offer a free 30-day trial experience. * [Experience AutoMQ Cloud for free from AWS Marketplace](https://docs.automq.com/automq-cloud/getting-started/install-byoc-environment/aws/install-automq-on-aws). ## Prerequisites This document example is used to deploy a 4-node AutoMQ cluster, where 3 nodes run Controller ( Controller and Broker), and the remaining 1 node runs only Broker. The following conditions need to be checked in advance: * Prepare a Kubernetes cluster, ensure it has at least 4 Nodes, and it is recommended to use network-optimized virtual machines with 2 cores and 16GB of memory, on which Pod creation and other operations will be performed later. * Ensure that the Helm Chart version is v3.8.0 or higher. Refer to [Helm Chart Quick Start](https://helm.sh/docs/intro/quickstart/). * Prepare 2 Object Storage Buckets, one for storing message data and one for storing system logs and Metric data. > Strimzi provides multiple types of Operators. Unless otherwise specified below, all references refer to the Cluster Operator. ## Deploy Strimzi Operator ### Step 1: Edit the configuration file Create an empty `strimzi-values.yaml` file, which is recommended to be consistent with the example configuration [strimzi-values.yaml](https://github.com/AutoMQ/automq-labs/tree/main/opensource-examples/setup/kubernetes/strimzi/strimzi-values.yaml) , and then add additional parameters as needed. Strimzi supports multiple Kafka-related components, and AutoMQ is mainly adapted to the `KAFKA ` component, and supports only version 3.9.0. ### Step 2: Install the Strimzi Operator Use the configuration file just created and install the Strimzi Operator via `helm install` . * Specify `version` as 0.47 to ensure stability and avoid unnecessary issues. ```bash theme={null} helm install automq-strimzi-operator oci://quay.io/strimzi-helm/strimzi-kafka-operator \ --version 0.47.0 \ --namespace automq \ --create-namespace \ --values strimzi-values.yaml ``` Waiting for Operator to be ready ```bash theme={null} kubectl --namespace automq rollout status deployment strimzi-cluster-operator --watch ``` When the Operator is ready, it should output something similar to the following: ```text theme={null} deployment "strimzi-cluster-operator" successfully rolled out ``` View Pod List: ```text theme={null} kubectl get pods -n automq -w NAME READY STATUS RESTARTS AGE strimzi-cluster-operator-8dfd94b6d-nb9z6 1/1 Running 0 82s ``` ## Deploy AutoMQ Cluster ### Step 1: Edit the configuration file Create an empty `automq-demo.yaml` file, edit the file, and add specific parameters. You can refer to the recommended configuration examples for different scenarios under [automq-demo.yaml](https://github.com/AutoMQ/automq-labs/tree/main/opensource-examples/setup/kubernetes/strimzi/automq-demo.yaml) and its subdirectories. For more details, refer to [README.md](https://github.com/AutoMQ/automq-labs/tree/main/opensource-examples/setup/kubernetes/strimzi/README.md). * Replace `${ops-bucket}` , `${data-bucket}` , `${region}` , `${endpoint}` with the specific values of Object Storage. For details, see [Object Storage Configuration](https://docs.automq.com/automq/configuration/object-storage-configuration) . * Replace `${access-key}` and `${secret-key}` with actual values. You can also choose other authorization methods such as IAM Role. * Multi-Available Zone deployment can use the `topologySpreadConstraints` parameter to ensure that Pods are evenly distributed across specified Available Zones. ```yaml theme={null} topologySpreadConstraints: - maxSkew: 1 topologyKey: topology.kubernetes.io/zone whenUnsatisfiable: DoNotSchedule labelSelector: matchLabels: strimzi.io/pool-name: controller or broker ``` * Avoid cross-Available Zone traffic. The following configuration will obtain the topology.kubernetes.io/zone of the current node label, ultimately achieving the effect of eliminating cross-Available Zone traffic costs. ```yaml theme={null} spec: kafka: rack: topologyKey: topology.kubernetes.io/zone ``` * Disable the shrinkage check. Enabling this configuration allows automq to quickly complete shrinkage, and details can be found in the volume expansion and contraction section below. ```yaml theme={null} metadata: name: my-cluster annotations: strimzi.io/node-pools: enabled strimzi.io/kraft: enabled strimzi.io/skip-broker-scaledown-check: "true" ``` * It is recommended to deploy AutoMQ exclusive nodes at the production level (to avoid competing for resources such as internet bandwidth with other Pods), and it is advisable to match them through labels for node affinity and tolerations. * Other server level parameters can be set as needed in `spec.kafka.config` . For details, refer to: [Broker and Controller Configuration](https://docs.automq.com/automq/configuration/broker-and-controller-configuration). ### Step 2: Install AutoMQ Install AutoMQ using the custom `automq-demo.yaml` file ```bash theme={null} kubectl apply -f automq-demo.yaml -n automq ``` Waiting for AutoMQ cluster to be ready: ```bash theme={null} kubectl --namespace automq get kafka my-cluster --watch ``` When the AutoMQ cluster is ready, the output should be similar to the following: ```text theme={null} NAME READY METADATA STATE WARNINGS my-cluster True KRaft True ``` View Pod List: ```text theme={null} kubectl get pods -n automq -w NAME READY STATUS RESTARTS AGE my-cluster-broker-1000 1/1 Running 0 9m28s my-cluster-controller-0 1/1 Running 0 9m28s my-cluster-controller-1 1/1 Running 0 9m28s my-cluster-controller-2 1/1 Running 0 9m28s my-cluster-entity-operator-6948bd66c4-4962d 2/2 Running 0 103s strimzi-cluster-operator-678cc9fbc8-x46z4 1/1 Running 0 11m ``` ## Test message sending and receiving * When accessing the Kafka cluster within the k8s cluster, the format of its server address is: ```text theme={null} -kafka-bootstrap ``` For example, in our example, the access address is: `my-cluster-kafka-bootstrap:9092` > For details, see: [Strimzi ref list of kafka cluster resources str](https://strimzi.io/docs/operators/latest/deploying#ref-list-of-kafka-cluster-resources-str) Next, you can perform Topic message sending and consumption tests based on `kafka-console-producer.sh` , `kafka-console-consumer.sh` . * Start the producer and test sending messages (the topic will be automatically created by default): ```bash theme={null} kubectl -n automq run automq-producer -ti --image=automqinc/automq:1.5.5 --rm=true --restart=Never -- /opt/kafka/kafka/bin/kafka-console-producer.sh --bootstrap-server my-cluster-kafka-bootstrap:9092 --topic my-topic If you don't see a command prompt, try pressing enter. >Hi, this is AutoMQ! ``` * Start the consumer and test receiving messages: ```bash theme={null} kubectl -n automq run kafka-consumer -ti --image=automqinc/automq:1.5.5 --rm=true --restart=Never -- /opt/kafka/kafka/bin/kafka-console-consumer.sh --bootstrap-server my-cluster-kafka-bootstrap:9092 --topic my-topic --from-beginning If you don't see a command prompt, try pressing enter. Hi, this is AutoMQ! ``` ## Uninstall * After completing the test, you can stop and uninstall the Strimzi Operator via ` helm uninstall ` . ```bash theme={null} helm uninstall automq-strimzi-operator --namespace automq ``` * Stop and uninstall automq ```bash theme={null} kubectl delete -f automq-demo.yaml -n automq ``` * If historical data is no longer needed, the PVC and Bucket data of the cluster must be deleted together to prevent dirty data from affecting the next deployment. ## Precautions for the production environment ### Fix the Strimzi Operator version To avoid unexpected changes during deployment, it is recommended to fix the Strimzi Operator version to `0.47` . This helps: * **Ensure Compatibility** : Ensure that the behavior of the deployed application is consistent with that in testing and is not affected by the release of new versions. * **Avoid accidental updates** : Prevent automatic updates from introducing changes that are incompatible with current deployment or operational practices. ### Namespace Management The Strimzi Operator is only responsible for managing AutoMQ clusters created within **the namespace where it resides** (e.g., automq). The Operators of Apache Kafka and AutoMQ should be deployed in different Namespaces. To avoid conflicts, it is recommended to create a new Namespace when using AutoMQ, and completely delete this Namespace after use . ### Docker mirroring The Strimzi Operator uses the Kafka 3.9 version mirroring address by default as ` quay.io/strimzi/kafka:latest-kafka-3.9.0 ` , which needs to be modified to the AutoMQ custom mirroring and specific version: ```yaml theme={null} - name: STRIMZI_KAFKA_IMAGES value: | 3.9.0=automqinc/automq:1.6.0-rc0-strimzi 3.9.1=quay.io/strimzi/kafka:0.47.0-kafka-3.9.1 4.0.0=quay.io/strimzi/kafka:0.47.0-kafka-4.0.0 ``` ### Storage Class In this example, we are using AWS's gp2 storage type. If you are using non-AWS or have different requirements, you can make adjustments based on the actual situation. ```yaml theme={null} storage: type: jbod volumes: - id: 0 type: persistent-claim size: 20Gi kraftMetadata: shared deleteClaim: false class: gp2 ``` ### Autobalancer Configuration The ` autobalancer ` in PLAINTEXT mode must explicitly configure parameters in the following format: ` listener.name - port ` . ```yaml theme={null} spec: kafka: config: autobalancer.client.listener.name: PLAIN1-9092 ``` ### Scheduling Policy Through node affinity (nodeAffinities) and toleration (tolerations), fine-grained scheduling policies can be implemented for AutoMQ in Kubernetes. We recommend that production-level AutoMQ be exclusive and non-mixed workload. It is recommended to customize label matching rules based on node types: #### Tolerance It is recommended to add taints to the Kubernetes node group ` key: "dedicated", operator: "Equal", value: "automq", effect: "NoSchedule" ` . ```yaml theme={null} tolerations: - key: "dedicated" operator: "Equal" value: "automq" effect: "NoSchedule" ``` #### Node Affinity Override the default values in the controller/broker configuration to match node labels (such as `node-type: r6in.large` ) ```yaml theme={null} nodeAffinity: requiredDuringSchedulingIgnoredDuringExecution: nodeSelectorTerms: - matchExpressions: - key: "node-type" operator: In values: ["r6in.large"] ``` #### Pod Anti-Affinity Ensure that the controller component and the broker component are not scheduled to the same node, using the `podAntiAffinity` parameter: ```yaml theme={null} affinity: podAntiAffinity: requiredDuringSchedulingIgnoredDuringExecution: - labelSelector: matchExpressions: - key: strimzi.io/component-type operator: In values: - kafka topologyKey: kubernetes.io/hostname ``` ### Volume Expansion and Contraction #### Controller The number of Controller instances is specified through the `controller.replicas` configuration item, and does not support horizontal volume expansion and contraction. It is recommended to configure 3 instances, but it can be adjusted according to actual needs. > [!CAUTION] > > Note: After the Clustered Deployment is completed, adjusting the Replicas of the Controller is not supported to avoid unexpected risks. #### Broker The number of instances is configured through ` broker.replicas ` , supporting horizontal volume expansion and contraction. Note that the following parameters must be configured during volume contraction: ```yaml theme={null} apiVersion: kafka.strimzi.io/v1beta2 kind: Kafka metadata: name: my-cluster annotations: strimzi.io/skip-broker-scaledown-check: "true" ``` When there is Partition data on the Broker to be deleted, Strimzi will default to preventing volume contraction. For traditional Kafka, Cruise Control can be used to complete data migration, ensuring that the Broker has no data before performing volume contraction. Strimzi also provides the parameter `skip-broker-scaledown-check` to skip this check. Since AutoMQ adopts **the Shared Storage architecture** , this parameter can be enabled **without** the risk of data loss. > For details, see: [Strimzi prevent broker scale down if containing partition replicas](https://strimzi.io/blog/2024/01/03/prevent-broker-scale-down-if-containing-paritition-replicas/) ### Resource Allocation Each Pod of AutoMQ is recommended to run on resources of 2Core16GB. Adjust the resource parameters through the following configuration: ```yaml theme={null} spec: replicas: 3 roles: - controller - broker resources: requests: cpu: 1000m memory: 12Gi limits: cpu: 2000m memory: 16Gi template: kafkaContainer: env: - name: "KAFKA_HEAP_OPTS" value: "-Xmx6g -Xms6g -XX:MaxDirectMemorySize=6g -XX:MetaspaceSize=96m" ``` ```yaml theme={null} spec: replicas: 1 roles: - broker resources: requests: cpu: 1000m memory: 12Gi limits: cpu: 2000m memory: 16Gi template: kafkaContainer: env: - name: "KAFKA_HEAP_OPTS" value: "-Xmx6g -Xms6g -XX:MaxDirectMemorySize=6g -XX:MetaspaceSize=96m" ``` ### **Monitoring** It mainly involves the Prometheus-related configuration in Strimzi. For details, refer to the [Using Prometheus in Strimzi](https://strimzi.io/docs/operators/in-development/deploying#assembly-metrics-setup-str) section. # Overview Source: https://docs.automq.com/automq/deployment/overview AutoMQ offers cloud-native scalability and 100% Kafka compatibility on AWS, Azure, GCP, and more. It supports both public and private clouds. ## Deployment Architecture AutoMQ is a Kafka-compatible streaming platform offering storage-compute separation powered by object storage. It is designed to operate on any public cloud or private data center that supports the S3 protocol (requiring S3-compatible storage software). AutoMQ can be installed directly on Linux hosts or deployed on Kubernetes using a Helm Chart or other deployment methods. ![](https://mintcdn.com/automq/1QgM5miUDiCjXCsL/automq/deployment/overview/1.webp?fit=max\&auto=format\&n=1QgM5miUDiCjXCsL\&q=85\&s=e5f3fff7a61847d2a51a053b9bc1d2cf) ### Related Content * K8S Deployment: [Deploy Multi-Nodes Cluster on Kubernetes▸](/automq/deployment/deploy-multi-nodes-cluster-on-kubernetes) * Linux Host Deployment: [Deploy Multi-Nodes Cluster on Linux▸](/automq/deployment/deploy-multi-nodes-cluster-on-linux) * Common Server Performance Tuning: [Performance Tuning for Broker▸](/automq/deployment/performance-tuning-for-broker) * Performance Benchmarking: [AutoMQ Benchmark▸](/automq/deployment/automq-benchmark) # Performance Tuning for Broker Source: https://docs.automq.com/automq/deployment/performance-tuning-for-broker Optimize AutoMQ's broker performance with memory and network tuning, leveraging cloud-native scalability and Kafka compatibility for efficient resource allocation. AutoMQ enhances server performance through methods like read/write efficiency optimization and resource isolation, ensuring stable and efficient operation. > [!TIP] > > Users should adjust parameters based on their hardware environment and business scenarios. ## Memory-related Parameters ### s3.stream.allocator.policy Configure the memory allocation strategy for AutoMQ. It is advisable to use `POOLED_DIRECT` to alleviate GC pressure. ### s3.wal.cache.size Manage the size of the Log Cache, which influences the maximum size of cached data during Tail Read (hot reads). ### s3.block.cache.size Control the size of the Block Cache; it influences the maximum size of data cached during Catch-up Read (catch-up read, cold read). In Catch-up Read scenarios, consider appropriately increasing this value. ### s3.wal.upload.threshold Manage the amount of data AutoMQ accumulates in the Log Cache before triggering an S3 upload. It is advisable not to exceed 1/3 of `s3.wal.cache.size`. ### Recommended Parameter Values When the memory allocation strategy is `POOLED_DIRECT`, the sum of `s3.wal.cache.size` and `s3.block.cache.size` should be about 1/2 of `MaxDirectMemorySize` (if `MaxDirectMemorySize` is large, it can be slightly increased). | - | Tiny | Small | Medium | Large | | - | - | - | - | - | | Physical Memory | 4 GiB | 8 GiB | 16 GiB | 32 GiB | | s3.stream.allocator.policy | POOLED\_DIRECT | POOLED\_DIRECT | POOLED\_DIRECT | POOLED\_DIRECT | | -XX:MaxHeapSize | 1g | 2g | 6g | 12g | | -XX:MaxDirectMemorySize | 1500m | 3g | 6g | 14g | | s3.wal.cache.size | 524,288,000 | 1,073,741,824 | 2,147,483,648 | 6,442,450,944 | | s3.block.cache.size | 104,857,600 | 536,870,912 | 1,073,741,824 | 4,294,967,296 | | s3.wal.upload.threshold | 62,914,560 | 357,913,941 | 536,870,912 | 536,870,912 | ## Network-related Parameters ### s3.network.baseline.bandwidth The baseline for assessing local network bandwidth should be the network's stable capability to achieve both outbound and inbound bandwidth. Since the server internally performs operations such as writing the WAL, S3, and Compaction, each data write from a client translates into three network writes by the server. By considering the business's read/write ratio, you can ultimately determine the maximum write load a single machine can manage. # Broker Configuration Source: https://docs.automq.com/automq/eliminate-inter-zone-traffics/broker-configuration Optimize AutoMQ's inter-zone routing and rack configurations to minimize costs and enhance performance. Benefit from cloud-native scalability and 100% Kafka compatibility. ## Enable Inter-Zone Routing In clouds that charge fees for Inter-Zone traffic (such as AWS), configure `automq.zonerouter.channels` to enable Inter-Zone routing functionality. Once this feature is enabled, clients will connect only to AutoMQ nodes within the same zone for Produce and Consume operations. For example, in the diagram below, assume that a client in AZ2 wants to consume a partition located in AZ1: * For Producers: AutoMQ in AZ2 will act as a proxy node for AutoMQ in AZ1, forwarding the Produce request via the Rack-Aware Router to AutoMQ in AZ1. * For Consumers: AutoMQ in AZ2 will directly read the already written data from S3 and return it to the client. ![](https://mintcdn.com/automq/1QgM5miUDiCjXCsL/automq/eliminate-inter-zone-traffics/broker-configuration/1.webp?fit=max\&auto=format\&n=1QgM5miUDiCjXCsL\&q=85\&s=56334cadbed37d923986be6185ffbe4b) The format for configuring `automq.zonerouter.channels` is as follows: ```properties theme={null} automq.zonerouter.channels=0@s3://$bucket?region=$region[&endpoint=$endpoint][&pathStyle=$enablePathStyle][&authType=$authType][&accessKey=$accessKey][&secretKey=$secretKey][&batchInterval=250][&maxBytesInBatch=8388608] ``` Configuration consists of two parts: * Channel connection details: `$bucket?region=$region[&endpoint=$endpoint][&pathStyle=$enablePathStyle][&authType=$authType][&accessKey=$accessKey][&secretKey=$secretKey]`bash * Channel Batching Settings: By default, the Proxy node batches Produce requests every 250ms ( `batchInterval=250`) or when 8MiB (`maxBytesInBatch=8388608`) of data is accumulated, routing them to the Main node. Increasing the configured value reduces the cost of S3 API calls but increases Inter-Zone write latency. Conversely, setting a smaller value increases S3 API call costs but decreases Inter-Zone write latency. ## Configuration Mapping Rules to Identify the Originating CIDR of the Client in the Rack Due to the limitations of the Kafka protocol, the server cannot detect the specific rack a client belongs to. To address this issue and prevent cross-availability zone production and consumption, AutoMQ offers [Client Configuration▸](/automq/eliminate-inter-zone-traffics/client-configuration) as well as server-based rack configuration options. This section introduces a server-based dynamic configuration method, `automq.zone.cidr.blocks`. > [!TIP] > > In a cloud environment, racks are typically defined by [ZoneId](https://docs.aws.amazon.com/ram/latest/userguide/working-with-az-ids.html). The concepts of rack and zone mentioned later can be used interchangeably. The configuration format for `automq.zone.cidr.blocks` is as follows: ```text theme={null} # Ex. use1-az1@10.0.0.0/19,10.0.32.0/19<>use1-az2@10.0.64.0/19<>use1-az3@10.0.96.0/19 $zone1@$CIDRBlock1,$CIDRBlock2<>$zone2@$CIDRBlock3<>$zone3@$CIDRBlock4,$CIDRBlock5 ``` * Configurations for different zones are separated by `< >`. * Each zone's configuration starts with the zone identifier, followed by `@` as a delimiter, and then the current zone's CIDR list. CIDRs in the list are separated by `,`. This configuration can be dynamically changed using `kafka-config.sh`. A sample command is as follows: ```bash theme={null} ./bin/kafka-configs.sh --broker-defaults --add-config automq.zone.cidr.blocks=$config_value --alter --bootstrap-server $bootstrap_server ``` AutoMQ determines the Zone each Client belongs to by matching the Client's IP address with CIDR. The server-side configuration `automq.zone.cidr.blocks` is ideal for situations where: * The Zones where Clients reside have distinct CIDR ranges. * Computational engines such as Flink, Spark, Presto, etc., face challenges in setting different Client configurations based on the Zone handling the load. If both server-side and client-side configurations are set, the priority order is: `client.id` > `automq.zone.cidr.blocks` > Consumer `client.rack`. # Client Configuration Source: https://docs.automq.com/automq/eliminate-inter-zone-traffics/client-configuration Optimize cloud-native data flow with AutoMQ using zone identification for seamless Kafka-compatible scalability and efficient data fetching based on client zone ID. ## Setting Zone Identification In addition to identifying client zones through server-side configuration rules [Broker Configuration▸](/automq/eliminate-inter-zone-traffics/broker-configuration), AutoMQ also supports clients specifying zone information. This can be achieved by appending `automq_az=$zoneId` to `client.id`, indicating the zone to which the client belongs. The `client.id` format is as follows: ```properties theme={null} client.id=automq_az=$zoneId&existing-client-id ``` > [!TIP] > > On AWS, it is recommended to use [zoneId](https://docs.aws.amazon.com/ram/latest/userguide/working-with-az-ids.html) instead of zoneName, as zoneId is consistent across all accounts. ## Follower Fetching Consumers can set zone identification via `client.id`. Additionally, for clients with versions greater than 2.4.0, the [KIP-329 fetch from closest replicas](https://cwiki.apache.org/confluence/display/KAFKA/KIP-392%3A+Allow+consumers+to+fetch+from+closest+replica) feature can be utilized to configure zone affinity for consumption. The configuration method is as follows: ```properties theme={null} client.rack=$zoneId ``` # Monitor Inter Zone Traffic Source: https://docs.automq.com/automq/eliminate-inter-zone-traffics/monitor-inter-zone-traffic Monitor AutoMQ's inter-zone traffic with tools like iftop on Linux and AWS CloudWatch, optimizing transfers in a scalable, Kafka-compatible cloud service. After setting up Inter-Zone traffic optimization, users can track local network traffic to pinpoint actual Inter-Zone transfers by correlating with the accessed brokers. ## Command Tool for Monitoring Cross-AZ Traffic 1. Monitor network traffic: On Linux, you can use `iftop` to view the inbound and outbound traffic between your machine and other IPs. The command is as follows: ```bash theme={null} iftop -t -s 60 -L 100 -n ``` 2. Identify node availability zones: Query the cluster nodes of AutoMQ and the zones to which the nodes belong. The command is as follows: ```bash theme={null} ./bin/kafka-broker-api-versions.sh --bootstrap-server $bootstrap_server | grep id ``` Match both outputs to see if Inter-Zone traffic is generated. ## Other If your application is deployed on AWS, you can also monitor cross-zone traffic using CloudWatch's [Network Flow Monitor](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch-NetworkFlowMonitor.html) feature. # Overview Source: https://docs.automq.com/automq/eliminate-inter-zone-traffics/overview AutoMQ reduces Inter-Zone costs with S3-based storage, eliminating Kafka's data transfer traffic across zones while ensuring scalability and cost efficiency. AutoMQ's S3-based shared storage architecture can help minimize inter-broker and Inter-Zone (AZ) replica replication, as well as client Inter-Zone data read and write traffic. This document outlines how to use AutoMQ to reduce Inter-Zone transmission traffic. > [!NOTE] > > In this document, AZ stands for Availability Zone, specifically referring to a zone provided by cloud service providers in a public cloud environment. Each independent AZ may be supported by a separate data center facility. ## Problem Background ### Apache Kafka Inter-Zone Traffic Analysis When users deploy Apache Kafka across multiple AZs in AWS or GCP cloud environments, enabling multi-AZ service disaster recovery also introduces Inter-Zone data transmission costs. In large-scale clusters, these traffic costs can account for **60-70%**. * **Inter-Zone Production Traffic**: If the Producer has not specified a ShardingKey, and partitions are distributed equally across cluster nodes, at least two-thirds of the Producer's traffic will traverse across AZs. For instance, Producers located in AZ1 will route one-third of their traffic to both AZ2 and AZ3. * **Server-Side Inter-Zone Replication Traffic**: After messages reach the Kafka Broker, it ensures high reliability by replicating the data to Brokers situated in different AZs, effectively doubling the Inter-Zone traffic generated by the Produce operation. * **Inter-Zone Consumption Traffic**: Consumers have the option to configure client.rack to consume partitions/replicas within the same AZ, thus preventing the generation of Inter-Zone traffic. ![](https://mintcdn.com/automq/1QgM5miUDiCjXCsL/automq/eliminate-inter-zone-traffics/overview/1.webp?fit=max\&auto=format\&n=1QgM5miUDiCjXCsL\&q=85\&s=f8bd88c99d63e870db8d01e5d3238ed9) ### AutoMQ Eliminates Inter-Zone Data Transfer AutoMQ utilizes an architecture that separates storage and compute by leveraging S3, resulting in zero Inter-Zone traffic costs based on S3: * Production Traffic: AutoMQ's built-in Proxy layer intercepts and identifies Produce requests that cross Availability Zones (AZs). It establishes Inter-Zone proxy channels based on S3, forwarding these Produce requests to the actual partition Leader. Producers only need to communicate with Broker nodes within the same AZ, thus avoiding Inter-Zone traffic costs. * Replication Traffic: AutoMQ leverages S3 as a shared storage layer, with S3 utilizing erasure coding to create multiple replicas across various AZs. Consequently, no Apache Kafka replication traffic occurs between AutoMQ Broker nodes. * Consumption Traffic: Besides the Leader partition, AutoMQ establishes a read-only partition in each additional AZ. These read-only partitions directly access data written by the Leader partition from S3 on-demand. Therefore, consumers only need to communicate with the Leader partition or a read-only partition within the same AZ, avoiding any Inter-Zone traffic costs. ![](https://mintcdn.com/automq/1QgM5miUDiCjXCsL/automq/eliminate-inter-zone-traffics/overview/2.webp?fit=max\&auto=format\&n=1QgM5miUDiCjXCsL\&q=85\&s=c1a36516a2cb4efb94275f5a33b5c4ee) ## Configuration Documentation To eliminate Inter-Zone data transfer using AutoMQ's Inter-Zone data routing feature, configuration must be enabled on both the server and client sides. The relevant configuration documentation is as follows: * [Broker Configuration▸](/automq/eliminate-inter-zone-traffics/broker-configuration) * [Client Configuration▸](/automq/eliminate-inter-zone-traffics/client-configuration) After configuration is complete, you can conduct data sending and receiving tests, and refer to the [Monitor Inter Zone Traffic▸](/automq/eliminate-inter-zone-traffics/monitor-inter-zone-traffic) document to observe the actual inter-availability zone traffic generated. # Deploy Multi-Nodes Test Cluster on Docker Source: https://docs.automq.com/automq/getting-started/deploy-multi-nodes-test-cluster-on-docker Deploy a scalable AutoMQ test cluster on Docker to evaluate cloud-native message streaming with full Kafka compatibility and feature exploration. This document explains how to deploy a three-node AutoMQ cluster in a local development environment (by deploying MinIO to provide object storage services). In this setup, users can test cluster-related features such as partition reassignment and data auto-balancing. Besides the Docker deployment option, users can reference the following documentation for alternative deployment methods to verify cluster-related features: * [Deploy Multi-Nodes Cluster on Kubernetes▸](/automq/deployment/deploy-multi-nodes-cluster-on-kubernetes) * [Deploy Multi-Nodes Cluster on Linux▸](/automq/deployment/deploy-multi-nodes-cluster-on-linux) > [!TIP] > > Deploying AutoMQ and tuning parameters for production environment loads can be complex. For necessary assistance and best practices, you can contact the AutoMQ team through [this form](https://www.automq.com/contact). Additionally, if you'd like to completely bypass the installation and deployment process, you can try the fully managed cloud service provided by the AutoMQ team through the link below. A free 30-day trial is available on AWS Marketplace. * [Experience AutoMQ Cloud for Free from AWS Marketplace](https://docs.automq.com/automq-cloud/getting-started/install-byoc-environment/aws/install-automq-on-aws). ## Prerequisites * Linux/Mac/Windows Subsystem for Linux * Docker * Docker Compose version > 2.22.0 * At least 8GB of available memory ## Install and Launch a Three-node AutoMQ Cluster Use the following command to download the Docker Compose configuration file for the three-node deployment plan and start the three-node AutoMQ cluster using Docker Compose. ```bash theme={null} curl -O https://raw.githubusercontent.com/AutoMQ/automq/refs/tags/1.7.3/docker/docker-compose-cluster.yaml && docker compose -f docker-compose-cluster.yaml up -d ``` After a successful startup, the cluster address will be exposed under the Docker network named automq\_net, and the cluster's bootstrap address will be "**server1:9092,server2:9092,server3:9092**." You can connect to the cluster using this address subsequently. ![](https://mintcdn.com/automq/1QgM5miUDiCjXCsL/automq/getting-started/deploy-multi-nodes-test-cluster-on-docker/1.webp?fit=max\&auto=format\&n=1QgM5miUDiCjXCsL\&q=85\&s=1808e88129794bc69f6c01118b796e79) > [!TIP] > > **Note:** > > In the above test environment, AutoMQ utilizes a Docker network named automq\_net. To connect to the cluster, you need to configure the *--network automq\_net* option to use the same Docker network for the connection. ## Test Message Sending and Receiving. After installing and starting the AutoMQ cluster, you can test message sending, consumption, and other functionalities by running the following commands. 1. Execute the following command to create a Topic using the Kafka CLI tool `kafka-topics.sh` within a Docker environment. ```bash theme={null} docker run --network automq_net automqinc/automq:1.7.3 /bin/bash -c "/opt/kafka/kafka/bin/kafka-topics.sh --create --topic quickstart-events --bootstrap-server server1:9092,server2:9092,server3:9092" ``` 2. Execute the following command to send test messages using the Kafka CLI tool `kafka-console-producer.sh` within a Docker environment. ```bash theme={null} docker run -it --network automq_net automqinc/automq:1.7.3 /bin/bash -c "/opt/kafka/kafka/bin/kafka-console-producer.sh --topic quickstart-events --bootstrap-server server1:9092,server2:9092,server3:9092" ``` 3. Execute the following command to consume test messages using the Kafka CLI tool `kafka-console-consumer.sh` within a Docker environment. ```bash theme={null} docker run --network automq_net automqinc/automq:1.7.3 /bin/bash -c "/opt/kafka/kafka/bin/kafka-console-consumer.sh --topic quickstart-events --from-beginning --bootstrap-server server1:9092,server2:9092,server3:9092" ``` ## Explore the Features of the AutoMQ Cluster. In addition to core message production and consumption features, AutoMQ offers advanced capabilities like second-level partition reassignment and automatic data rebalancing, which address Apache Kafka's challenges with slow reassignment and scaling. You can refer to the following documentation for testing and validation: * [Example: Partition Reassignment in Seconds▸](/automq/getting-started/explore-automq/example-partition-reassignment-in-seconds) * [Example: Continuous Data Self-Balancing▸](/automq/getting-started/explore-automq/example-continuous-data-self-balancing) * [Example: Self-Balancing When Cluster Nodes Change▸](/automq/getting-started/explore-automq/example-self-balancing-when-cluster-nodes-change) ## Stop and Remove a Three-node AutoMQ Cluster. After completing the functional test, please run the following command to stop and uninstall the current AutoMQ cluster. ```bash theme={null} curl -O https://raw.githubusercontent.com/AutoMQ/automq/refs/tags/1.7.3/docker/docker-compose-cluster.yaml && docker compose -f docker-compose-cluster.yaml down -v ``` # Example: Continuous Data Self-Balancing Source: https://docs.automq.com/automq/getting-started/explore-automq/example-continuous-data-self-balancing Experience the power of AutoMQ's continuous data rebalance for seamless load distribution and enhanced cloud-native scalability, all while maintaining Kafka compatibility. This document explains the data auto-rebalance testing for the AutoMQ cluster using the Kafka CLI tool. The Kafka CLI tool is executed through the Docker image provided by AutoMQ. 1. Create a topic with multiple partitions and manually reassign partitions to specific nodes to induce an imbalance in partition distribution. 2. Subsequently, send a balanced load to all partitions and observe if the partitions automatically reassign between different brokers. This automatic data balancing is a fundamental feature of AutoMQ, ensuring automatic equitable distribution of data across the cluster. By monitoring the distribution of partitions and the load on brokers, you can verify whether the automatic partition balancing functions as expected. ### Prerequisites Before conducting automatic partition data rebalance tests, the following conditions must be met: **Complete the installation and deployment of the AutoMQ cluster**, you can refer to the following methods for installing and deploying AutoMQ: * [Deploy Multi-Nodes Test Cluster on Docker▸](/automq/getting-started/deploy-multi-nodes-test-cluster-on-docker) > [!TIP] > > If deploying the cluster via [Deploy Multi-Nodes Cluster on Linux▸](/automq/deployment/deploy-multi-nodes-cluster-on-linux) or [Deploy Multi-Nodes Cluster on Kubernetes▸](/automq/deployment/deploy-multi-nodes-cluster-on-kubernetes), be sure to set autobalancer.controller.enable to true when starting the Controller to activate automatic data rebalancing. **Additionally, the host running the test program** needs to meet the following criteria: * Linux/Mac/Windows Subsystem for Linux * Docker ### Experience: Continuous Data Rebalance If the previous AutoMQ cluster was deployed by following [Deploy Multi-Nodes Test Cluster on Docker▸](/automq/getting-started/deploy-multi-nodes-test-cluster-on-docker), then the obtained cluster Bootstrap address will be similar to "**server1:9092,server2:9092,server3:9092**", and the AutoMQ cluster will be located within the "**automq\_net**" Docker network. > [!TIP] > > Please substitute the bootstrap-server address below with the actual cluster address as per the deployment configuration. #### Create Topic ```bash theme={null} docker run --network automq_net automqinc/automq:1.5.5 /bin/bash -c "/opt/kafka/kafka/bin/kafka-topics.sh --partitions 8 --create --topic continuous-self-balancing-topic --bootstrap-server server1:9092,server2:9092,server3:9092" ``` #### View Partition Distribution ```bash theme={null} docker run --network automq_net automqinc/automq:1.5.5 /bin/bash -c "/opt/kafka/kafka/bin/kafka-topics.sh --topic continuous-self-balancing-topic --describe --bootstrap-server server1:9092,server2:9092,server3:9092" ``` ```yaml theme={null} Topic: continuous-self-balancing-topic TopicId: DNZe6gBQTrCOEAruQ_y2tg PartitionCount: 8 ReplicationFactor: 1 Configs: min.insync.replicas=1,segment.bytes=1073741824 Topic: continuous-self-balancing-topic Partition: 0 Leader: 2 Replicas: 2 Isr: 2 Topic: continuous-self-balancing-topic Partition: 1 Leader: 1 Replicas: 1 Isr: 1 Topic: continuous-self-balancing-topic Partition: 2 Leader: 1 Replicas: 1 Isr: 1 Topic: continuous-self-balancing-topic Partition: 3 Leader: 2 Replicas: 2 Isr: 2 Topic: continuous-self-balancing-topic Partition: 4 Leader: 1 Replicas: 1 Isr: 1 Topic: continuous-self-balancing-topic Partition: 5 Leader: 2 Replicas: 2 Isr: 2 Topic: continuous-self-balancing-topic Partition: 6 Leader: 1 Replicas: 1 Isr: 1 Topic: continuous-self-balancing-topic Partition: 7 Leader: 2 Replicas: 2 Isr: 2 ``` #### Manually Reassign Partitions To facilitate the observation of continuous data rebalancing, we manually reassign partitions to node2. 1. Create a plan for partition reassignment. ```bash theme={null} echo '{ "partitions": [ {"topic": "continuous-self-balancing-topic", "partition": 0, "replicas": [2]}, {"topic": "continuous-self-balancing-topic", "partition": 1, "replicas": [2]}, {"topic": "continuous-self-balancing-topic", "partition": 2, "replicas": [2]}, {"topic": "continuous-self-balancing-topic", "partition": 3, "replicas": [2]}, {"topic": "continuous-self-balancing-topic", "partition": 4, "replicas": [2]}, {"topic": "continuous-self-balancing-topic", "partition": 5, "replicas": [2]}, {"topic": "continuous-self-balancing-topic", "partition": 6, "replicas": [2]}, {"topic": "continuous-self-balancing-topic", "partition": 7, "replicas": [2]} ], "version": 1 }' > move.json ``` 2. Implement the partition reassignment plan. ```bash theme={null} docker run --network automq_net -v $(pwd)/move.json:/move.json automqinc/automq:1.5.5 /bin/bash -c "/opt/kafka/kafka/bin/kafka-reassign-partitions.sh --bootstrap-server server1:9092,server2:9092,server3:9092 --reassignment-json-file /move.json --execute" ``` 3. After the manual reassignment, view the partition distribution as follows: ```text theme={null} Topic: continuous-self-balancing-topic TopicId: HtVB3bM7TYaNKKKmm7khQw PartitionCount: 8 ReplicationFactor: 1 Configs: min.insync.replicas=1,segment.bytes=1073741824 Topic: continuous-self-balancing-topic Partition: 0 Leader: 2 Replicas: 2 Isr: 2 Topic: continuous-self-balancing-topic Partition: 1 Leader: 2 Replicas: 2 Isr: 2 Topic: continuous-self-balancing-topic Partition: 2 Leader: 2 Replicas: 2 Isr: 2 Topic: continuous-self-balancing-topic Partition: 3 Leader: 2 Replicas: 2 Isr: 2 Topic: continuous-self-balancing-topic Partition: 4 Leader: 2 Replicas: 2 Isr: 2 Topic: continuous-self-balancing-topic Partition: 5 Leader: 2 Replicas: 2 Isr: 2 Topic: continuous-self-balancing-topic Partition: 6 Leader: 2 Replicas: 2 Isr: 2 Topic: continuous-self-balancing-topic Partition: 7 Leader: 2 Replicas: 2 Isr: 2 ``` #### Start the Producer. ```bash theme={null} docker run --network automq_net automqinc/automq:1.5.5 /bin/bash -c "/opt/kafka/kafka/bin/kafka-producer-perf-test.sh --topic continuous-self-balancing-topic --num-records=1024000 --throughput 5120 --record-size 1024 --producer-props bootstrap.servers=server1:9092,server2:9092,server3:9092 linger.ms=100 batch.size=524288 buffer.memory=134217728 max.request.size=67108864" ``` #### Start the Consumer. ```bash theme={null} docker run --network automq_net automqinc/automq:1.5.5 /bin/bash -c "/opt/kafka/kafka/bin/kafka-consumer-perf-test.sh --topic continuous-self-balancing-topic --show-detailed-stats --timeout 300000 --messages=1024000 --reporting-interval 1000 --bootstrap-server=server1:9092,server2:9092,server3:9092" ``` #### Rechecking Partition Distribution After some time, you'll notice the producer generating the following logs. ```text theme={null} [2024-05-16 10:29:50,448] 25622 records sent, 5123.4 records/sec (5.00 MB/sec), 15.7 ms avg latency, 41.0 ms max latency. [2024-05-16 10:30:00,372] WARN [Producer clientId=perf-producer-client] Got error produce response with correlation id 10354 on topic-partition continuous-self-balancing-topic-7, retrying (2147483646 attempts left). Error: NOT_LEADER_OR_FOLLOWER (org.apache.kafka.clients.producer.internals.Sender) [2024-05-16 10:30:00,373] WARN [Producer clientId=perf-producer-client] Received invalid metadata error in produce request on partition continuous-self-balancing-topic-7 due to org.apache.kafka.common.errors.NotLeaderOrFollowerException: For requests intended only for the leader, this error indicates that the broker is not the current leader. For requests intended for any replica, this error indicates that the broker is not a replica of the topic partition. Going to request metadata update now (org.apache.kafka.clients.producer.internals.Sender) [2024-05-16 10:30:00,373] WARN [Producer clientId=perf-producer-client] Got error produce response with correlation id 10354 on topic-partition continuous-self-balancing-topic-0, retrying (2147483646 attempts left). Error: NOT_LEADER_OR_FOLLOWER (org.apache.kafka.clients.producer.internals.Sender) [2024-05-16 10:30:00,373] WARN [Producer clientId=perf-producer-client] Received invalid metadata error in produce request on partition continuous-self-balancing-topic-0 due to org.apache.kafka.common.errors.NotLeaderOrFollowerException: For requests intended only for the leader, this error indicates that the broker is not the current leader. For requests intended for any replica, this error indicates that the broker is not a replica of the topic partition. Going to request metadata update now (org.apache.kafka.clients.producer.internals.Sender) [2024-05-16 10:30:00,384] WARN [Producer clientId=perf-producer-client] Got error produce response with correlation id 10356 on topic-partition continuous-self-balancing-topic-7, retrying (2147483646 attempts left). Error: NOT_LEADER_OR_FOLLOWER (org.apache.kafka.clients.producer.internals.Sender) [2024-05-16 10:30:00,384] WARN [Producer clientId=perf-producer-client] Received invalid metadata error in produce request on partition continuous-self-balancing-topic-7 due to org.apache.kafka.common.errors.NotLeaderOrFollowerException: For requests intended only for the leader, this error indicates that the broker is not the current leader. For requests intended for any replica, this error indicates that the broker is not a replica of the topic partition. Going to request metadata update now (org.apache.kafka.clients.producer.internals.Sender) [2024-05-16 10:30:00,384] WARN [Producer clientId=perf-producer-client] Got error produce response with correlation id 10356 on topic-partition continuous-self-balancing-topic-0, retrying (2147483646 attempts left). Error: NOT_LEADER_OR_FOLLOWER (org.apache.kafka.clients.producer.internals.Sender) [2024-05-16 10:30:00,384] WARN [Producer clientId=perf-producer-client] Received invalid metadata error in produce request on partition continuous-self-balancing-topic-0 due to org.apache.kafka.common.errors.NotLeaderOrFollowerException: For requests intended only for the leader, this error indicates that the broker is not the current leader. For requests intended for any replica, this error indicates that the broker is not a replica of the topic partition. Going to request metadata update now (org.apache.kafka.clients.producer.internals.Sender) [2024-05-16 10:30:00,384] WARN [Producer clientId=perf-producer-client] Got error produce response with correlation id 10356 on topic-partition continuous-self-balancing-topic-6, retrying (2147483646 attempts left). Error: NOT_LEADER_OR_FOLLOWER (org.apache.kafka.clients.producer.internals.Sender) [2024-05-16 10:30:00,384] WARN [Producer clientId=perf-producer-client] Received invalid metadata error in produce request on partition continuous-self-balancing-topic-6 due to org.apache.kafka.common.errors.NotLeaderOrFollowerException: For requests intended only for the leader, this error indicates that the broker is not the current leader. For requests intended for any replica, this error indicates that the broker is not a replica of the topic partition. Going to request metadata update now (org.apache.kafka.clients.producer.internals.Sender) [2024-05-16 10:30:00,385] WARN [Producer clientId=perf-producer-client] Got error produce response with correlation id 10357 on topic-partition continuous-self-balancing-topic-0, retrying (2147483646 attempts left). Error: NOT_LEADER_OR_FOLLOWER (org.apache.kafka.clients.producer.internals.Sender) [2024-05-16 10:30:00,385] WARN [Producer clientId=perf-producer-client] Received invalid metadata error in produce request on partition continuous-self-balancing-topic-0 due to org.apache.kafka.common.errors.NotLeaderOrFollowerException: For requests intended only for the leader, this error indicates that the broker is not the current leader. For requests intended for any replica, this error indicates that the broker is not a replica of the topic partition. Going to request metadata update now (org.apache.kafka.clients.producer.internals.Sender) [2024-05-16 10:30:00,397] WARN [Producer clientId=perf-producer-client] Got error produce response with correlation id 10358 on topic-partition continuous-self-balancing-topic-7, retrying (2147483646 attempts left). Error: NOT_LEADER_OR_FOLLOWER (org.apache.kafka.clients.producer.internals.Sender) [2024-05-16 10:30:00,397] WARN [Producer clientId=perf-producer-client] Received invalid metadata error in produce request on partition continuous-self-balancing-topic-7 due to org.apache.kafka.common.errors.NotLeaderOrFollowerException: For requests intended only for the leader, this error indicates that the broker is not the current leader. For requests intended for any replica, this error indicates that the broker is not a replica of the topic partition. Going to request metadata update now (org.apache.kafka.clients.producer.internals.Sender) [2024-05-16 10:30:00,397] WARN [Producer clientId=perf-producer-client] Got error produce response with correlation id 10358 on topic-partition continuous-self-balancing-topic-6, retrying (2147483646 attempts left). Error: NOT_LEADER_OR_FOLLOWER (org.apache.kafka.clients.producer.internals.Sender) [2024-05-16 10:30:00,397] WARN [Producer clientId=perf-producer-client] Received invalid metadata error in produce request on partition continuous-self-balancing-topic-6 due to org.apache.kafka.common.errors.NotLeaderOrFollowerException: For requests intended only for the leader, this error indicates that the broker is not the current leader. For requests intended for any replica, this error indicates that the broker is not a replica of the topic partition. Going to request metadata update now (org.apache.kafka.clients.producer.internals.Sender) [2024-05-16 10:30:00,397] WARN [Producer clientId=perf-producer-client] Got error produce response with correlation id 10358 on topic-partition continuous-self-balancing-topic-4, retrying (2147483646 attempts left). Error: NOT_LEADER_OR_FOLLOWER (org.apache.kafka.clients.producer.internals.Sender) [2024-05-16 10:30:00,397] WARN [Producer clientId=perf-producer-client] Received invalid metadata error in produce request on partition continuous-self-balancing-topic-4 due to org.apache.kafka.common.errors.NotLeaderOrFollowerException: For requests intended only for the leader, this error indicates that the broker is not the current leader. For requests intended for any replica, this error indicates that the broker is not a replica of the topic partition. Going to request metadata update now (org.apache.kafka.clients.producer.internals.Sender) [2024-05-16 10:30:00,398] WARN [Producer clientId=perf-producer-client] Got error produce response with correlation id 10360 on topic-partition continuous-self-balancing-topic-6, retrying (2147483646 attempts left). Error: NOT_LEADER_OR_FOLLOWER (org.apache.kafka.clients.producer.internals.Sender) [2024-05-16 10:30:00,398] WARN [Producer clientId=perf-producer-client] Received invalid metadata error in produce request on partition continuous-self-balancing-topic-6 due to org.apache.kafka.common.errors.NotLeaderOrFollowerException: For requests intended only for the leader, this error indicates that the broker is not the current leader. For requests intended for any replica, this error indicates that the broker is not a replica of the topic partition. Going to request metadata update now (org.apache.kafka.clients.producer.internals.Sender) [2024-05-16 10:30:00,398] WARN [Producer clientId=perf-producer-client] Got error produce response with correlation id 10360 on topic-partition continuous-self-balancing-topic-4, retrying (2147483646 attempts left). Error: NOT_LEADER_OR_FOLLOWER (org.apache.kafka.clients.producer.internals.Sender) [2024-05-16 10:30:00,398] WARN [Producer clientId=perf-producer-client] Received invalid metadata error in produce request on partition continuous-self-balancing-topic-4 due to org.apache.kafka.common.errors.NotLeaderOrFollowerException: For requests intended only for the leader, this error indicates that the broker is not the current leader. For requests intended for any replica, this error indicates that the broker is not a replica of the topic partition. Going to request metadata update now (org.apache.kafka.clients.producer.internals.Sender) [2024-05-16 10:30:00,411] WARN [Producer clientId=perf-producer-client] Got error produce response with correlation id 10361 on topic-partition continuous-self-balancing-topic-4, retrying (2147483646 attempts left). Error: NOT_LEADER_OR_FOLLOWER (org.apache.kafka.clients.producer.internals.Sender) [2024-05-16 10:30:00,412] WARN [Producer clientId=perf-producer-client] Received invalid metadata error in produce request on partition continuous-self-balancing-topic-4 due to org.apache.kafka.common.errors.NotLeaderOrFollowerException: For requests intended only for the leader, this error indicates that the broker is not the current leader. For requests intended for any replica, this error indicates that the broker is not a replica of the topic partition. Going to request metadata update now (org.apache.kafka.clients.producer.internals.Sender) [2024-05-16 10:30:00,412] WARN [Producer clientId=perf-producer-client] Got error produce response with correlation id 10362 on topic-partition continuous-self-balancing-topic-4, retrying (2147483646 attempts left). Error: NOT_LEADER_OR_FOLLOWER (org.apache.kafka.clients.producer.internals.Sender) [2024-05-16 10:30:00,412] WARN [Producer clientId=perf-producer-client] Received invalid metadata error in produce request on partition continuous-self-balancing-topic-4 due to org.apache.kafka.common.errors.NotLeaderOrFollowerException: For requests intended only for the leader, this error indicates that the broker is not the current leader. For requests intended for any replica, this error indicates that the broker is not a replica of the topic partition. Going to request metadata update now (org.apache.kafka.clients.producer.internals.Sender) [2024-05-16 10:29:55,450] 25327 records sent, 5064.4 records/sec (4.95 MB/sec), 15.3 ms avg latency, 80.0 ms max latency. ``` After waiting a few seconds, production will resume normal operations. Check the partition status again afterward. ```text theme={null} Topic: continuous-self-balancing-topic TopicId: HtVB3bM7TYaNKKKmm7khQw PartitionCount: 8 ReplicationFactor: 1 Configs: min.insync.replicas=1,segment.bytes=1073741824 Topic: continuous-self-balancing-topic Partition: 0 Leader: 1 Replicas: 1 Isr: 1 Topic: continuous-self-balancing-topic Partition: 1 Leader: 2 Replicas: 2 Isr: 2 Topic: continuous-self-balancing-topic Partition: 2 Leader: 2 Replicas: 2 Isr: 2 Topic: continuous-self-balancing-topic Partition: 3 Leader: 2 Replicas: 2 Isr: 2 Topic: continuous-self-balancing-topic Partition: 4 Leader: 1 Replicas: 1 Isr: 1 Topic: continuous-self-balancing-topic Partition: 5 Leader: 2 Replicas: 2 Isr: 2 Topic: continuous-self-balancing-topic Partition: 6 Leader: 1 Replicas: 1 Isr: 1 Topic: continuous-self-balancing-topic Partition: 7 Leader: 1 Replicas: 1 Isr: 1 ``` It has been observed that because we reassigned all partitions to node2, all messages are being sent to node2 during production, creating a local hotspot on node2 and triggering AutoMQ's Self-Balancing. AutoMQ reassigns partitions to achieve a balanced state across the nodes. # Example: Partition Reassignment in Seconds Source: https://docs.automq.com/automq/getting-started/explore-automq/example-partition-reassignment-in-seconds Optimize partition reassignment with AutoMQ's Kafka-compatible service using CLI tools for sub-second performance, leveraging cloud-native scalability and efficiency. This document outlines the process for using Kafka CLI tools to verify AutoMQ's sub-second partition reassignment capability. The Kafka CLI tool is executed via a Docker image provided by AutoMQ. First, create a new Kafka topic with a single partition and initiate a producer to write a certain amount of data into it. Next, attempt to reassign the partition among different AutoMQ brokers using the reassign command. Observe the time it takes to complete the partition reassignment. ### Prerequisites Before carrying out a partition reassignment test, the following conditions must be met: **Complete the installation and deployment of the AutoMQ cluster**. You can refer to the following methods to install and deploy AutoMQ: * [Deploy Multi-Nodes Test Cluster on Docker▸](/automq/getting-started/deploy-multi-nodes-test-cluster-on-docker) **Additionally, the host running the test program** must meet the following conditions: * Linux/Mac/Windows Subsystem for Linux * Docker ### Experience Partition Reassignment If the previous AutoMQ cluster was deployed following the [Deploy Multi-Nodes Test Cluster on Docker▸](/automq/getting-started/deploy-multi-nodes-test-cluster-on-docker) guide, the obtained cluster Bootstrap address will resemble "**server1:9092,server2:9092,server3:9092**," and the AutoMQ cluster is on the "**automq\_net**" Docker network. > [!TIP] > > Please replace the bootstrap-server address below with the actual cluster's address based on the deployment configuration. #### Create Topic ```bash theme={null} docker run --network automq_net automqinc/automq:1.5.5 /bin/bash -c "/opt/kafka/kafka/bin/kafka-topics.sh --create --topic reassign-topic --bootstrap-server server1:9092,server2:9092,server3:9092" ``` #### Send Messages Execute the following command to send a specified amount of data. ```bash theme={null} docker run --network automq_net automqinc/automq:1.5.5 /bin/bash -c "/opt/kafka/kafka/bin/kafka-producer-perf-test.sh --topic reassign-topic --num-records=1024000 --throughput 5120 --record-size 1024 --producer-props bootstrap.servers=server1:9092,server2:9092,server3:9092 linger.ms=100 batch.size=524288 buffer.memory=134217728 max.request.size=67108864" ``` #### View Partition Distribution ```bash theme={null} docker run --network automq_net automqinc/automq:1.5.5 /bin/bash -c "/opt/kafka/kafka/bin/kafka-topics.sh --topic reassign-topic --describe --bootstrap-server server1:9092,server2:9092,server3:9092" ``` #### Reassign Partitions Between Brokers In this step, it's assumed that partition 0 of the test topic "reassign-topic" is currently on node 1, and the goal is to reassign this partition to node 2. Depending on the actual partition distribution during testing, you might opt to reassign to different nodes. 1. Create the partition reassignment plan. ```bash theme={null} echo '{ "partitions": [ { "topic": "reassign-topic", "partition": 0, "replicas": [ 2 ] } ], "version": 1 }' > move.json ``` 2. Execute the partition reassignment plan. ```bash theme={null} docker run --network automq_net -v $(pwd)/move.json:/move.json automqinc/automq:1.5.5 /bin/bash -c "/opt/kafka/kafka/bin/kafka-reassign-partitions.sh --bootstrap-server server1:9092,server2:9092,server3:9092 --reassignment-json-file /move.json --execute" ``` #### 3. Check if the Reassignment Is Complete. ```bash theme={null} docker run --network automq_net -v $(pwd)/move.json:/move.json automqinc/automq:1.5.5 /bin/bash -c "/opt/kafka/kafka/bin/kafka-reassign-partitions.sh --bootstrap-server server1:9092,server2:9092,server3:9092 --reassignment-json-file /move.json --verify" ``` # Example: Self-Balancing when Cluster Nodes Change Source: https://docs.automq.com/automq/getting-started/explore-automq/example-self-balancing-when-cluster-nodes-change AutoMQ ensures seamless data distribution with automatic partition reassignment during cluster changes, leveraging cloud-native scalability and Kafka compatibility. This document presents the Kafka CLI tools for verifying automatic partition reassignment and data balancing while scaling an AutoMQ cluster. The Kafka CLI tools run via a Docker image offered by AutoMQ. 1. Create a topic with 16 partitions and distribute a balanced load. 2. As you start and stop brokers, check to see if partitions automatically reassign themselves across different brokers. This automatic data balancing is an intrinsic feature of AutoMQ, ensuring that data is distributed automatically and evenly throughout the cluster. By observing the distribution of partitions and broker load, you can confirm whether automatic partition balancing functions as anticipated. ### Prerequisites Before conducting automated partition data rebalance tests, the following conditions must be met: **Complete the installation and deployment of the AutoMQ cluster**. You can refer to the following methods for installing and deploying AutoMQ: * [Deploy Multi-Nodes Test Cluster on Docker▸](/automq/getting-started/deploy-multi-nodes-test-cluster-on-docker) > [!TIP] > > If deploying the cluster through [Deploy Multi-Nodes Cluster on Linux▸](/automq/deployment/deploy-multi-nodes-cluster-on-linux) or [Deploy Multi-Nodes Cluster on Kubernetes▸](/automq/deployment/deploy-multi-nodes-cluster-on-kubernetes), you need to ensure that when starting the Controller, autobalancer.controller.enable is set to true to enable automatic data rebalancing. **Additionally, the host running the test program** needs to meet the following conditions: * Linux/Mac/Windows Subsystem for Linux * Docker ### Experience Partition Reassignment Triggered by Cluster Node Changes. If the previous AutoMQ cluster was deployed by following the guide [Deploy Multi-Nodes Test Cluster on Docker▸](/automq/getting-started/deploy-multi-nodes-test-cluster-on-docker), the cluster bootstrap address you would have acquired might look like "**server1:9092,server2:9092,server3:9092**", and the AutoMQ cluster would be in the "**automq\_net**" Docker network. > [!TIP] > > Please replace the bootstrap-server address below with the actual address of the cluster based on your deployment configuration. #### Create Topic ```bash theme={null} docker run --network automq_net automqinc/automq:1.5.5 /bin/bash -c "/opt/kafka/kafka/bin/kafka-topics.sh --partitions 16 --create --topic self-balancing-topic --bootstrap-server server1:9092,server2:9092,server3:9092" ``` #### View Partition Distribution ```bash theme={null} docker run --network automq_net automqinc/automq:1.5.5 /bin/bash -c "/opt/kafka/kafka/bin/kafka-topics.sh --topic self-balancing-topic --describe --bootstrap-server server1:9092,server2:9092,server3:9092" ``` ```text theme={null} Topic: self-balancing-topic TopicId: AjoAB22YRRq7w6MdtZ4hDA PartitionCount: 16 ReplicationFactor: 1 Configs: min.insync.replicas=1,elasticstream.replication.factor=1,segment.bytes=1073741824 Topic: self-balancing-topic Partition: 0 Leader: 2 Replicas: 2 Isr: 2 Topic: self-balancing-topic Partition: 1 Leader: 1 Replicas: 1 Isr: 1 Topic: self-balancing-topic Partition: 2 Leader: 1 Replicas: 1 Isr: 1 Topic: self-balancing-topic Partition: 3 Leader: 2 Replicas: 2 Isr: 2 Topic: self-balancing-topic Partition: 4 Leader: 1 Replicas: 1 Isr: 1 Topic: self-balancing-topic Partition: 5 Leader: 2 Replicas: 2 Isr: 2 Topic: self-balancing-topic Partition: 6 Leader: 1 Replicas: 1 Isr: 1 Topic: self-balancing-topic Partition: 7 Leader: 2 Replicas: 2 Isr: 2 Topic: self-balancing-topic Partition: 8 Leader: 1 Replicas: 1 Isr: 1 Topic: self-balancing-topic Partition: 9 Leader: 2 Replicas: 2 Isr: 2 Topic: self-balancing-topic Partition: 10 Leader: 1 Replicas: 1 Isr: 1 Topic: self-balancing-topic Partition: 11 Leader: 2 Replicas: 2 Isr: 2 Topic: self-balancing-topic Partition: 12 Leader: 2 Replicas: 2 Isr: 2 Topic: self-balancing-topic Partition: 13 Leader: 1 Replicas: 1 Isr: 1 Topic: self-balancing-topic Partition: 14 Leader: 1 Replicas: 1 Isr: 1 Topic: self-balancing-topic Partition: 15 Leader: 2 Replicas: 2 Isr: 2 ``` #### Launch Producer ```bash theme={null} docker run --network automq_net automqinc/automq:1.5.5 /bin/bash -c "/opt/kafka/kafka/bin/kafka-producer-perf-test.sh --topic self-balancing-topic --num-records=1024000 --throughput 5120 --record-size 1024 --producer-props bootstrap.servers=server1:9092,server2:9092,server3:9092 linger.ms=100 batch.size=524288 buffer.memory=134217728 max.request.size=67108864" ``` #### Start the Consumer ```bash theme={null} docker run --network automq_net automqinc/automq:1.5.5 /bin/bash -c "/opt/kafka/kafka/bin/kafka-consumer-perf-test.sh --topic self-balancing-topic --show-detailed-stats --timeout 300000 --messages=1024000 --reporting-interval 1000 --bootstrap-server=server1:9092,server2:9092,server3:9092" ``` #### Stop the Broker Stop a server, causing its partitions to be reassigned to other nodes. After stopping, you can observe how producers and consumers recover. ```bash theme={null} docker stop automq-server3 ``` After stopping, the producer logs will appear as follows: ```text theme={null} [2024-04-29 05:00:03,436] WARN [Producer clientId=perf-producer-client] Got error produce response with correlation id 49732 on topic-partition self-balancing-topic-7, retrying (2147483641 attempts left). Error: NOT_LEADER_OR_FOLLOWER (org.apache.kafka.clients.producer.internals.Sender) [2024-04-29 05:00:03,438] WARN [Producer clientId=perf-producer-client] Received invalid metadata error in produce request on partition self-balancing-topic-7 due to org.apache.kafka.common.errors.NotLeaderOrFollowerException: For requests intended only for the leader, this error indicates that the broker is not the current leader. For requests intended for any replica, this error indicates that the broker is not a replica of the topic partition.. Going to request metadata update now (org.apache.kafka.clients.producer.internals.Sender) ``` After waiting a few seconds, you will see that production and consumption return to normal. ```text theme={null} 2024-05-07 11:56:08,920] WARN [Producer clientId=perf-producer-client] Received invalid metadata error in produce request on partition self-balancing-topic-3 due to org.apache.kafka.common.errors.NotLeaderOrFollowerException: For requests intended only for the leader, this error indicates that the broker is not the current leader. For requests intended for any replica, this error indicates that the broker is not a replica of the topic partition.. Going to request metadata update now (org.apache.kafka.clients.producer.internals.Sender) [2024-05-07 11:56:08,920] WARN [Producer clientId=perf-producer-client] Got error produce response with correlation id 42141 on topic-partition self-balancing-topic-3, retrying (2147483646 attempts left). Error: NOT_LEADER_OR_FOLLOWER (org.apache.kafka.clients.producer.internals.Sender) [2024-05-07 11:56:08,920] WARN [Producer clientId=perf-producer-client] Received invalid metadata error in produce request on partition self-balancing-topic-3 due to org.apache.kafka.common.errors.NotLeaderOrFollowerException: For requests intended only for the leader, this error indicates that the broker is not the current leader. For requests intended for any replica, this error indicates that the broker is not a replica of the topic partition.. Going to request metadata update now (org.apache.kafka.clients.producer.internals.Sender) [2024-05-07 11:56:08,588] 25693 records sent, 5138.6 records/sec (5.02 MB/sec), 8.9 ms avg latency, 1246.0 ms max latency. [2024-05-07 11:56:13,589] 25607 records sent, 5120.4 records/sec (5.00 MB/sec), 1.8 ms avg latency, 44.0 ms max latency. [2024-05-07 11:56:18,591] 25621 records sent, 5121.1 records/sec (5.00 MB/sec), 1.6 ms avg latency, 10.0 ms max latency. ``` #### Review Partition Distribution Again After the producer resumes writing, we examine the partition distribution once more and observe that all partitions are located on broker1. AutoMQ efficiently and quickly completes the reassignment of partitions and rebalancing of traffic from the stopped node. ```bash theme={null} docker run --network automq_net automqinc/automq:1.5.0 /bin/bash -c "/opt/kafka/kafka/bin/kafka-topics.sh --topic self-balancing-topic --describe --bootstrap-server server1:9092,server2:9092,server3:9092" ``` ```text theme={null} Topic: self-balancing-topic TopicId: AjoAB22YRRq7w6MdtZ4hDA PartitionCount: 16 ReplicationFactor: 1 Configs: min.insync.replicas=1,elasticstream.replication.factor=1,segment.bytes=1073741824 Topic: self-balancing-topic Partition: 0 Leader: 1 Replicas: 1 Isr: 1 Topic: self-balancing-topic Partition: 1 Leader: 1 Replicas: 1 Isr: 1 Topic: self-balancing-topic Partition: 2 Leader: 1 Replicas: 1 Isr: 1 Topic: self-balancing-topic Partition: 3 Leader: 1 Replicas: 1 Isr: 1 Topic: self-balancing-topic Partition: 4 Leader: 1 Replicas: 1 Isr: 1 Topic: self-balancing-topic Partition: 5 Leader: 1 Replicas: 1 Isr: 1 Topic: self-balancing-topic Partition: 6 Leader: 1 Replicas: 1 Isr: 1 Topic: self-balancing-topic Partition: 7 Leader: 1 Replicas: 1 Isr: 1 Topic: self-balancing-topic Partition: 8 Leader: 1 Replicas: 1 Isr: 1 Topic: self-balancing-topic Partition: 9 Leader: 1 Replicas: 1 Isr: 1 Topic: self-balancing-topic Partition: 10 Leader: 1 Replicas: 1 Isr: 1 Topic: self-balancing-topic Partition: 11 Leader: 1 Replicas: 1 Isr: 1 Topic: self-balancing-topic Partition: 12 Leader: 1 Replicas: 1 Isr: 1 Topic: self-balancing-topic Partition: 13 Leader: 1 Replicas: 1 Isr: 1 Topic: self-balancing-topic Partition: 14 Leader: 1 Replicas: 1 Isr: 1 Topic: self-balancing-topic Partition: 15 Leader: 1 Replicas: 1 Isr: 1 ``` #### Restart the Broker Restart automq-server3 to trigger the automatic reassignment of partitions. After several seconds of retrying, the producer and consumer can resume operations. ```bash theme={null} docker start automq-server3 ``` At this stage, if we review the partition distribution again, we can confirm that the partitions have been automatically reassigned. ```text theme={null} Topic: self-balancing-topic TopicId: AjoAB22YRRq7w6MdtZ4hDA PartitionCount: 16 ReplicationFactor: 1 Configs: min.insync.replicas=1,elasticstream.replication.factor=1,segment.bytes=1073741824 Topic: self-balancing-topic Partition: 0 Leader: 1 Replicas: 1 Isr: 1 Topic: self-balancing-topic Partition: 1 Leader: 2 Replicas: 2 Isr: 2 Topic: self-balancing-topic Partition: 2 Leader: 1 Replicas: 1 Isr: 1 Topic: self-balancing-topic Partition: 3 Leader: 1 Replicas: 1 Isr: 1 Topic: self-balancing-topic Partition: 4 Leader: 2 Replicas: 2 Isr: 2 Topic: self-balancing-topic Partition: 5 Leader: 1 Replicas: 1 Isr: 1 Topic: self-balancing-topic Partition: 6 Leader: 1 Replicas: 1 Isr: 1 Topic: self-balancing-topic Partition: 7 Leader: 1 Replicas: 1 Isr: 1 Topic: self-balancing-topic Partition: 8 Leader: 2 Replicas: 2 Isr: 2 Topic: self-balancing-topic Partition: 9 Leader: 2 Replicas: 2 Isr: 2 Topic: self-balancing-topic Partition: 10 Leader: 1 Replicas: 1 Isr: 1 Topic: self-balancing-topic Partition: 11 Leader: 2 Replicas: 2 Isr: 2 Topic: self-balancing-topic Partition: 12 Leader: 2 Replicas: 2 Isr: 2 Topic: self-balancing-topic Partition: 13 Leader: 2 Replicas: 2 Isr: 2 Topic: self-balancing-topic Partition: 14 Leader: 1 Replicas: 1 Isr: 1 Topic: self-balancing-topic Partition: 15 Leader: 1 Replicas: 1 Isr: 1 ``` # Apache Doris Source: https://docs.automq.com/automq/integrations/data-analysis/apache-doris AutoMQ ensures cloud-native scalability, Kafka compatibility, and cost efficiency for importing data from AutoMQ into Apache Doris, driving fast, real-time analytics. [Apache Doris](https://doris.apache.org/) is a high-performance, real-time analytical database based on MPP architecture, known for its exceptional ease of use and sub-second response times for queries on massive datasets. It supports both high-concurrency point query scenarios and high-throughput complex analytical scenarios. Consequently, Apache Doris is well-suited for use cases such as report analysis, ad-hoc queries, unified data warehouse construction, and data lake federation query acceleration. Users can build applications on top of this, such as user behavior analysis, A/B testing platforms, log search analysis, user profiling, and order analysis. This document discusses how to import data from AutoMQ into Apache Doris using Apache Doris Routine Load. For detailed information about Routine Load, refer to the [Routine Load Fundamentals](https://doris.apache.org/docs/4.x/data-operate/import/import-way/routine-load-manual/) document. ## Environment Preparation ### Prepare Apache Doris and Test Data Ensure that an operational Apache Doris cluster is available. For demonstration purposes, we have set up a test Apache Doris environment on Linux by following the [Docker Deployment for Doris](https://doris.apache.org/docs/3.0/gettingStarted/what-is-apache-doris) document. Create a database and test table: ```bash theme={null} create database automq_db; CREATE TABLE automq_db.users ( id bigint NOT NULL, name string NOT NULL, timestamp string NULL, status string NULL ) DISTRIBUTED BY hash (id) PROPERTIES ('replication_num' = '1'); ``` ### Prepare Kafka Command-line Tools Download the latest TGZ package from [AutoMQ Releases](https://github.com/AutoMQ/automq) and extract it. Assuming the extraction directory is `$AUTOMQ_HOME`, this article will use the tools in `$AUTOMQ_HOME/bin` to create topics and generate test data. ### Prepare AutoMQ and Test Data Refer to AutoMQ [Deploy Multi-Nodes Cluster on Linux▸](/automq/deployment/deploy-multi-nodes-cluster-on-linux) to deploy a functional cluster, ensuring network connectivity between AutoMQ and Apache Doris. Quickly create a topic named `example_topic` in AutoMQ and write a test JSON data into it, following the steps below. #### **Create Topic** Use the Apache Kafka command-line tool to create the topic. Make sure you have access to the Kafka environment and that the Kafka service is running. Here is an example command for creating a topic: ```bash theme={null} $AUTOMQ_HOME/bin/kafka-topics.sh --create --topic exampleto_topic --bootstrap-server 127.0.0.1:9092 --partitions 1 --replication-factor 1 ``` > [!TIP] > > When executing the command, you need to replace the topic and bootstrap-server with the actual AutoMQ Bootstrap Server address. After creating the topic, you can use the following command to verify if the topic was successfully created. ```bash theme={null} $AUTOMQ_HOME/bin/kafka-topics.sh --describe example_topic --bootstrap-server 127.0.0.1:9092 ``` #### **Generate Test Data** Generate a JSON formatted test data that corresponds with the previous table. ```json theme={null} { "id": 1, "name": "Test User" "timestamp": "2023-11-10T12:00:00", "status": "active" } ``` #### **Write Test Data** Use Kafka command line tools or programming methods to write the test data into a Topic named example\_topic. Below is an example using the command line tool: ```bash theme={null} echo '{"id": 1, "name": "Test User", "timestamp": "2023-11-10T12:00:00", "status": "active"}' | sh kafka-console-producer.sh --broker-list 127.0.0.1:9092 --topic example_topic ``` Use the following command to view the data just written to the topic: ```bash theme={null} sh $AUTOMQ_HOME/bin/kafka-console-consumer.sh --bootstrap-server 127.0.0.1:9092 --topic example_topic --from-beginning ``` > [!TIP] > > When executing the command, you need to replace the topic and bootstrap-server with the actual AutoMQ Bootstrap Server address. ## Create Routine Load Import Job Create a Routine Load job in the Apache Doris command line to receive JSON data, which is used for continuously importing data from the AutoMQ Kafka topic. For specific parameters of Routine Load, refer to the Doris Routine Load documentation. ```sql theme={null} CREATE ROUTINE LOAD automq_example_load ON users COLUMNS(id, name, timestamp, status) PROPERTIES ( "format" = "json", "jsonpaths" = "[\"$.id\",\"$.name\",\"$.timestamp\",\"$.status\"]" ) FROM KAFKA ( "kafka_broker_list" = "127.0.0.1:9092", "kafka_topic" = "example_topic", "property.kafka_default_offsets" = "OFFSET_BEGINNING" ); ``` > [!TIP] > > When executing the command, replace `kafka_broker_list` with the actual AutoMQ Bootstrap Server address being used. ## Verify Data Import First, check the status of the Routine Load job to ensure the task is running. ```sql theme={null} show routine load\G; ``` Then, query the relevant table in the Apache Doris database to confirm that the data has been successfully imported. ```sql theme={null} select * from users; +------+--------------+---------------------+--------+ | id | name | timestamp | status | +------+--------------+---------------------+--------+ | 1 | Test User | 2023-11-10T12:00:00 | active | | 2 | Test User | 2023-11-10T12:00:00 | active | +------+--------------+---------------------+--------+ 2 rows in set (0.01 sec) ``` # Databend Source: https://docs.automq.com/automq/integrations/data-analysis/databend AutoMQ integrates with Databend, enabling cloud-native scalability and Kafka compatibility for efficient big data analytics. Learn how to ingest data from AutoMQ to Databend. [Databend](https://github.com/datafuselabs/databend) is a next-generation cloud-native data warehouse developed in Rust. It is specifically designed for cloud architecture. Built on object storage, it offers businesses integration with data lakes and warehouses while providing a big data analytics platform that separates compute from storage. This document will guide you on how to import data from AutoMQ into Databend using [bend-ingest-kafka](https://github.com/databendcloud/bend-ingest-kafka). ## Environment Preparation ### Prepare Databend Cloud and Test Data Firstly, visit [Databend Cloud](https://docs.databend.cn/guides/cloud/new-account) to initiate a Warehouse. Then, create databases and test tables within the worksheet. ```sql theme={null} create database automq_db; create table users ( id bigint NOT NULL, name string NOT NULL, ts timestamp, status string ) ``` ### Prepare AutoMQ and Test Data Refer to [Deploy Multi-Nodes Cluster on Linux▸](/automq/deployment/deploy-multi-nodes-cluster-on-linux) to set up AutoMQ, making sure there's network connectivity between AutoMQ and Databend. Quickly create a topic named `example_topic` in AutoMQ and write test JSON data into it by following these steps. #### **Create Topic** Use Apache Kafka command-line tools to create a topic. Ensure you have access to the Kafka environment and that the Kafka service is running. Below is an example command for creating a topic: ```bash theme={null} ./kafka-topics.sh --create --topic exampleto_topic --bootstrap-server 10.0.96.4:9092 --partitions 1 --replication-factor 1 ``` > [!TIP] > > When executing commands, replace `topic` and `bootstrap-server` with the actual Kafka server addresses. After creating the topic, you can use the following command to verify whether the topic has been successfully created. ```bash theme={null} ./kafka-topics.sh --describe example_topic --bootstrap-server 10.0.96.4:9092 ``` #### **Generate Test Data** Generate test data in JSON format that corresponds to the previously mentioned table. ```json theme={null} { "id": 1, "name": "Test User", "timestamp": "2023-11-10T12:00:00", "status": "active" } ``` #### **Write Test Data** Use Kafka's command-line tools or programming methods to write test data into a topic named example\_topic. Here is an example using command-line tools: ```bash theme={null} echo '{"id": 1, "name": "Test User", "timestamp": "2023-11-10T12:00:00", "status": "active"}' | sh kafka-console-producer.sh --broker-list 10.0.96.4:9092 --topic example_topic ``` > [!TIP] > > When executing the command, replace the topic and bootstrap-server with the actual Kafka server address being used. You can view the topic data just written using the following command: ```bash theme={null} sh kafka-console-consumer.sh --bootstrap-server 10.0.96.4:9092 --topic example_topic --from-beginning ``` ## Create a Bend-ingest-databend Job [bend-ingest-kafka](https://github.com/databendcloud/bend-ingest-kafka) is designed to monitor Kafka and batch write data into a Databend Table. After deploying `bend-ingest-kafka`, the data import job can be initiated. ```bash theme={null} bend-ingest-kafka --kafka-bootstrap-servers="localhost:9094" --kafka-topic="example_topic" --kafka-consumer-group="Consumer Group" --databend-dsn="https://cloudapp:password@host:443" --databend-table="automq_db.users" --data-format="json" --batch-size=5 --batch-max-interval=30s ``` > [!TIP] > > When executing the command, replace kafka-bootstrap-servers with the actual Kafka server address you are using. ### Parameter Description #### **databend-dsn** The DSN provided by Databend Cloud for connecting to the warehouse can be found in this documentation. #### **batch-size** `bend-ingest-kafka` will gather data until it reaches the specified batch size, then initiate a data synchronization process. ## Verify Data Import Navigate to the Databend Cloud worksheet and query the `automq_db.users` table. You should confirm that the data has been successfully synchronized from AutoMQ to the Databend Table. ![](https://mintcdn.com/automq/1QgM5miUDiCjXCsL/automq/integrations/data-analysis/databend/1.webp?fit=max\&auto=format\&n=1QgM5miUDiCjXCsL\&q=85\&s=51aa45e5d553f2f3e6c118d021ff7b37) # Flink Source: https://docs.automq.com/automq/integrations/data-analysis/flink Integrate Flink with AutoMQ for real-time data stream analysis with Flink and AutoMQ. Enjoy 100% Kafka compatibility, cloud-native scalability, and over 10x cost savings. ## Introduction [Apache Flink](https://flink.apache.org/) is a renowned stream processing engine widely used in event-driven, stream-batch analysis scenarios. [AutoMQ](https://github.com/AutoMQ/automq) is a highly elastic cloud-native Kafka that brings over 10x cost reduction and elasticity benefits through cloud-native modifications to the Kafka storage layer. Thanks to AutoMQ's 100% compatibility with Kafka, it can easily leverage existing Kafka ecosystem tools to read and write with Flink. This article will demonstrate how Flink can read data from an AutoMQ Topic, perform data analysis, and then write the results back to AutoMQ using a WordCount example. ## Environment Setup ### Install and Launch Flink This document uses Flink version v1.19.0. Follow the official documentation [Flink First Step](https://nightlies.apache.org/flink/flink-docs-release-1.19/docs/try-flink/local_installation/) to deploy a v1.19.0 Flink service. ### Install and Launch AutoMQ Refer to the [Deploy Multi-Nodes Cluster on Linux▸](/automq/deployment/deploy-multi-nodes-cluster-on-linux) documentation to deploy an AutoMQ cluster. In this example, the AutoMQ version used is v1.0.4. ### Prepare Test Topic and Data Create a topic `to-flink` to store data that needs to be imported into Flink for analysis and computation. ```bash theme={null} ### The Default Port for Locally Installed AutoMQ Is 9094. bin/kafka-topics.sh --create --topic to-flink --bootstrap-server localhost:9094 ``` Use the command-line tool to write a batch of data for word count computation. ```bash theme={null} bin/kafka-console-producer.sh --topic to-flink --bootstrap-server localhost:9094 ``` The data to be written is as follows, and you can exit the producer by pressing Ctrl+C after finishing the input. ```text theme={null} apple apple banana banana banana cherry cherry pear pear pear lemon lemon mango mango mango ``` Finally, we hope that the result obtained through Flink computation will be. ```text theme={null} apple 2 banana 3 cherry 2 pear 3 lemon 2 mango 3 ``` After writing is complete, we can try to consume the data to confirm it was successfully written. ```bash theme={null} bin/kafka-console-consumer.sh --topic to-flink --from-beginning --bootstrap-server localhost:9094 ``` Create a topic to receive the results of Flink computations. ```bash theme={null} bin/kafka-topics.sh --create --topic from-flink --bootstrap-server localhost:9094 ``` ## Read Data from AutoMQ into Flink for Analysis. Thanks to AutoMQ's full compatibility with Kafka, we can directly use the [Kafka Connector](https://nightlies.apache.org/flink/flink-docs-release-1.19/docs/connectors/datastream/kafka/) provided by Flink to write the source and sink code to load data from AutoMQ's Topic. ### POM Dependencies ```xml theme={null} .... org.apache.flink flink-java 1.19.0 org.apache.flink flink-streaming-java 1.19.0 org.apache.flink flink-clients 1.19.0 org.apache.flink flink-connector-kafka 1.17.2 .... org.apache.maven.plugins maven-shade-plugin 3.5.2 package shade automq-wordcount-flink-job *:* META-INF/*.SF META-INF/*.DSA META-INF/*.RSA com.automq.example.flink.WordCount ``` ### Writing the Flink Job Code The following Java code defines an AutoMQ source and sink using KafkaSource and KafkaSink, respectively. It first reads the pre-prepared "fruit list" test data from the topic to-flink. Then, it creates a DataStream to perform the WordCount computation and sinks the result into the AutoMQ topic from-flink. ```java theme={null} /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.automq.example.flink.WordCount; import org.apache.flink.api.common.eventtime.WatermarkStrategy; import org.apache.flink.api.common.functions.FlatMapFunction; import org.apache.flink.api.common.serialization.SimpleStringSchema; import org.apache.flink.api.java.tuple.Tuple2; import org.apache.flink.connector.kafka.sink.KafkaRecordSerializationSchema; import org.apache.flink.connector.kafka.sink.KafkaSink; import org.apache.flink.connector.kafka.source.KafkaSource; import org.apache.flink.connector.kafka.source.enumerator.initializer.OffsetsInitializer; import org.apache.flink.streaming.api.datastream.DataStream; import org.apache.flink.streaming.api.environment.StreamExecutionEnvironment; import org.apache.flink.util.Collector; /** * This is a re-write of the Apache Flink WordCount example using Kafka connectors. * Find the reference example at https://github.com/redpanda-data/flink-kafka-examples/blob/main/src/main/java/io/redpanda/examples/WordCount.java */ public class WordCount { final static String TO_FLINK_TOPIC_NAME = "to-flink"; final static String FROM_FLINK_TOPIC_NAME = "from-flink"; final static String FLINK_JOB_NAME = "WordCount"; public static void main(String[] args) throws Exception { // Use your AutoMQ cluster's bootstrap servers here final String bootstrapServers = args.length > 0 ? args[0] : "localhost:9094"; // Set up the streaming execution environment final StreamExecutionEnvironment env = StreamExecutionEnvironment.getExecutionEnvironment(); KafkaSource source = KafkaSource.builder() .setBootstrapServers(bootstrapServers) .setTopics(TO_FLINK_TOPIC_NAME) .setGroupId("automq-example-group") .setStartingOffsets(OffsetsInitializer.earliest()) .setValueOnlyDeserializer(new SimpleStringSchema()) .build(); KafkaRecordSerializationSchema serializer = KafkaRecordSerializationSchema.builder() .setValueSerializationSchema(new SimpleStringSchema()) .setTopic(FROM_FLINK_TOPIC_NAME) .build(); KafkaSink sink = KafkaSink.builder() .setBootstrapServers(bootstrapServers) .setRecordSerializer(serializer) .build(); DataStream text = env.fromSource(source, WatermarkStrategy.noWatermarks(), "AutoMQ Source"); // Split up the lines in pairs (2-tuples) containing: (word,1) DataStream counts = text.flatMap(new Tokenizer()) // Group by the tuple field "0" and sum up tuple field "1" .keyBy(value -> value.f0) .sum(1) .flatMap(new Reducer()); // Add the sink to so results // are written to the outputTopic counts.sinkTo(sink); // Execute program env.execute(FLINK_JOB_NAME); } /** * Implements the string tokenizer that splits sentences into words as a user-defined * FlatMapFunction. The function takes a line (String) and splits it into multiple pairs in the * form of "(word,1)" ({@code Tuple2}). */ public static final class Tokenizer implements FlatMapFunction> { @Override public void flatMap(String value, Collector> out) { // Normalize and split the line String[] tokens = value.toLowerCase().split("\\W+"); // Emit the pairs for (String token : tokens) { if (token.length() > 0) { out.collect(new Tuple2<>(token, 1)); } } } } // Implements a simple reducer using FlatMap to // reduce the Tuple2 into a single string for // writing to kafka topics public static final class Reducer implements FlatMapFunction, String> { @Override public void flatMap(Tuple2 value, Collector out) { // Convert the pairs to a string // for easy writing to Kafka Topic String count = value.f0 + " " + value.f1; out.collect(count); } } } ``` The following code, after being built using mvn, will generate an automq-wordcount-flink-job.jar, which is the job we need to submit to Flink. ### Submitting the Job to Flink Execute the following command to submit the task jar to Flink. Through the console, we can see that 15 pieces of data have been received and processed. ```bash theme={null} ./bin/flink run automq-wordcount-flink-job.jar ``` ![](https://mintcdn.com/automq/1QgM5miUDiCjXCsL/automq/integrations/data-analysis/flink/1.webp?fit=max\&auto=format\&n=1QgM5miUDiCjXCsL\&q=85\&s=86ff703b083037524b120d8286a11811) ### Verify the Analysis Results Use the Kafka bin tools extracted from AutoMQ to consume data from `from-flink` and check the results: ```bash theme={null} bin/kafka-console-consumer.sh --topic from-flink --from-beginning --bootstrap-server localhost:9094 ``` You can see the output results below. Since it's processed in a stream and there is no watermark or window calculation set, the word count result is printed out every time a calculation is performed. ```text theme={null} apple 1 apple 2 banana 1 banana 2 banana 3 cherry 1 cherry 2 pear 1 pear 2 pear 3 lemon 1 lemon 2 mango 1 mango 2 mango 3 ``` Next, we write 5 more data entries to the `to-flink` Topic and observe the stream processing results: ```bash theme={null} bin/kafka-console-producer.sh --topic to-flink --bootstrap-server localhost:9094 ``` The data written is ```text theme={null} apple banana cherry pear lemon ``` Then we can see that the `from-flink` Topic correctly outputs the following word count results ```text theme={null} apple 3 banana 4 cherry 3 pear 4 lemon 3 ``` We can also see on the console that 20 data entries were correctly received and processed: ![](https://mintcdn.com/automq/1QgM5miUDiCjXCsL/automq/integrations/data-analysis/flink/2.webp?fit=max\&auto=format\&n=1QgM5miUDiCjXCsL\&q=85\&s=a03a359110c4bfb8ede9bbc24da7cd9a) ## Summary This article demonstrates how AutoMQ integrates with Flink to complete a Word Count analysis workflow. For more configurations and usage of the Kafka Connector, refer to the official Flink documentation [Apache Kafka Connector](https://nightlies.apache.org/flink/flink-docs-release-1.19/docs/connectors/datastream/kafka/). # RisingWave Source: https://docs.automq.com/automq/integrations/data-analysis/risingwave Import data from AutoMQ into RisingWave’s SQL-compatible streaming database. Experience cloud-native scalability, complete Kafka compatibility, and cost efficiency. [RisingWave](https://risingwave.com/) \[1] is a distributed stream database that provides a standard SQL interface compatible with the PostgreSQL ecosystem, allowing integration without the need for code modification. RisingWave treats streams as tables, enabling users to write complex queries on both streaming and historical data. With RisingWave, users can concentrate on query analytical logic without having to learn Java or the underlying API of specific systems. This article will guide you on how to import data from AutoMQ into the RisingWave database using [RisingWave Cloud](https://cloud.risingwave.com/) \[2]. ## Prepare AutoMQ and Test Data Refer to [Deploy Multi-Nodes Cluster on Linux▸](/automq/deployment/deploy-multi-nodes-cluster-on-linux) for instructions on deploying AutoMQ, ensuring network connectivity between AutoMQ and RisingWave. Quickly create a topic named `example_topic` in AutoMQ, and write a test JSON data to it by following these steps. #### **Create Topic** Use the Apache Kafka command line tool to create the Topic. Ensure you have access to a Kafka environment and the Kafka service is running. Below is an example command to create the Topic: ```bash theme={null} ./kafka-topics.sh --create --topic exampleto_topic --bootstrap-server 10.0.96.4:9092 --partitions 1 --replication-factor 1 ``` > [!TIP] > > When executing the command, replace the `topic` and `bootstrap-server` with the actual Kafka server address. After creating the Topic, you can use the following command to verify whether the Topic has been successfully created. ```bash theme={null} ./kafka-topics.sh --describe example_topic --bootstrap-server 10.0.96.4:9092 ``` #### **Generate Test Data** Generate test data in JSON format that corresponds to the table mentioned earlier. ```json theme={null} { "id": 1, "name": "Test User" "timestamp": "2023-11-10T12:00:00", "status": "active" } ``` #### **Write Test Data** Use Kafka's command line tool or programming methods to write the test data into the Topic named example\_topic. Below is an example using the command line tool: ```bash theme={null} echo '{"id": 1, "name": "Test User", "timestamp": "2023-11-10T12:00:00", "status": "active"}' | sh kafka-console-producer.sh --broker-list 10.0.96.4:9092 --topic example_topic ``` Use the following command to view the data just written to the topic: ```bash theme={null} sh kafka-console-consumer.sh --bootstrap-server 10.0.96.4:9092 --topic example_topic --from-beginning ``` > [!TIP] > > When executing the command, replace the `topic` and `bootstrap-server` with the actual Kafka server address. ## Creating an AutoMQ Source on RisingWave Cloud 1. Go to [RisingWave Cloud](https://cloud.risingwave.com/) \[3] and open **Clusters** to set up a cluster. 2. Open **Source** in RisingWave Cloud \[4] to set up a source. 3. Specify the cluster and database, and log in to the database. 4. AutoMQ is 100% compatible with Apache Kafka®. Click **Create source** and select Kafka. 5. Configure the connector according to the RisingWave Cloud guided interface, setting the source information and schema details. 6. Confirm the generated SQL statement and click **Confirm** to complete the creation of the source. > [!NOTE] > > The default port for AutoMQ is 9092, and SSL is not enabled. If you need SSL, see the [Apache Kafka Documentation](https://kafka.apache.org/documentation/#security_ssl) \[5]. > > In this example, you can set the startup mode to earliest and use JSON format to access all data from the topic from the beginning. ## Query Data 1. Go to [RisingWave Cloud](https://cloud.risingwave.com/) \[6] and open **Console** to log into your cluster. 2. Run the following SQL statement to access the imported data, replacing the variable your\_source\_name with the custom name specified when creating the source. ```sql theme={null} SELECT * from {your_source_name} limit 1; ``` ## Citation \[1] RisingWave: [https://risingwave.com/](https://risingwave.com/) \[2] RisingWave Cloud: [https://cloud.risingwave.com/](https://cloud.risingwave.com/) \[3] RisingWave Cloud: [https://cloud.risingwave.com/](https://cloud.risingwave.com/) \[4] RisingWave Cloud Source: [https://cloud.risingwave.com/](https://cloud.risingwave.com/) \[5] Apache Kafka Documentation: [https://kafka.apache.org/documentation/#security\_ssl](https://kafka.apache.org/documentation/#security_ssl) \[6] RisingWave Cloud Console: [https://cloud.risingwave.com/](https://cloud.risingwave.com/) # StarRocks Source: https://docs.automq.com/automq/integrations/data-analysis/starrocks AutoMQ enables real-time data import to StarRocks, leveraging Kafka compatibility for integration and cloud-native scalability. Achieve efficient, high-concurrency analysis. [StarRocks](https://www.starrocks.io/) is a high-performance analytical data warehouse that leverages advanced technologies such as vectorization, MPP architecture, CBO, intelligent materialized views, and a real-time updatable columnar storage engine. It supports multidimensional, real-time, and high-concurrency data analysis. This article will introduce how to use StarRocks Routine Load to import data from AutoMQ into StarRocks, with the relevant Routine Load configuration shown in the following steps. ## Prerequisites ### Prepare StarRocks and Test Data Ensure that a usable StarRocks cluster is already prepared. For demonstration purposes, you can install a demonstration StarRocks cluster on a Linux machine. Create test tables for the database and primary key model: ```sql theme={null} create database automq_db; create table users ( id bigint NOT NULL, name string NOT NULL, timestamp string NULL, status string NULL ) PRIMARY KEY (id) DISTRIBUTED BY HASH(id) PROPERTIES ( "replication_num" = "1", "enable_persistent_index" = "true" ); ``` ### Prepare AutoMQ and Test Data Refer to [Deploy Multi-Nodes Cluster on Linux▸](/automq/deployment/deploy-multi-nodes-cluster-on-linux) to deploy AutoMQ and ensure network connectivity between AutoMQ and StarRocks. Quickly create a topic named `example_topic` in AutoMQ and write a test JSON data to it following these steps. #### **Create Topic** Use the Apache Kafka® command-line tool to create a topic. Ensure you have access to the Kafka environment and that the Kafka service is running. Below is an example command to create a topic: ```bash theme={null} ./kafka-topics.sh --create --topic exampleto_topic --bootstrap-server 10.0.96.4:9092 --partitions 1 --replication-factor 1 ``` > [!TIP] > > When executing the command, replace `topic` and `bootstrap-server` with the actual Kafka server address. After creating the topic, you can use the following command to verify whether the topic has been successfully created. ```bash theme={null} ./kafka-topics.sh --describe example_topic --bootstrap-server 10.0.96.4:9092 ``` #### **Generate Test Data** Generate test data in JSON format that corresponds to the table mentioned earlier. ```json theme={null} { "id": 1, "name": "test_user", "timestamp": "2023-11-10T12:00:00", "status": "active" } ``` #### **Writing Test Data** Use Kafka's command-line tools or programming methods to write test data into a Topic named `example_topic`. Here is an example using the command-line tool: ```bash theme={null} echo '{"id": 1, "name": "Test User", "timestamp": "2023-11-10T12:00:00", "status": "active"}' | sh kafka-console-producer.sh --broker-list 10.0.96.4:9092 --topic example_topic ``` Use the following command to view the data just written to the Topic: ```bash theme={null} sh kafka-console-consumer.sh --bootstrap-server 10.0.96.4:9092 --topic example_topic --from-beginning ``` > [!TIP] > > When executing the command, replace `topic` and `bootstrap-server` with the actual Kafka server address. ## Creating Routine Load Import Job Create a Routine Load job in the StarRocks command line to continuously import data from the AutoMQ Kafka Topic. ```sql theme={null} CREATE ROUTINE LOAD automq_example_load ON users COLUMNS(id, name, timestamp, status) PROPERTIES ( "desired_concurrent_number" = "5", "format" = "json", "jsonpaths" = "[\"$.id\",\"$.name\",\"$.timestamp\",\"$.status\"]" ) FROM KAFKA ( "kafka_broker_list" = "10.0.96.4:9092", "kafka_topic" = "example_topic", "kafka_partitions" = "0", "property.kafka_default_offsets" = "OFFSET_BEGINNING" ); ``` > [!TIP] > > When executing the command, replace `kafka_broker_list` with the actual Kafka server address. ### Parameter Description #### **Data Format** The data format needs to be specified as JSON in the `PROPERTIES` clause with `"format" = "json"`. #### **Data Extraction and Transformation** If you need to specify a mapping and conversion relationship between the source data and the target table columns, you can configure the `COLUMNS` and `jsonpaths` parameters. In `COLUMNS`, the column names correspond to the column names of the **target table**, and the order of columns corresponds to the order of columns in **source data**. The `jsonpaths` parameter is used to extract the necessary field data from the JSON data, similar to newly generated CSV data. Subsequently, the `COLUMNS` parameter will temporarily name the fields in the order specified by `jsonpaths`. > [!TIP] > > If each line contains a JSON object where the names and number of keys correspond to the columns in the target table (order does not need to match), the `COLUMNS` configuration is not required. ## Validate Data Import First, check the status of the Routine Load import job to ensure the task is running. ```sql theme={null} show routine load\G; ``` And then querying the relevant tables in the StarRocks database, you can see that the data has been successfully imported. ```sql theme={null} StarRocks > select * from users; +------+--------------+---------------------+--------+ | id | name | timestamp | status | +------+--------------+---------------------+--------+ | 1 | Test User | 2023-11-10T12:00:00 | active | | 2 | Test User | 2023-11-10T12:00:00 | active | +------+--------------+---------------------+--------+ 2 rows in set (0.01 sec) ``` # Airbyte Source: https://docs.automq.com/automq/integrations/data-integration/airbyte AutoMQ, a cloud-native Kafka-compatible service, delivers cost-efficient, scalable data flow with Airbyte integration for optimal analytics. ## Preface This guide shows how to integrate AutoMQ \[1] with Airbyte \[2] and a data warehouse to build a real-time data flow and analytics pipeline. ### AutoMQ Overview AutoMQ is a Kafka-compatible streaming platform. For an overview, see [AutoMQ Overview](/automq/what-is-automq). ### Airbyte Overview Airbyte is a data integration platform designed to simplify and automate the creation and management of data pipelines. It supports a wide variety of source and target systems, enabling users to easily configure data pipelines through a user-friendly web interface or API. Airbyte offers efficient Extract, Transform, Load (ETL) capabilities with built-in scheduling and monitoring mechanisms to ensure the reliability and performance of data pipelines. Its modular design supports custom connectors to meet diverse data integration demands. Airbyte's major advantages include high scalability and flexibility, allowing users to swiftly adapt to various data sources and target systems. Built-in data normalization and automated scheduling functionalities enhance the efficiency and consistency of data processing. With containerized deployment, Airbyte streamlines installation and scaling, making it apt for enterprise-level data integration and data warehousing. Additionally, its comprehensive connector library and community support make it an excellent tool for data engineers and analysts to efficiently address complex data integration challenges. ![Connections](https://mintcdn.com/automq/1QgM5miUDiCjXCsL/automq/integrations/data-integration/airbyte/2.webp?fit=max\&auto=format\&n=1QgM5miUDiCjXCsL\&q=85\&s=e1263678f00d349a282f2aa8e4ac9d9e) ## Prerequisites * Data Source: An available AutoMQ node. * Data Connector: Available Airbyte Environment. * Data Endpoint (Data Warehouse): In this example, I've selected a cloud-deployed Databricks \[3] cluster. ## Quick Deployment ### Deploy AutoMQ Deployment can be achieved by consulting the official AutoMQ documentation: [Deploy Multi-Nodes Cluster on Linux▸](/automq/deployment/deploy-multi-nodes-cluster-on-linux). Once the setup is complete, data preparation can be done using either the Kafka SDK or manually, followed by the data synchronization process. I've prepared some data in advance, which can be observed using various visualization tools to monitor AutoMQ node status, such as [Redpanda Console](https://www.redpanda.com/redpanda-console-kafka-ui) \[5], [Kafdrop](https://github.com/obsidiandynamics/kafdrop) \[6], and others. Here, I've chosen Redpanda Console, where you can see that there are currently 50 topics, each containing 1000 initial messages. ![](https://mintcdn.com/automq/1QgM5miUDiCjXCsL/automq/integrations/data-integration/airbyte/3.webp?fit=max\&auto=format\&n=1QgM5miUDiCjXCsL\&q=85\&s=90a10cf12dfa9da2f9d85238dcc976aa) Message Format: ```json theme={null} [ { "partitionID": 0, "offset": 950, "timestamp": 1721988652404, "compression": "uncompressed", "isTransactional": false, "headers": [], "key": { "payload": "key-451", "encoding": "text" }, "value": { "payload": { "userId": 451, "action": "visit", "timestamp": 1721988652404 }, "encoding": "json" } } ] ``` ### Deploying Airbyte > Refer to the official Airbyte documentation: [Quickstart | Airbyte](https://docs.airbyte.com/using-airbyte/getting-started/oss-quickstart) \[7] Here, I will use the example of deploying Airbyte on a Linux system. #### Environment Preparation First, you need to install `abctl`, an official setup tool provided by Airbyte that facilitates quick setup of the required Airbyte environment. Note that this tool requires a Docker environment. If you don't have Docker installed, see Docker's installation instructions: [Docker Install](https://docs.docker.com/desktop/install/linux-install/) \[8]. You can check your Docker version by running the command `docker version`: ```bash theme={null} Client: Version: 20.10.5+dfsg1 API version: 1.41 Go version: go1.15.15 Git commit: 55c4c88 Built: Mon May 30 18:34:49 2022 OS/Arch: linux/amd64 Context: default Experimental: true Server: Engine: Version: 20.10.5+dfsg1 ......... ``` #### Preparing the Abctl Tool To get started with abctl, execute the following commands sequentially. Here, I'm downloading version `version: v0.9.2`: ```bash theme={null} # Download: wget https://github.com/airbytehq/abctl/releases/download/v0.9.2/abctl-v0.9.2-linux-amd64.tar.gz # Unzip: tar -xvzf abctl-v0.9.2-linux-amd64.tar.gz # Enter: cd abctl-v0.9.2-linux-amd64 # Add Execution Permission: chmod +x abctl # Global Environment: sudo mv abctl /usr/local/bin # Verify Version: abctl version # Output version: v0.9.2 ``` #### Deploying the Airbyte Environment By executing the command `abctl local install`, this will pull Airbyte's images in Docker and deploy the environment using Helm. Some of the logs are as follows: ```bash theme={null} INFO Namespace 'airbyte-abctl' already exists INFO Persistent volume 'airbyte-minio-pv' already exists INFO Persistent volume 'airbyte-volume-db' already exists INFO Persistent volume claim 'airbyte-minio-pv-claim-airbyte-minio-0' already exists INFO Persistent volume claim 'airbyte-volume-db-airbyte-db-0' already exists INFO Starting Helm Chart installation of 'airbyte/airbyte' (version: 0.350.0) SUCCESS Installed Helm Chart airbyte/airbyte: Name: airbyte-abctl Namespace: airbyte-abctl Version: 0.350.0 Release: 2 INFO Starting Helm Chart installation of 'nginx/ingress-nginx' (version: 4.11.1) SUCCESS Installed Helm Chart nginx/ingress-nginx: Name: ingress-nginx Namespace: ingress-nginx Version: 4.11.1 Release: 2 SUCCESS Basic-Auth secret created SUCCESS Found existing Ingress SUCCESS Updated existing Ingress SUCCESS Launched web-browser successfully for http://localhost:8000 SUCCESS Airbyte installation complete ``` Once the launch is successful, you can log in via your browser at `http://localhost:8000` with the default credentials: * Username: `airbyte`yaml * Password: `password` If you want to set your own username and password, use command line flags or variables. For example, to set the username and password to `zhaoxi` and `ktpro123` respectively, you can run the following command: ```bash theme={null} abctl local install --username zhaoxi --password ktpro123 ``` Or you can set these values using environment variables: ```bash theme={null} export ABCTL_LOCAL_INSTALL_PASSWORD=airbyte export ABCTL_LOCAL_INSTALL_USERNAME=password ``` After entering your username and password, you will access the Airbyte workspace. This interface allows you to easily set up and manage all connections and move data! ![](https://mintcdn.com/automq/1QgM5miUDiCjXCsL/automq/integrations/data-integration/airbyte/4.webp?fit=max\&auto=format\&n=1QgM5miUDiCjXCsL\&q=85\&s=5ff50cea9a445d44e0a98ae11949dc65) ### Deploying Databricks If you do not yet have a Databricks service available, refer to the official documentation for setup: [Google Databricks](https://cloud.google.com/databricks?hl=zh_cn)\[9]. ## Data Synchronization ### Add New Data Source Add AutoMQ as a data source. Thanks to AutoMQ's full compatibility with Kafka, you can set up an AutoMQ data source using Kafka's data source template. Navigate via the Airbyte interface's left sidebar -> Sources -> search Kafka, then fill in basic information such as Bootstrap Servers, Protocol, Topic Pattern, etc. ![We then need to specify the object of data transfer, which can be topics meeting custom regex criteria, or directly specify particular topics that need data transfer. Here, I choose to use a regex expression ](https://mintcdn.com/automq/1QgM5miUDiCjXCsL/automq/integrations/data-integration/airbyte/5.webp?fit=max\&auto=format\&n=1QgM5miUDiCjXCsL\&q=85\&s=5dc41e0a7a53e042cbec28624f324bca) We then need to specify the object of data transfer, which can be topics that meet custom regex criteria, or you can directly specify the topics to be transferred. Here, I choose to use the regex expression `Topic-.*` to match all topics with the prefix `Topic-`. This aligns with the format of my prepared data, so you need to ensure your data can be matched as well. After successful addition, we can see the following results, proving that the data source connection was successful: ![](https://mintcdn.com/automq/P6Ug3urJlyU1p2ee/automq/integrations/data-integration/airbyte/6.webp?fit=max\&auto=format\&n=P6Ug3urJlyU1p2ee\&q=85\&s=c6bb08cb01a38dc9540cff17f3056937) ### Add Data Destination We have chosen Databricks as our data destination, although you can select other options if you wish. For a complete list of supported destinations, visit: [Destinations | Airbyte](https://docs.airbyte.com/integrations/destinations/) \[10]. In the Airbyte interface, go to the sidebar -> Destinations -> Search for Databricks: ![The credential information required needs to be obtained from the information within the Databricks cluster. Detailed steps are:](https://mintcdn.com/automq/P6Ug3urJlyU1p2ee/automq/integrations/data-integration/airbyte/7.webp?fit=max\&auto=format\&n=P6Ug3urJlyU1p2ee\&q=85\&s=18a6285b66aae9ccd9d0f51a15cab2f4) The necessary credential information can be obtained from the Databricks cluster. The specific steps are as follows: * Go to the created Databricks Cluster -> Select Advanced Options -> JDBC/ODBC, and you will find the values for HTTP PATH and Server Hostname. ![In the top right corner of the cluster, select the user -> go to Settings -> choose User -> Developer -> AccessToken -> Generate new Token. You will receive something similar to ](https://mintcdn.com/automq/bAg_OT9sHANf_LMr/automq/integrations/data-integration/airbyte/8.png?fit=max\&auto=format\&n=bAg_OT9sHANf_LMr\&q=85\&s=109998f42d8ddf136788301bebe8b367) * In the top right corner of the cluster, select the user -> go to Settings -> choose User -> Developer -> AccessToken -> Generate new Token. You will receive a Token similar to `dapi8d336faXXXXXXXXXa6aa18a086c0e`. Once you have the credential information, proceed to create a data endpoint. If successful, you will see the following interface: ![](https://mintcdn.com/automq/P6Ug3urJlyU1p2ee/automq/integrations/data-integration/airbyte/9.webp?fit=max\&auto=format\&n=P6Ug3urJlyU1p2ee\&q=85\&s=96eedc5fb31d0020a2c9d9ad002285fa) ### Initiate Connection and Transfer Data With both the data source and data endpoint ready, we can now establish a connection. Select Airbyte's left sidebar -> Connections -> choose the data source and data endpoint -> establish connection. After successfully connecting, you need to select the mode of data transmission. Here, both incremental sync and full sync options are provided. I opted for the full sync mode: ![Select the specific Topics data you need to transmit:](https://mintcdn.com/automq/1QgM5miUDiCjXCsL/automq/integrations/data-integration/airbyte/10.webp?fit=max\&auto=format\&n=1QgM5miUDiCjXCsL\&q=85\&s=f93e0fbee4bc34c33124aca719fb64e7) Select the specific Topics data you need to transmit: ![Configure sync frequency and target data formats:](https://mintcdn.com/automq/1QgM5miUDiCjXCsL/automq/integrations/data-integration/airbyte/11.webp?fit=max\&auto=format\&n=1QgM5miUDiCjXCsL\&q=85\&s=0ea0f65af3d0d2b584e7b075ea47b5d8) Configure sync frequency and target data formats: ![Start Sync:](https://mintcdn.com/automq/1QgM5miUDiCjXCsL/automq/integrations/data-integration/airbyte/12.webp?fit=max\&auto=format\&n=1QgM5miUDiCjXCsL\&q=85\&s=4a8260d13a031b52e2d4a41196648c42) Start Sync: ![You can check the synchronization status via Job History -> Job -> Logs, where part of the log content is:](https://mintcdn.com/automq/TNthwGcCx3_sZs9Z/automq/integrations/data-integration/airbyte/13.png?fit=max\&auto=format\&n=TNthwGcCx3_sZs9Z\&q=85\&s=1caadf36a42c264da761e691cb8bea69) You can check the synchronization status via Job History -> Job -> Logs, where part of the log content is: ```bash theme={null} 2024-07-29 08:53:33 source > INFO o.a.k.c.c.i.AbstractCoordinator(resetStateAndGeneration):998 [Consumer clientId=consumer-airbyte-consumer-group-1, groupId=airbyte-consumer-group] Resetting generation and member id due to: consumer pro-actively leaving the group 2024-07-29 08:53:33 source > INFO o.a.k.c.c.i.AbstractCoordinator(requestRejoin):1045 [Consumer clientId=consumer-airbyte-consumer-group-1, groupId=airbyte-consumer-group] Request joining group due to: consumer pro-actively leaving the group 2024-07-29 08:53:33 source > INFO o.a.k.c.m.Metrics(close):659 Metrics scheduler closed 2024-07-29 08:53:33 source > INFO o.a.k.c.m.Metrics(close):663 Closing reporter org.apache.kafka.common.metrics.JmxReporter 2024-07-29 08:53:33 source > INFO o.a.k.c.m.Metrics(close):669 Metrics reporters closed 2024-07-29 08:53:33 source > INFO o.a.k.c.u.AppInfoParser(unregisterAppInfo):83 App info kafka.consumer for consumer-airbyte-consumer-group-1 unregistered 2024-07-29 08:53:33 source > INFO i.a.c.i.b.IntegrationRunner(runInternal):231 Completed integration: io.airbyte.integrations.source.kafka.KafkaSource 2024-07-29 08:53:33 source > INFO i.a.i.s.k.KafkaSource(main):62 Completed source: class io.airbyte.integrations.source.kafka.KafkaSource 2024-07-29 08:53:33 replication-orchestrator > (pod: airbyte-abctl / source-kafka-read-2-0-pbvbp) - Closed all resources for pod 2024-07-29 08:53:33 replication-orchestrator > Total records read: 0 (0 bytes) 2024-07-29 08:53:33 replication-orchestrator > Schema validation was performed to a max of 10 records with errors per stream. 2024-07-29 08:53:33 replication-orchestrator > readFromSource: done. (source.isFinished:true, fromSource.isClosed:false) 2024-07-29 08:53:33 replication-orchestrator > processMessage: done. (fromSource.isDone:true, forDest.isClosed:false) 2024-07-29 08:53:33 replication-orchestrator > thread status... heartbeat thread: false , replication thread: true 2024-07-29 08:53:33 replication-orchestrator > writeToDestination: done. (forDest.isDone:true, isDestRunning:true) 2024-07-29 08:53:33 replication-orchestrator > thread status... timeout thread: false , replication thread: true 2024-07-29 08:53:35 destination > INFO i.a.i.d.j.JdbcBufferedConsumerFactory(lambda$onStartFunction$1):147 Preparing raw table in destination started for stream Topic-27. schema: default, table name: _airbyte_raw_topic_27 2024-07-29 08:53:40 destination > INFO i.a.i.d.j.JdbcBufferedConsumerFactory(lambda$onStartFunction$1):147 Preparing raw table in destination started for stream Topic-24. schema: default, table name: _airbyte_raw_topic_24 2024-07-29 08:53:45 destination > INFO i.a.i.d.j.JdbcBufferedConsumerFactory(lambda$onStartFunction$1):147 Preparing raw table in destination started for stream Topic-25. schema: default, table name: _airbyte_raw_topic_25 2024-07-29 08:53:50 destination > INFO i.a.i.d.j.JdbcBufferedConsumerFactory(lambda$onStartFunction$1):147 Preparing raw table in destination started for stream Topic-28. schema: default, table name: _airbyte_raw_topic_28 2024-07-29 08:53:55 destination > INFO i.a.i.d.j.JdbcBufferedConsumerFactory(lambda$onStartFunction$1):147 Preparing raw table in destination started for stream Topic-29. schema: default, table name: _airbyte_raw_topic_29 2024-07-29 08:54:01 destination > INFO i.a.i.d.j.JdbcBufferedConsumerFactory(lambda$onStartFunction$1):147 Preparing raw table in destination started for stream Topic-30. schema: default, table name: _airbyte_raw_topic_30 2024-07-29 08:54:06 destination > INFO i.a.i.d.j.JdbcBufferedConsumerFactory(lambda$onStartFunction$1):147 Preparing raw table in destination started for stream Topic-33. schema: default, table name: _airbyte_raw_topic_33 2024-07-29 08:54:10 destination > INFO i.a.i.d.j.JdbcBufferedConsumerFactory(lambda$onStartFunction$1):147 Preparing raw table in destination started for stream Topic-34. schema: default, table name: _airbyte_raw_topic_34 2024-07-29 08:54:15 destination > INFO i.a.i.d.j.JdbcBufferedConsumerFactory(lambda$onStartFunction$1):147 Preparing raw table in destination started for stream Topic-31. schema: default, table name: _airbyte_raw_topic_31 2024-07-29 08:54:19 destination > INFO i.a.i.d.j.JdbcBufferedConsumerFactory(lambda$onStartFunction$1):147 Preparing raw table in destination started for stream Topic-32. schema: default, table name: _airbyte_raw_topic_32 ``` Sync successful: ![](https://mintcdn.com/automq/1QgM5miUDiCjXCsL/automq/integrations/data-integration/airbyte/14.webp?fit=max\&auto=format\&n=1QgM5miUDiCjXCsL\&q=85\&s=f044bf3c813b8b24c548a520cc52e941) ## Verification Results After successfully transferring the data, we can access the Databricks cluster to review the transfer results: ![It can be seen that we have successfully synchronized the selected Topics data from the AutoMQ node to Databricks. Next, data retrieval and processing can be performed via SQL. For specific syntax, please refer to the official documentation:](https://mintcdn.com/automq/1QgM5miUDiCjXCsL/automq/integrations/data-integration/airbyte/15.webp?fit=max\&auto=format\&n=1QgM5miUDiCjXCsL\&q=85\&s=83b8f2caccbdd514520a08e1b457fdab) We have successfully synchronized the selected Topics data from the AutoMQ node to Databricks. Next, data retrieval and processing can be performed via SQL. For specific syntax, please refer to the official documentation: [SQL language](https://docs.databricks.com/en/sql/language-manual/index.html)\[11]. ## Summary In this introduction, we show how to integrate AutoMQ, Airbyte, and Databricks to enable efficient real-time data flow and analytics. By leveraging AutoMQ's high-performance stream processing, Airbyte's adaptable data integration, and Databricks' robust data analytics capabilities, enterprises can develop a data processing platform that is both effective and scalable. This integration not only decreases storage and maintenance costs but also boosts data processing efficiency and improves the timeliness of business decisions. ## References \[1] AutoMQ: [https://www.automq.com/zh](https://www.automq.com/zh) \[2] Airbyte: httpsyte: [https://airbyte.com/](https://airbyte.com/) \[3] Databricks: [https://www.databricks.com/](https://www.databricks.com/) \[4] Quick Start AutoMQ: [https://docs.automq.com/automq/getting-started/deploy-multi-nodes-test-cluster-on-docker](https://docs.automq.com/automq/getting-started/deploy-multi-nodes-test-cluster-on-docker) \[5] Redpanda Console: [https://www.redpanda.com/redpanda-console-kafka-ui](https://www.redpanda.com/redpanda-console-kafka-ui) \[6] Kafdrop: [https://github.com/obsidiandynamics/kafdrop](https://github.com/obsidiandynamics/kafdrop) \[7] Quickstart Airbyte: [https://docs.airbyte.com/using-airbyte/getting-started/oss-quickstart](https://docs.airbyte.com/using-airbyte/getting-started/oss-quickstart) \[8] Docker Install: [https://docs.docker.com/desktop/install/linux-install/](https://docs.docker.com/desktop/install/linux-install/) \[9] Google databricks: [https://cloud.google.com/databricks?hl=zh\_cn](https://cloud.google.com/databricks?hl=zh_cn) \[10] Destinations : [https://docs.airbyte.com/integrations/destinations/](https://docs.airbyte.com/integrations/destinations/) \[11] SQL language: [https://docs.databricks.com/en/sql/language-manual/index.html](https://docs.databricks.com/en/sql/language-manual/index.html) # Debezium Source: https://docs.automq.com/automq/integrations/data-integration/debezium AutoMQ ensures Kafka compatibility with cloud-native scalability for real-time data processing, enhancing system efficiency and reducing costs through shared storage. ## Introduction Monitoring database changes in real-time helps businesses respond quickly to events like order updates and inventory changes. Whether it involves order processing and inventory management for e-commerce platforms or transaction monitoring in financial systems, capturing and handling real-time database changes is essential. This capability enhances system responsiveness and allows timely business operations in response to data changes. This article will describe how to use Debezium \[1] to monitor changes in MySQL databases and relay these change events to AutoMQ \[2]. AutoMQ is an efficient and cost-effective stream processing system, offering high elasticity and availability, making it well-suited for real-time data processing. By adopting this approach, businesses can manage order changes, inventory updates, and more, with the ability to set alert rules for automated monitoring. Downstream services can consume these messages to gain a current perspective on database changes, respond swiftly to business needs, optimize system performance, and ensure business continuity and stability. ### Overview of AutoMQ AutoMQ is a Kafka-compatible streaming platform. See [Overview](/automq/what-is-automq) for details. AutoMQ’s shared storage architecture significantly reduces storage and operational complexity. ![](https://mintcdn.com/automq/bAg_OT9sHANf_LMr/automq/integrations/data-integration/debezium/1.gif?s=784997bd0342162b2e5f5f9cc29921db) ### Debezium Overview Debezium is an open-source project that provides a low-latency streaming platform for Change Data Capture (CDC). By installing and configuring Debezium, you can monitor database changes and convert these change events into Kafka messages. Debezium supports multiple databases as data sources, including MySQL, PostgreSQL, and MongoDB, ensuring that only committed changes are visible. This means applications need not worry about transactions or rollbacks. Moreover, because Debezium uses persistent, replica-backed logs to record the history of database data changes, your application can stop and restart at any time without missing events that occurred during downtime, ensuring all events are processed correctly and completely. Debezium leverages Kafka and Kafka Connect's persistence, reliability, and fault tolerance, with each connector monitoring an upstream database server, capturing all database changes, and recording them into Kafka Topics. This allows multiple clients to independently consume the same data change events while minimizing impact on the upstream database. Common use cases for Debezium include cache invalidation, simplifying monolithic applications, sharing databases, and data integration. With Debezium, enterprises can achieve real-time monitoring and processing of database changes, meeting various business scenario needs such as real-time data synchronization and event-driven architecture. Its architecture diagram is presented below: ![debezium structure \[4\]](https://mintcdn.com/automq/P6Ug3urJlyU1p2ee/automq/integrations/data-integration/debezium/2.webp?fit=max\&auto=format\&n=P6Ug3urJlyU1p2ee\&q=85\&s=699eaae8cfb8ed20c5c2c08387254db9) ## Prerequisites * Available Docker environment. * An available AutoMQ node for receiving data change event messages. * A MySQL database with binlog enabled. * An available Kafka Connect service that can connect to the AutoMQ node. * Register the Debezium MySQL plugin with Kafka Connect for monitoring and converting data change operations. ## Quick Deployment ### Deploy AutoMQ You can refer to the AutoMQ official documentation for setup: [Deploy Multi-Nodes Cluster on Linux▸](/automq/deployment/deploy-multi-nodes-cluster-on-linux). You will receive the service access address for AutoMQ, for example: `192.168.123.41:9092`, which will then be used to connect with AutoMQ via Kafka Connect. ### Deploy MySQL MySQL can be quickly deployed and configured using Docker with the official image provided by Debezium. This image includes some initial database tables, making the deployment process simpler. Use the following command to create a container named "mysql": ```bash theme={null} docker run -it --rm --name mysql -p 3306:3306 -e MYSQL_ROOT_PASSWORD=debezium -e MYSQL_USER=mysqluser -e MYSQL_PASSWORD=mysqlpw quay.io/debezium/example-mysql:2.7 ``` * `MYSQL_ROOT_PASSWORD`: Set the password for the root user. * `MYSQL_USER` and `MYSQL_PASSWORD`: Set the username and password for a standard user. Connect to the MySQL client as the regular user: ```bash theme={null} docker exec -it mysql mysql -u mysqluser -pmysqlpw ``` Verify the data using the command-line tool to view all existing database tables: ```text theme={null} mysql> show databases; +--------------------+ | Database | +--------------------+ | information_schema | | inventory | | performance_schema | +--------------------+ mysql> use inventory; mysql> show tables; +---------------------+ | Tables_in_inventory | +---------------------+ | addresses | | customers | | geom | | orders | | products | | products_on_hand | +---------------------+ ``` ### Deploy Kafka Connect Use the following command to pull the Kafka Connect image and start the container. Make sure to specify the AutoMQ service address: ```bash theme={null} docker run -it --rm --name connect -p 8083:8083 \ -e GROUP_ID=1 \ -e CONFIG_STORAGE_TOPIC=my_connect_configs \ -e OFFSET_STORAGE_TOPIC=my_connect_offsets \ -e STATUS_STORAGE_TOPIC=my_connect_statuses \ -e BOOTSTRAP_SERVERS=192.168.123.41:9092 \ --link mysql:mysql quay.io/debezium/connect:2.7 ``` Parameter Description: | GROUP\_ID | The group ID of the Kafka Connect cluster. | | - | - | | CONFIG\_STORAGE\_TOPIC | The AutoMQ topic for storing connector configurations. | | OFFSET\_STORAGE\_TOPIC | The AutoMQ topic for storing connector offsets. | | STATUS\_STORAGE\_TOPIC | AutoMQ topic used for storing connector status. | | --link mysql:mysql | Connect to the container named mysql. | | -e BOOTSTRAP\_SERVERS=192.168.123.41:9092 | Specify the AutoMQ node address. | If the connection fails, check that AutoMQ and MySQL services have started and the address is correct. ### **Create and Register Debezium MySQL Connector** Debezium MySQL Connector acts as a plugin for Kafka Connect, allowing you to monitor data changes in a MySQL database. Thus, you can register the MySQL connector using curl by executing the following command: ```bash theme={null} # Create a File Within a Specified Directory. cd /home vim mysql-connector.json ``` The JSON file content is: ```json theme={null} { "name": "inventory-connector", "config": { "connector.class": "io.debezium.connector.mysql.MySqlConnector", "tasks.max": "1", "database.hostname": "mysql", "database.port": "3306", "database.user": "debezium", "database.password": "dbz", "database.server.id": "184054", "topic.prefix": "dbserver1", "database.include.list": "inventory", "schema.history.internal.kafka.bootstrap.servers": "192.168.123.41:9092", "schema.history.internal.kafka.topic": "schema-changes.inventory" } } ``` Use the following command to submit the connector configuration file to Kafka Connect: ```bash theme={null} curl -i -X POST -H "Accept:application/json" -H "Content-Type:application/json" --data @mysql-connector.json http://localhost:8083/connectors/ ``` The successful response content is as follows: ```json theme={null} HTTP/1.1 201 Created Date: Mon, 05 Aug 2024 01:51:43 GMT Location: http://localhost:8083/connectors/inventory-connector Content-Type: application/json Content-Length: 518 Server: Jetty(9.4.53.v20231009) {"name":"inventory-connector","config":{"connector.class":"io.debezium.connector.mysql.MySqlConnector","tasks.max":"1","database.hostname":"mysql","database.port":"3306","database.user":"debezium","database.password":"dbz","database.server.id":"184054","topic.prefix":"dbserver1","database.include.list":"inventory","schema.history.internal.kafka.bootstrap.servers":"192.168.123.41:9092","schema.history.internal.kafka.topic":"schema-changes.inventory","name":"inventory-connector-new"},"tasks":[],"type":"source"} ``` ## Verify Data Change Capture ### Insert, Update, and Delete Database Data By performing data insertions, updates, and deletions in the MySQL console, verify whether the Kafka Connector can capture these changes: ```sql theme={null} -- insert INSERT INTO customers (first_name, last_name, email) VALUES ('John', 'Doe', 'john.doe@example.com'); -- update UPDATE customers SET email='john.doe@newdomain.com' WHERE first_name='John' AND last_name='Doe'; -- delete DELETE FROM customers WHERE first_name='John' AND last_name='Doe'; ``` ### Examine AutoMQ Messages Because the Kafka Connector logs are not distinct enough, a more noticeable method can be used to verify data change capture: check the Topic data in AutoMQ to validate if the capture was successful. This verification of Topic data can be done using scripts or visual monitoring tools; you can refer to the content below for specific operations. #### Detection Using Kafka Scripts Download the AutoMQ project binary package from: [Github Releases](https://github.com/AutoMQ/automq/releases) \[6]. After extraction, execute the script command in the root directory of the project. This command will retrieve the data changes from the customers table: ```bash theme={null} bin/kafka-console-consumer.sh --bootstrap-server 192.168.123.41:9092 --topic dbserver1.inventory.customers --from-beginning ``` > Make sure to replace the AutoMQ service address. Results are as follows: ![](https://mintcdn.com/automq/P6Ug3urJlyU1p2ee/automq/integrations/data-integration/debezium/3.webp?fit=max\&auto=format\&n=P6Ug3urJlyU1p2ee\&q=85\&s=91ba4c4e1a5699f3e29179a861ec4a24) #### Detection Using Visualization Tools You can monitor the status of AutoMQ nodes through various visualization tools, such as [Redpanda Console](https://www.redpanda.com/redpanda-console-kafka-ui) \[7], [Kafdrop](https://github.com/obsidiandynamics/kafdrop) \[8], etc. Using Redpanda Console as an example, you can view all Topic data and detailed information of the current AutoMQ nodes. For specific deployment instructions for Redpanda Console, you can refer to the AutoMQ official documentation: [Redpanda Console▸](/automq/integrations/kafka-ui/redpanda-console)\[9]. Here, you can see all the database tables monitored by the connector, along with the database and connector configuration files, offsets, with each table corresponding to a Topic. ![](https://mintcdn.com/automq/P6Ug3urJlyU1p2ee/automq/integrations/data-integration/debezium/4.webp?fit=max\&auto=format\&n=P6Ug3urJlyU1p2ee\&q=85\&s=1f57a74aaf60298d9ae00452f684b6ab) You can view detailed data change information, such as updates to customers: ![](https://mintcdn.com/automq/P6Ug3urJlyU1p2ee/automq/integrations/data-integration/debezium/5.webp?fit=max\&auto=format\&n=P6Ug3urJlyU1p2ee\&q=85\&s=19e3567492010fd73652bfc0320a239a) You can verify data capture by updating SQL with more specific data. ## Clean up the Environment You can easily clean up the Docker environment by executing the following command: ```bash theme={null} docker stop mysql connect ``` > Since the `--rm` parameter was included at startup, the container will automatically be removed once it stops. ## Summary Through the introduction in this article, we explore how to use Debezium to monitor changes in a MySQL database and send these change events to AutoMQ for processing. By deploying MySQL and Kafka Connect, and configuring the Debezium MySQL connector, enterprises can achieve real-time monitoring and processing of database changes to meet business needs such as order modifications and inventory management. The high efficiency and scalability of AutoMQ, along with the low latency and reliability of Debezium, make it an ideal choice for real-time data processing in enterprises. For more scalability options on obtaining event messages from data change monitoring, you can refer to: [Debezium](https://debezium.io/) \[10]. ## References \[1] Debezium: [https://debezium.io/](https://debezium.io/) \[2] AutoMQ: [https://www.automq.com/](https://www.automq.com/) \[3] Kafka Connect: [https://docs.confluent.io/platform/current/connect/index.html](https://docs.confluent.io/platform/current/connect/index.html) \[4] Debezium Structure: [https://docs.redhat.com/zh\_hans/documentation/red\_hat\_integration/2023.q2/html/debezium\_user\_guide/description-of-debezium-architecture](https://docs.redhat.com/zh_hans/documentation/red_hat_integration/2023.q2/html/debezium_user_guide/description-of-debezium-architecture) \[5] Quick Start with AutoMQ: [https://docs.automq.com/automq/getting-started](https://docs.automq.com/automq/getting-started) \[6] Github Release: [https://github.com/AutoMQ/automq/releases](https://github.com/AutoMQ/automq/releases) \[7] Redpanda Console: [https://www.redpanda.com/redpanda-console-kafka-ui](https://www.redpanda.com/redpanda-console-kafka-ui) \[8] Kafdrop: [https://github.com/obsidiandynamics/kafdrop](https://github.com/obsidiandynamics/kafdrop) \[9] Redpanda Console | AutoMQ: [Redpanda Console▸](/automq/integrations/kafka-ui/redpanda-console) \[10] Debezium: [https://debezium.io/](https://debezium.io/) # Kafdrop Source: https://docs.automq.com/automq/integrations/kafka-ui/kafdrop Enable real-time Kafka cluster monitoring with Kafdrop and AutoMQ's integration, scalability, and cost efficiency. Learn to set up and manage your clusters efficiently. > [!TIP] > > The relevant code can be found in the [AutoMQ Labs](https://github.com/AutoMQ/automq-labs), including an AutoMQ and Kafdrop [integration example](https://github.com/AutoMQ/automq-labs/tree/main/opensource-examples/ui/kafdrop) for a straightforward setup experience. ## **Preface** [Kafdrop](https://github.com/obsidiandynamics/kafdrop) \[1] is a streamlined, intuitive, and powerful Web UI tool designed for Kafka. It enables developers and administrators to view and manage key metadata of Kafka clusters, including topics, partitions, consumer groups, and their offsets. By providing a user-friendly interface, Kafdrop greatly simplifies the monitoring and management processes of Kafka clusters, allowing users to efficiently access cluster status information without relying on complex command-line tools. Thanks to AutoMQ's full compatibility with Kafka, it integrates with Kafdrop. By leveraging Kafdrop, AutoMQ users also benefit from an intuitive user interface to monitor Kafka cluster status in real-time, covering crucial metadata such as topics, partitions, consumer groups, and their offsets. This monitoring capability not only boosts the efficiency of problem diagnostics but also aids in optimizing cluster performance and resource utilization. This tutorial will guide you on how to start the Kafdrop service and pair it with an AutoMQ cluster to achieve cluster status monitoring and management. ![Kafdrop Interface](https://mintcdn.com/automq/P6Ug3urJlyU1p2ee/automq/integrations/kafka-ui/kafdrop/1.webp?fit=max\&auto=format\&n=P6Ug3urJlyU1p2ee\&q=85\&s=36172cfcd0e5ed459092a2c82ae13756) ## Prerequisites * An available Kafdrop environment. * An available AutoMQ cluster. ## Install and Start the AutoMQ Cluster Refer to the official AutoMQ documentation for deploying an AutoMQ cluster: [Deploy Multi-Nodes Cluster on Linux▸](/automq/deployment/deploy-multi-nodes-cluster-on-linux) \[2] ## Starting the Kafdrop Service In the steps mentioned above, an AutoMQ cluster has already been set up, and you've obtained the addresses and ports on which the broker nodes are listening. The next step is to start the Kafdrop service. > Note: Ensure that the location where the Kafdrop service is hosted can access the AutoMQ cluster; otherwise, you may encounter connection timeouts or other issues. Kafdrop can be deployed via JAR package, Docker deployment, or using the protobuf method. Refer to the [official documentation](https://github.com/obsidiandynamics/kafdrop/blob/master/README.md#getting-started) \[3]. In this example, we use the JAR package method to start the Kafdrop service. The steps are as follows: * Clone the Kafdrop repository source code: [Kafdrop GitHub](https://github.com/obsidiandynamics/kafdrop) \[4] ```bash theme={null} git clone https://github.com/obsidiandynamics/kafdrop.git ``` * Use Maven to compile and package Kafdrop locally to generate the JAR file. Execute the following in the root directory: ```bash theme={null} mvn clean compile package ``` * To start the service, you need to specify the addresses and ports of the AutoMQ cluster brokers: ```bash theme={null} java --add-opens=java.base/sun.nio.ch=ALL-UNNAMED \ -jar target/kafdrop-.jar \ --kafka.brokerConnect=,... ``` 1. Replace `kafdrop-.jar` with the specific version, such as `kafdrop-4.0.2-SNAPSHOT.jar`. 2. Use `--kafka.brokerConnect=` to specify the host and port for the specific cluster broker nodes. Console startup effect is shown below: ![](https://mintcdn.com/automq/P6Ug3urJlyU1p2ee/automq/integrations/kafka-ui/kafdrop/2.webp?fit=max\&auto=format\&n=P6Ug3urJlyU1p2ee\&q=85\&s=c01998c12d2b846d4d5b39f04a12c60f) If not specified, `kafka.brokerConnect` defaults to `localhost:9092`. **Note:** Starting from Kafdrop 3.10.0, a ZooKeeper connection is no longer required. All necessary cluster information is retrieved through the Kafka management API. Open a browser and navigate to [http://localhost:9000](http://localhost:9000/). The port can be overridden by adding the following configuration: ```text theme={null} --server.port= --management.server.port= ``` ## Final Output 1. Complete Interface ![](https://mintcdn.com/automq/P6Ug3urJlyU1p2ee/automq/integrations/kafka-ui/kafdrop/3.webp?fit=max\&auto=format\&n=P6Ug3urJlyU1p2ee\&q=85\&s=447e88c017b2d6d3979a9ce3270506ab) Displays the number of partitions, number of topics, and other cluster status information. 2. Create New Topic Feature ![](https://mintcdn.com/automq/P6Ug3urJlyU1p2ee/automq/integrations/kafka-ui/kafdrop/4.webp?fit=max\&auto=format\&n=P6Ug3urJlyU1p2ee\&q=85\&s=fe228ab70041f2ee7bd9f36560103228) 3. Details on Broker Node ![](https://mintcdn.com/automq/P6Ug3urJlyU1p2ee/automq/integrations/kafka-ui/kafdrop/5.webp?fit=max\&auto=format\&n=P6Ug3urJlyU1p2ee\&q=85\&s=cc1dae06e920c35a128ef65197557c76) 4. Details on Topic ![](https://mintcdn.com/automq/P6Ug3urJlyU1p2ee/automq/integrations/kafka-ui/kafdrop/6.webp?fit=max\&auto=format\&n=P6Ug3urJlyU1p2ee\&q=85\&s=cf8df1476583975e2ec7ec242439f79c) 5. Information on Messages Within Topic ![](https://mintcdn.com/automq/P6Ug3urJlyU1p2ee/automq/integrations/kafka-ui/kafdrop/7.webp?fit=max\&auto=format\&n=P6Ug3urJlyU1p2ee\&q=85\&s=ddbe61b14f14d474cfacce828d01cecb) ## Summary This tutorial examines the key features and functionalities of Kafdrop and explains how to integrate it with AutoMQ clusters to easily monitor and manage those clusters. Utilizing Kafdrop not only aids teams in better understanding and controlling their data flows but also enhances development and operational efficiency, ensuring effective and stable data processing. We hope this tutorial offers valuable insights and assistance when using Kafdrop with AutoMQ clusters. ## References \[1] Kafdrop: [https://github.com/obsidiandynamics/kafdrop](https://github.com/obsidiandynamics/kafdrop) \[2] Deploy in Cluster Mode on Linux Hosts | AutoMQ: [https://docs.automq.com/automq/getting-started/cluster-deployment-on-linux](https://docs.automq.com/automq/getting-started/cluster-deployment-on-linux) \[3] Kafdrop Deployment Methods: [https://github.com/obsidiandynamics/kafdrop/blob/master/README.md#getting-started](https://github.com/obsidiandynamics/kafdrop/blob/master/README.md#getting-started) \[4] Kafdrop project repository: [https://github.com/obsidiandynamics/kafdrop](https://github.com/obsidiandynamics/kafdrop) # Redpanda Console Source: https://docs.automq.com/automq/integrations/kafka-ui/redpanda-console AutoMQ offers cloud-native scalability and Kafka compatibility for cluster management. Integrate with Redpanda Console for real-time monitoring and efficient data handling. > [!TIP] > > You can reference the relevant code from [AutoMQ Labs](https://github.com/AutoMQ/automq-labs), which includes integration examples of AutoMQ and Redpanda Console [here](https://github.com/AutoMQ/automq-labs/tree/main/opensource-examples/ui/redpanda-console). Launch with a single click to experience it. ### Manage Kafka/AutoMQ Clusters More Conveniently Using the Kafka Web UI. With the rapid advancement of big data technologies, Kafka has become a cornerstone for real-time data processing in enterprises as a high-throughput, low-latency distributed messaging system. However, managing and monitoring Kafka clusters is not an easy task. Traditional command-line tools and scripts, while powerful, can be complex and unintuitive for developers and operations personnel. To address these challenges, the Kafka Web UI has emerged, providing users with a more convenient and efficient way to manage Kafka clusters. After over a decade of development, Apache Kafka has amassed a wealth of ecosystem resources within the industry. AutoMQ, as a successor to Apache Kafka, can leverage products within its ecosystem due to its full compatibility with Kafka. AutoMQ BYOC and AutoMQ Software both offer substantial control capabilities through AutoMQ Console. If you are using AutoMQ, you can also utilize products like Kafdrop, Redpanda Console \[1], and similar tools to manage AutoMQ clusters. Today's content covers how to monitor the status of AutoMQ clusters using [Redpanda Console](https://www.redpanda.com/redpanda-console-kafka-ui) \[1] to enhance system maintainability and stability. ### Integration of AutoMQ with Redpanda Console Redpanda Console is a Kafka Web UI provided by [Redpanda](https://www.redpanda.com/), designed for monitoring and managing Redpanda or Kafka clusters. It offers an intuitive user interface through which users can easily view cluster status, monitor performance metrics, and manage topics and partitions. This console is aimed at simplifying the day-to-day operations of data streaming systems, enabling users to maintain and monitor their clusters more effectively. Thanks to AutoMQ being fully compatible with Kafka, it integrates with Redpanda Console. By leveraging Redpanda Console, AutoMQ users can also benefit from an intuitive user interface to monitor the real-time status of AutoMQ clusters, including vital metadata such as topics, partitions, consumer groups, and their offsets. This monitoring capability not only enhances the efficiency of problem diagnosis but also helps optimize cluster performance and resource usage. This tutorial will guide you on how to launch the Redpanda Console service and use it alongside AutoMQ clusters to effectively monitor and manage cluster status. ![Redpanda Console](https://mintcdn.com/automq/P6Ug3urJlyU1p2ee/automq/integrations/kafka-ui/redpanda-console/1.webp?fit=max\&auto=format\&n=P6Ug3urJlyU1p2ee\&q=85\&s=b26c881f2952ce911cd55f42af8d704f) ## Prerequisites * Deploy AutoMQ Cluster * Prepare Redpanda Console Environment ### Deploy AutoMQ Cluster Refer to the official AutoMQ documentation: [Deploy Multi-Nodes Cluster on Linux▸](/automq/deployment/deploy-multi-nodes-cluster-on-linux) \[3]. ### Deploy Redpanda Console There are two ways to deploy the Redpanda Console: Docker deployment and distribution deployment. Docker deployment is simpler, and if you want a quick and easy experience integrating AutoMQ with the Redpanda Console, it is recommended to choose Docker for deployment. If you have specific requirements, such as login authentication, SASL authentication, TLS configuration, and log level settings, you should opt for distribution deployment. Below, I'll introduce the configuration methods for both. #### Docker Deployment Redpanda Console can be deployed via Docker, referring to [Quick Start](https://github.com/redpanda-data/console?tab=readme-ov-file#quick-start) \[4]. In the process described above, after setting up the AutoMQ cluster, you will know the addresses and ports that all Broker nodes listen to. Thus, you can establish an association between the Redpanda Console and the AutoMQ cluster by specifying the `KAFKA_BROKERS` parameter in the Docker startup command. The Docker container startup command is as follows: ```bash theme={null} docker run -p 8080:8080 -e KAFKA_BROKERS=192.168.0.4:9092,192.168.0.5:9092,192.168.0.6:9092 docker.redpanda.com/redpandadata/console:latest ``` * `-p 8080:8080` : Specifies the service access mapping port for the Redpanda Console. * `KAFKA_BROKERS` : Must be specified as the Broker address of your AutoMQ cluster. #### Deployment of Distribution You need to choose an appropriate version to download and extract it into a specified directory, such as `/opt`, from Redpanda Console's GitHub Releases page: [Release Redpanda Console](https://github.com/redpanda-data/console/releases/tag/v2.6.0) \[5]. The command is as follows: ```bash theme={null} # Ubuntu Linux cd /opt sudo curl -L -o redpanda_console.tar.gz https://github.com/redpanda-data/console/releases/download/v2.6.0/redpanda_console_2.6.0_linux_amd64.tar.gz # Unzip, Get Redpanda_console sudo tar -xzf redpanda_console.tar.gz # Config Set sudo mkdir -p /etc/redpanda # Write Config sudo vim /etc/redpanda/redpanda-console-config.yaml ``` An example of the contents for the `redpanda-console-config.yaml` configuration file is shown below: ```yaml theme={null} kafka: #Brokers is a list of bootstrap servers with #port (for example "localhost:9092"). brokers: - broker-0.mycompany.com:19092 - broker-1.mycompany.com:19092 - broker-2.mycompany.com:19092 ``` > Note: Ensure that the server where you are installing Redpanda Console has access to the server where the Broker node mentioned in the configuration file is located. For more detailed settings, refer to the official documentation: [Redpanda Console Configuration](https://docs.redpanda.com/current/reference/console/config/#example-redpanda-console-configuration-file) \[6]. After completing the configuration, you need to set environment variables so that the Redpanda Console executable can access the configuration file information and start the Redpanda Console: ```bash theme={null} # Set Env export CONFIG_FILEPATH="/etc/redpanda/redpanda-console-config.yaml" # /opt/ Run Console ./redpanda-console ``` You will get the following results: ```json theme={null} ./redpanda-console {"level":"info","ts":"2024-07-10T09:52:52.958+0800","msg":"started Redpanda Console","version":"2.6.0","built_at":"1717083695"} {"level":"info","ts":"2024-07-10T09:52:52.963+0800","msg":"connecting to Kafka seed brokers, trying to fetch cluster metadata"} {"level":"info","ts":"2024-07-10T09:52:54.780+0800","msg":"successfully connected to kafka cluster","advertised_broker_count":1,"topic_count":2,"controller_id":0,"kafka_version":"at least v3.6"} {"level":"info","ts":"2024-07-10T09:53:05.620+0800","msg":"Server listening on address","address":"[::]:8080","port":8080} ``` ## Access the Console Page After completing the above deployment operations, you can access the console service by entering the address in your browser (e.g., [http://console\_ip:8080](http://localhost:8080)). The display will appear as follows: ### **Cluster Overview** The Cluster Overview page provides users with a broad perspective, displaying the core information of the AutoMQ cluster, including but not limited to: * Cluster Operational Status: Displays the current health of the cluster, helping users quickly identify any issues. * Storage Utilization: Indicates data storage usage within the cluster, aiding users in managing and planning storage effectively. * Version Information: Shows the version of the running AutoMQ cluster, simplifying the tracking and upgrading process. * Number of Online Brokers: Displays the real-time count of online brokers, an essential metric. * Number of Topics and Replicas: Provides information on the number of topics and replicas, assisting users in understanding the cluster's scale and data replication status. ![](https://mintcdn.com/automq/P6Ug3urJlyU1p2ee/automq/integrations/kafka-ui/redpanda-console/2.webp?fit=max\&auto=format\&n=P6Ug3urJlyU1p2ee\&q=85\&s=c338a2dc15709ff56a20f8317cf18714) Monitoring the state of a cluster is essential for maintaining the stability and performance of messaging queue systems. By observing real-time metrics, such as the cluster's operational status, storage utilization, version information, the number of online brokers, and the count of topics and replicas, operations personnel can swiftly detect and address potential issues, preventing system failures from affecting business operations. Furthermore, these metrics support capacity planning and resource management, ensuring the system is prepared to manage future data growth. Having access to cluster version information also enables users to upgrade software promptly to benefit from the latest features and security patches, thereby enhancing overall system reliability and efficiency. ### **Topic Overview** On the Topic list page, users can see an overview of all Topics in the current AutoMQ cluster, including essential details for each Topic, such as the number of partitions and replica strategy. This page allows users to efficiently browse and manage Topics. ![](https://mintcdn.com/automq/P6Ug3urJlyU1p2ee/automq/integrations/kafka-ui/redpanda-console/3.webp?fit=max\&auto=format\&n=P6Ug3urJlyU1p2ee\&q=85\&s=d1b94b25d4a3025d604a56c38a6c241f) ### **Topic Details** By clicking on a specific Topic, users navigate to a detailed page for that Topic, where they can further explore understanding and operational functionalities: * Message List: Browsing and searching messages within a Topic is highly beneficial for tracking and debugging purposes. * Consumer Information: Displays information on consumers and consumer groups currently subscribed to the Topic, facilitating the monitoring of consumption status. * Partition Status: Provides detailed information for each partition, including key metrics like Leader and ISR. * Configuration Information: Lists the configuration settings of the Topic, with support for modifications to optimize performance or behavior. * ACL (Access Control List): Manages access permissions for the Topic to ensure data security. Furthermore, Redpanda Console also supports users in manually creating and publishing messages, which is highly valuable for message injection during testing or specific scenarios. ![](https://mintcdn.com/automq/P6Ug3urJlyU1p2ee/automq/integrations/kafka-ui/redpanda-console/4.webp?fit=max\&auto=format\&n=P6Ug3urJlyU1p2ee\&q=85\&s=494a52151255f2620d11fbd07193b703) Monitoring topic details allows us to gain insight into the operational status of the message queue by navigating through the message list for tracking and debugging, checking consumer information to monitor consumption status, understanding partition state to ensure data distribution and high availability, managing configuration information to optimize performance, and setting access controls to safeguard data security. These features aid in the timely identification and resolution of issues, enhancing the overall efficiency and reliability of the system. ## Summary This article explains the integration process of Redpanda Console with AutoMQ, demonstrating how this powerful tool can simplify and enhance the management of AutoMQ clusters. Hopefully, this article can serve as a practical reference for users aiming to improve the efficiency and functionality of message queue management. ## References \[1] Redpanda Console: [https://www.redpanda.com/redpanda-console-kafka-ui](https://www.redpanda.com/redpanda-console-kafka-ui) \[2] Redpanda: [https://www.redpanda.com/](https://www.redpanda.com/) \[3] Cluster Deployment for AutoMQ: [https://docs.automq.com/automq/getting-started/deploy-multi-nodes-test-cluster-on-docker](https://docs.automq.com/automq/getting-started/deploy-multi-nodes-test-cluster-on-docker) \[4] Quick Start: [https://github.com/redpanda-data/console?tab=readme-ov-file#quick-start](https://github.com/redpanda-data/console?tab=readme-ov-file#quick-start) \[5] Release Redpanda Console: [https://github.com/redpanda-data/console/releases/tag/v2.6.0](https://github.com/redpanda-data/console/releases/tag/v2.6.0) \[6] Redpanda Console Configuration: [https://docs.redpanda.com/current/reference/console/config/#example-redpanda-console-configuration-file](https://docs.redpanda.com/current/reference/console/config/#example-redpanda-console-configuration-file) \[7] Kafdrop Github: [https://github.com/obsidiandynamics/kafdrop](https://github.com/obsidiandynamics/kafdrop) # Flashcat Source: https://docs.automq.com/automq/integrations/observability/flashcat AutoMQ offers cloud-native scalability, Kafka compatibility, and cost efficiency by integrating with Nightingale for robust, real-time monitoring and performance optimization. ## Introduction Monitoring your AutoMQ cluster helps you maintain stability and optimize performance. This guide shows how to integrate AutoMQ with the Nightingale monitoring system. ### Overview of Nightingale The Nightingale Monitoring System (Nightingale) is an open-source, cloud-native observability and analysis tool that adopts an All-in-One design philosophy, integrating data collection, visualization, monitoring alerts, and data analysis into one platform. Its main advantages include efficient data collection capabilities, flexible alert strategies, and rich visualization features. Nightingale is closely integrated with various cloud-native ecosystems, supporting multiple data sources and storage backends, and providing low-latency, high-reliability monitoring services. By using Nightingale, enterprises can achieve comprehensive monitoring and management of complex distributed systems, quickly identify and resolve issues, thereby optimizing system performance and enhancing business continuity. ![Nightingale Architecture \[3\]](https://mintcdn.com/automq/P6Ug3urJlyU1p2ee/automq/integrations/observability/flashcat/2.webp?fit=max\&auto=format\&n=P6Ug3urJlyU1p2ee\&q=85\&s=2fee2628fab0eb0d14554a6cd8577924) ## Prerequisites To monitor the status of the cluster, you will need the following setup: * Deploy an available AutoMQ node/cluster and open the Metrics collection port * Deploy Nightingale monitoring and its dependencies * Deploy [Prometheus](https://prometheus.io/docs/prometheus/latest/getting_started/) to collect Metrics data ## Deploy AutoMQ, Prometheus, and Nightingale Monitoring ### Deploy AutoMQ Refer to the AutoMQ documentation: [Deploy Multi-Nodes Cluster on Linux▸](/automq/deployment/deploy-multi-nodes-cluster-on-linux). Before deployment, add the following configuration parameters to enable the Prometheus pull interface. After starting the AutoMQ cluster with these parameters, each node will additionally open an HTTP interface to fetch AutoMQ monitoring metrics. These metrics follow the format of Prometheus Metrics. ```bash theme={null} bin/kafka-server-start.sh ...\ --override s3.telemetry.metrics.exporter.type=prometheus \ --override s3.metrics.exporter.prom.host=0.0.0.0 \ --override s3.metrics.exporter.prom.port=8890 \ .... ``` Once AutoMQ monitoring metrics are enabled, metrics in Prometheus format can be pulled via HTTP from any node using the address: `http://{node_ip}:8890`. An example of the response results is as follows: ```text theme={null} .... kafka_request_time_mean_milliseconds{otel_scope_name="io.opentelemetry.jmx",type="DescribeDelegationToken"} 0.0 1720520709290 kafka_request_time_mean_milliseconds{otel_scope_name="io.opentelemetry.jmx",type="CreatePartitions"} 0.0 1720520709290 ... ``` For more information about the metrics, refer to the AutoMQ official documentation: [Prometheus Metrics▸](/automq/observability/prometheus-metrics). ### Deploying Prometheus Prometheus can be deployed by downloading the binary package or using Docker. Below is an introduction to these two deployment methods. #### Binary Deployment For ease of use, you can create a new script and modify the Prometheus download version as needed. Then, execute the script to complete the deployment. First, create a new script: ```bash theme={null} cd /home vim install_prometheus.sh # !!! Paste the Following Script Content and Save and Exit # Grant Permissions chmod +x install_prometheus.sh # Execute the Script ./install_prometheus.sh ``` ```bash theme={null} version=2.45.3 filename=prometheus-${version}.linux-amd64 mkdir -p /opt/prometheus wget https://github.com/prometheus/prometheus/releases/download/v${version}/${filename}.tar.gz tar xf ${filename}.tar.gz cp -far ${filename}/* /opt/prometheus/ # Config as a Service cat </etc/systemd/system/prometheus.service [Unit] Description="prometheus" Documentation=https://prometheus.io/ After=network.target [Service] Type=simple ExecStart=/opt/prometheus/prometheus --config.file=/opt/prometheus/prometheus.yml --storage.tsdb.path=/opt/prometheus/data --web.enable-lifecycle --web.enable-remote-write-receiver Restart=on-failure SuccessExitStatus=0 LimitNOFILE=65536 StandardOutput=syslog StandardError=syslog SyslogIdentifier=prometheus [Install] WantedBy=multi-user.target EOF systemctl enable prometheus systemctl restart prometheus systemctl status prometheus ``` Subsequently, modify the Prometheus configuration file to **add a task to collect observability data from AutoMQ** and **restart** Prometheus by executing the following command: ```bash theme={null} # Add the Following Content to the Configuration File: vim /opt/prometheus/prometheus.yml # Restart Prometheus systemctl restart prometheus ``` **Refer to the following configuration file content**, please modify the `client_ip` to the AutoMQ observable data exposure address: ```yaml theme={null} # My Global Config global: scrape_interval: 15s # Set the Scrape Interval to Every 15 Seconds. Default Is Every 1 Minute. evaluation_interval: 15s # Evaluate Rules Every 15 Seconds. the Default Is Every 1 Minute. scrape_configs: # The Job Name Is Added as a Label `job=` to Any Timeseries Scraped from This Config. - job_name: "prometheus" static_configs: - targets: ["localhost:9090"] - job_name: "automq" static_configs: - targets: ["{client_ip}:8890"] ``` Once the deployment is completed, you can access Prometheus through a browser to determine if AutoMQ's Metrics data has been successfully collected by visiting `http://{client_ip}:9090/targets`: ![](https://mintcdn.com/automq/P6Ug3urJlyU1p2ee/automq/integrations/observability/flashcat/3.webp?fit=max\&auto=format\&n=P6Ug3urJlyU1p2ee\&q=85\&s=265923fe2dacd9f187373a710d977106) #### Docker Deployment If you already have a running Prometheus Docker container, please execute the following command to remove the container: ```bash theme={null} docker stop prometheus docker rm prometheus ``` Create a new configuration file and mount it during Docker startup: ```bash theme={null} mkdir -p /opt/prometheus vim /opt/prometheus/prometheus.yml # Refer to the Configuration Mentioned in the "Binary Deployment" Section Above for the Content ``` Start the Docker container: ```bash theme={null} docker run -d \ --name=prometheus \ -p 9090:9090 \ -v /opt/prometheus/prometheus.yml:/etc/prometheus/prometheus.yml \ -m 500m \ prom/prometheus \ --config.file=/etc/prometheus/prometheus.yml \ --enable-feature=otlp-write-receiver \ --web.enable-remote-write-receiver ``` This will direct you to a Prometheus service that collects AutoMQ Metrics. For more information on integrating AutoMQ Metrics with Prometheus, refer to: [Integrating Metrics with Prometheus▸](/automq/observability/integrating-metrics-with-prometheus). ### Deploy Nightingale Monitoring Nightingale monitoring can be deployed in the following three ways. For more detailed deployment instructions, refer to the [official documentation](https://flashcat.cloud/docs/content/flashcat-monitor/nightingale-v7/install/intro/) \[5]: * Deploy using Docker compose * Deploy using binary * Helm Deployment Next, I will proceed with the deployment using a binary method. #### Download Nightingale Select the appropriate version to download from the Nightingale [GitHub releases](https://github.com/ccfos/nightingale) \[6] page. The version used here is `v7.0.0-beta.14`. If you are on an amd architecture machine, you can directly execute the following command: ```bash theme={null} cd /home # Download wget https://github.com/ccfos/nightingale/releases/download/v7.0.0-beta.14/n9e-v7.0.0-beta.14-linux-amd64.tar.gz mkdir -p /home/flashcat # Extract the Files to the /home/flashcat Folder tar -xzf /home/n9e-v7.0.0-beta.14-linux-amd64.tar.gz -C /home/flashcat # Navigate to the Home Directory cd /home/flashcat ``` #### Configure the Dependency Environment Nightingale depends on MySQL and Redis, so you need to install these environments beforehand. You can deploy them via Docker or by executing the commands as follows: ```bash theme={null} # Install Mysql yum -y install mariadb* systemctl enable mariadb systemctl restart mariadb mysql -e "SET PASSWORD FOR 'root'@'localhost' = PASSWORD('1234');" # Install Redis yum install -y redis systemctl enable redis systemctl restart redis ``` Here, Redis is set to no password. Additionally, the MySQL database password is specified as `1234`. **If you need to change to another password**, you need to configure it in the Nightingale configuration file to ensure Nightingale can connect to your database. Modify the Nightingale configuration file: ```json theme={null} vim /home/flashcat/etc/config.toml Modify the username and password under [DB]: [DB] # Postgres: Host=%s Port=%s User=%s Dbname=%s Password=%s Sslmode=%s # Postgres: DSN="host=127.0.0.1 Port=5432 User=root Dbname=n9e_v6 Password=1234 Sslmode=disable" # Sqlite: DSN="/path/to/filename.db" DSN = "{username}:{password}@tcp(127.0.0.1:3306)/n9e_v6?charset=utf8mb4&parseTime=True&loc=Local&allowNativePasswords=true" # Enable Debug Mode or Not ``` #### Import Database Tables Execute the following command: ```bash theme={null} mysql -uroot -p1234 < n9e.sql ``` Use a database tool to check if the database tables were successfully imported: ```text theme={null} > show databases; +--------------------+ | Database | +--------------------+ | n9e_v6 | +--------------------+ > show tables; +-----------------------+ | Tables_in_n9e_v6 | +-----------------------+ | alert_aggr_view | | alert_cur_event | | alert_his_event | | alert_mute | | alert_rule | | alert_subscribe | | alerting_engines | | board | | board_busigroup | | board_payload | | builtin_cate | | builtin_components | | builtin_metrics | ······ ``` #### Modify the Nightingale Configuration File You need to modify the Nightingale configuration file to set up the Prometheus data source: ```json theme={null} vim /home/flashcat/etc/config.toml # Modify the [[Pushgw.Writers]] Section to [[Pushgw.Writers]] # Url = "http://127.0.0.1:8480/insert/0/prometheus/api/v1/write" Url = "http://{client_ip}:9090/api/v1/write" ``` #### Start Nightingale In the root directory of Nightingale `/home/flashcat`, execute: `./n9e`. After a successful start, you can access it in your browser at `http://{client_ip}:17000`, with the default login username and password being: * Username: `root`yaml * Password: `root.2020`bash ![](https://mintcdn.com/automq/P6Ug3urJlyU1p2ee/automq/integrations/observability/flashcat/4.webp?fit=max\&auto=format\&n=P6Ug3urJlyU1p2ee\&q=85\&s=5d2c152f2952bf751eae98865454369c) #### Integrate Prometheus Data Source Left sidebar Integration -> Data Source -> Prometheus. ![At this point, Nightingale monitoring has been deployed.](https://mintcdn.com/automq/P6Ug3urJlyU1p2ee/automq/integrations/observability/flashcat/5.webp?fit=max\&auto=format\&n=P6Ug3urJlyU1p2ee\&q=85\&s=301efcc7c6996b309a551ad189001e7b) At this point, the Nightingale monitoring deployment is complete. ## Nightingale Monitoring AutoMQ Cluster Status Next, we will introduce some of the features provided by Nightingale monitoring to help you better understand the available features integrated with AutoMQ. ### Instant Query Select built-in AutoMQ metrics: ![You can try querying some data, like the average processing time for Fetch requests.](https://mintcdn.com/automq/P6Ug3urJlyU1p2ee/automq/integrations/observability/flashcat/6.webp?fit=max\&auto=format\&n=P6Ug3urJlyU1p2ee\&q=85\&s=ae3acf3fce414032de73932911af3c28) You can try querying some data, such as the average fetch request processing time `kafka_request_time_50p_milliseconds`: ![](https://mintcdn.com/automq/P6Ug3urJlyU1p2ee/automq/integrations/observability/flashcat/7.webp?fit=max\&auto=format\&n=P6Ug3urJlyU1p2ee\&q=85\&s=f3ba0d447eb4c7d9073c553d7b322fe5) ![Furthermore, you can customize some metrics and aggregate them with expressions:](https://mintcdn.com/automq/P6Ug3urJlyU1p2ee/automq/integrations/observability/flashcat/8.webp?fit=max\&auto=format\&n=P6Ug3urJlyU1p2ee\&q=85\&s=6160383ebe01605112e0bb23b6e323ac) Additionally, you can customize some metrics and use expressions to aggregate these metrics: ![](https://mintcdn.com/automq/P6Ug3urJlyU1p2ee/automq/integrations/observability/flashcat/9.webp?fit=max\&auto=format\&n=P6Ug3urJlyU1p2ee\&q=85\&s=e0a936151e91d2c219b0fa3a4891b0b7) ### Alerting Feature Select from the left sidebar Alerts -> Alert Rules -> Create New Rule. For example, you can set an alert for `kafka_network_io_bytes_total`, which measures the total number of bytes sent or received by Kafka Broker nodes over the network. By setting an expression for this metric, you can calculate the inbound network I/O rate for Kafka Broker nodes. The expression is: ```text theme={null} sum by(job, instance) (rate(kafka_network_io_bytes_total{direction="in"}[1m])) ``` Setting Alert Rules: ![Data preview: ](https://mintcdn.com/automq/P6Ug3urJlyU1p2ee/automq/integrations/observability/flashcat/10.webp?fit=max\&auto=format\&n=P6Ug3urJlyU1p2ee\&q=85\&s=f4ea08394df1f00d5081525743865f4e) Data preview: ![You can also configure groups to receive notifications when an alert is triggered.](https://mintcdn.com/automq/P6Ug3urJlyU1p2ee/automq/integrations/observability/flashcat/11.webp?fit=max\&auto=format\&n=P6Ug3urJlyU1p2ee\&q=85\&s=a8d8c2aba6ae617695400e11e6be2bc5) You can also configure groups to be notified when an alert occurs: ![After setting up an alert,](https://mintcdn.com/automq/P6Ug3urJlyU1p2ee/automq/integrations/observability/flashcat/12.webp?fit=max\&auto=format\&n=P6Ug3urJlyU1p2ee\&q=85\&s=34518ee28063a27374245107394a248a) After creating the alert, you can simulate a high-concurrency message processing scenario: a total of `2500000` messages are sent to AutoMQ nodes within a short period. The method used is sending messages through the Kafka SDK, with a total of 50 Topics, each Topic receiving 500 messages, repeated 100 times. An example is as follows: ```bash theme={null} import org.apache.kafka.clients.admin.AdminClient; import org.apache.kafka.clients.admin.AdminClientConfig; import org.apache.kafka.clients.admin.NewTopic; import org.apache.kafka.clients.producer.KafkaProducer; import org.apache.kafka.clients.producer.ProducerConfig; import org.apache.kafka.clients.producer.ProducerRecord; import org.apache.kafka.clients.producer.RecordMetadata; import org.apache.kafka.common.serialization.StringSerializer; import java.util.ArrayList; import java.util.List; import java.util.Properties; import java.util.concurrent.ExecutionException; public class KafkaTest { private static final String BOOTSTRAP_SERVERS = "http://{}:9092"; // your automq broker ip private static final int NUM_TOPICS = 50; private static final int NUM_MESSAGES = 500; public static void main(String[] args) throws Exception { KafkaTest test = new KafkaTest(); // test.createTopics(); // create 50 topics for(int i = 0; i < 100; i++){ test.sendMessages(); // 25,000 messages will be sent each time, and 500 messages will be sent to each of 50 topics. } } public void createTopics() { Properties props = new Properties(); props.put(AdminClientConfig.BOOTSTRAP_SERVERS_CONFIG, BOOTSTRAP_SERVERS); try (AdminClient adminClient = AdminClient.create(props)) { List topics = new ArrayList<>(); for (int i = 1; i <= NUM_TOPICS; i++) { topics.add(new NewTopic("Topic-" + i, 1, (short) 1)); } adminClient.createTopics(topics).all().get(); System.out.println("Topics created successfully"); } catch (InterruptedException | ExecutionException e) { e.printStackTrace(); } } public void sendMessages() { Properties props = new Properties(); props.put(ProducerConfig.BOOTSTRAP_SERVERS_CONFIG, BOOTSTRAP_SERVERS); props.put(ProducerConfig.KEY_SERIALIZER_CLASS_CONFIG, StringSerializer.class.getName()); props.put(ProducerConfig.VALUE_SERIALIZER_CLASS_CONFIG, StringSerializer.class.getName()); try (KafkaProducer producer = new KafkaProducer<>(props)) { for (int i = 1; i <= NUM_TOPICS; i++) { String topic = "Topic-" + i; for (int j = 1; j <= NUM_MESSAGES; j++) { String key = "key-" + j; String value = "{\"userId\": " + j + ", \"action\": \"visit\", \"timestamp\": " + System.currentTimeMillis() + "}"; ProducerRecord record = new ProducerRecord<>(topic, key, value); producer.send(record, (RecordMetadata metadata, Exception exception) -> { if (exception == null) { System.out.printf("Sent message to topic %s partition %d with offset %d%n", metadata.topic(), metadata.partition(), metadata.offset()); } else { exception.printStackTrace(); } }); } } System.out.println("Messages sent successfully"); } } } ``` You can then see the alarm information in the Nightingale console: ![Alert Details:](https://mintcdn.com/automq/P6Ug3urJlyU1p2ee/automq/integrations/observability/flashcat/13.webp?fit=max\&auto=format\&n=P6Ug3urJlyU1p2ee\&q=85\&s=11936a8e461a05412aa3d6cff8ae68ba) Alert Details: ![](https://mintcdn.com/automq/P6Ug3urJlyU1p2ee/automq/integrations/observability/flashcat/14.webp?fit=max\&auto=format\&n=P6Ug3urJlyU1p2ee\&q=85\&s=f8a222b4e3bcb55bff1b2a3b2a3249e6) ### Dashboard First, you can use the known metrics to create your own dashboard. Below is an example of a statistical dashboard for AutoMQ message request processing time, total message count, and network IO bits: ![Additionally, you can use the built-in official dashboard for monitoring. Left sidebar -> Aggregation -> Template Center:](https://mintcdn.com/automq/bAg_OT9sHANf_LMr/automq/integrations/observability/flashcat/15.png?fit=max\&auto=format\&n=bAg_OT9sHANf_LMr\&q=85\&s=77a01226c27855d38cff4c96b497ee6b) Additionally, you can use the built-in dashboards provided by the official source. Left sidebar -> Aggregate -> Template Center: ![Select AutoMQ, and you'll see several Dashboard options available:](https://mintcdn.com/automq/P6Ug3urJlyU1p2ee/automq/integrations/observability/flashcat/16.webp?fit=max\&auto=format\&n=P6Ug3urJlyU1p2ee\&q=85\&s=e9ce21909d70c39628d737059b426f1b) Choosing AutoMQ, you will see several DashBoards available: ![Select the Topic Metrics dashboard, and the displayed content is shown below:](https://mintcdn.com/automq/P6Ug3urJlyU1p2ee/automq/integrations/observability/flashcat/17.webp?fit=max\&auto=format\&n=P6Ug3urJlyU1p2ee\&q=85\&s=dfabdf6fc5ddbbba745e2ea446b8a5c2) Select the Topic Metrics dashboard, and the content is displayed as follows: ![This showcases the message input and output utilization, input and request rates, message size, and additional metrics for the AutoMQ cluster over a recent period. These metrics are crucial for monitoring and optimizing the performance and stability of the AutoMQ cluster: By analyzing message input and output utilization, you can assess the load on producers and consumers, ensuring the cluster can handle message traffic effectively; the input rate helps monitor the rate at which producers send messages in real-time, thus identifying any potential bottlenecks or traffic surges; request rates help understand the frequency of client requests, optimizing resource allocation and processing capacity; the message size metric allows for analysis of the average message size, enabling configuration adjustments to enhance storage and network transmission efficiency. By monitoring these metrics, you can quickly detect and resolve performance issues, ensuring the efficient and stable operation of the AutoMQ cluster.](https://mintcdn.com/automq/P6Ug3urJlyU1p2ee/automq/integrations/observability/flashcat/18.webp?fit=max\&auto=format\&n=P6Ug3urJlyU1p2ee\&q=85\&s=b2a7793a98c40f7fbe6ffc6532308700) This dashboard shows the message input and output utilization, message input and request rates, and message sizes of the AutoMQ cluster over a recent period. These metrics are used to monitor and optimize the performance and stability of the AutoMQ cluster: By assessing the message input and output utilization, you can evaluate the load on producers and consumers, ensuring the cluster can handle the message flow properly. The message input rate is used for real-time monitoring of the rate at which producers send messages, identifying potential bottlenecks or sudden spikes in traffic. The request rate helps understand the frequency of client requests, optimizing resource allocation and processing capabilities. The message size metric analyzes the average size of messages to adjust configurations for optimizing storage and network transmission efficiency. Monitoring these metrics allows you to detect and resolve performance issues promptly, ensuring the efficient and stable operation of the AutoMQ cluster. The integration process of FlashCat is now complete. For additional usage options, please refer to Nightingale's [official documentation](https://flashcat.cloud/docs/content/flashcat-monitor/nightingale-v7/overview/) \[7] to explore and experience further. ## Summary This article elaborates on how to comprehensively monitor an AutoMQ cluster using the Nightingale monitoring system. Starting with the basic concepts of AutoMQ and Nightingale, it gradually explains how to deploy AutoMQ, Prometheus, and Nightingale, and configure monitoring and alarm rules. Through this integration, enterprises can monitor the operational status of the AutoMQ cluster in real-time, promptly identify and resolve potential issues, optimize system performance, and ensure business continuity and stability. The Nightingale monitoring system, with its powerful data collection capabilities, flexible alerting mechanisms, and rich visualization features, becomes an ideal choice for enterprises to monitor complex distributed systems. We hope this article provides valuable reference for your practical application, helping to make your system operations more efficient and stable. ## References \[1] AutoMQ: [https://www.automq.com/](https://www.automq.com/) \[2] Nightingale Monitoring: [https://flashcat.cloud/docs/content/flashcat-monitor/nightingale-v7/introduction/](https://flashcat.cloud/docs/content/flashcat-monitor/nightingale-v7/introduction/) \[3] Nightingale Architecture: [https://flashcat.cloud/docs/content/flashcat-monitor/nightingale-v7/introduction/](https://flashcat.cloud/docs/content/flashcat-monitor/nightingale-v7/introduction/) \[4] Prometheus: [https://prometheus.io/docs/prometheus/latest/getting\_started/](https://prometheus.io/docs/prometheus/latest/getting_started/) \[5] Deployment Instructions: [https://flashcat.cloud/docs/content/flashcat-monitor/nightingale-v7/install/intro/](https://flashcat.cloud/docs/content/flashcat-monitor/nightingale-v7/install/intro/) \[6] Nightingale GitHub releases: [https://github.com/ccfos/nightingale](https://github.com/ccfos/nightingale) \[7] Nightingale Official Documentation: [https://flashcat.cloud/docs/content/flashcat-monitor/nightingale-v7/overview/](https://flashcat.cloud/docs/content/flashcat-monitor/nightingale-v7/overview/) # Guance Cloud Source: https://docs.automq.com/automq/integrations/observability/guance-cloud AutoMQ offers Kafka compatibility, cloud-native scalability, and cost efficiency, enabling automatic fault recovery and high availability without human intervention. ## Preface ### Guance Cloud [Observing Cloud](https://docs.guance.com/product-introduction/) \[1] is a unified real-time monitoring application designed for cloud platforms, cloud-native environments, applications, and business-related needs. It integrates three major signals: metrics, logs, and tracing, covering testing, prerelease, and production environments to achieve observability throughout the software development lifecycle. Through Observing Cloud, enterprises can build complete application full-link observability, enhancing the overall transparency and controllability of the IT architecture. As a powerful data analytics platform, Guance Cloud includes several core modules, such as DataKit \[2], a unified data collector, and the DataFlux Func data processing development platform. ![Data Flow Observability](https://mintcdn.com/automq/P6Ug3urJlyU1p2ee/automq/integrations/observability/guance-cloud/1.webp?fit=max\&auto=format\&n=P6Ug3urJlyU1p2ee\&q=85\&s=449a8577128e983fa31ee5ed3565397c) ### AutoMQ [AutoMQ](https://www.automq.com/zh) \[3] is a new generation of Apache Kafka® distribution redesigned based on cloud-native concepts. It offers cloud-native scalability and cost-efficient resource usage while remaining 100% compatible with the Apache Kafka protocol. AutoMQ stores data entirely on S3, allowing for rapid response to sudden traffic spikes without the need for data replication during cluster expansion. In contrast, Apache Kafka requires significant bandwidth for partition data replication after scaling, making it difficult to handle sudden traffic. AutoMQ achieves high system autonomy through features like automatic scaling, self-balancing, and automatic fault recovery, achieving higher availability without human intervention. AutoMQ's shared storage architecture: ![](https://mintcdn.com/automq/HSGTYilF9PkMVbaa/automq/integrations/observability/guance-cloud/2.gif?s=69c27b7b999f0be6a1530d49b14e90d8) ## Observability Interfaces of AutoMQ Due to AutoMQ's full compatibility with Kafka and support for open Prometheus-based metrics collection ports, the data collection tool DataKit provided by Observing Cloud can be integrated with the Observing Cloud platform. This facilitates users to monitor and manage the state of AutoMQ clusters. Additionally, the Observing Cloud platform supports user-defined aggregation and querying of metrics data. By using predefined dashboard templates or custom dashboards, various statistics of the AutoMQ cluster, such as common topics, brokers, partitions, and group statistics, can be effectively summarized. Furthermore, based on metrics observability data, it is also possible to query error conditions encountered during the operation of the AutoMQ cluster and various utilization metrics of the current system, such as JVM CPU usage, JVM heap usage, and cache size. These metrics can help quickly identify and resolve issues when anomalies occur in the cluster, which is very beneficial for high availability and rapid recovery of the system. Next, this article will introduce how to use the Observing Cloud platform to monitor the state of the AutoMQ cluster. ## Steps to Integrate with Observation Cloud ### Enable Metric Fetching Interface in AutoMQ Refer to the AutoMQ documentation: [Deploy Multi-Nodes Cluster on Linux▸](/automq/deployment/deploy-multi-nodes-cluster-on-linux) Before starting the deployment, add the following configuration parameters to enable Prometheus pull interfaces. After starting the AutoMQ cluster with these parameters, each node will further expose an HTTP interface for pulling AutoMQ monitoring metrics. The format of these metrics follows the Prometheus Metrics format. ```bash theme={null} bin/kafka-server-start.sh ...\ --override s3.telemetry.metrics.exporter.type=prometheus \ --override s3.metrics.exporter.prom.host=0.0.0.0 \ --override s3.metrics.exporter.prom.port=8890 \ .... ``` Once AutoMQ monitoring metrics are enabled, the Prometheus format monitoring metrics can be pulled via the HTTP protocol on any node. The address is: `http://{node_ip}:8890`. An example of the response is as follows: ```text theme={null} .... kafka_request_time_mean_milliseconds{otel_scope_name="io.opentelemetry.jmx",type="DescribeDelegationToken"} 0.0 1720520709290 kafka_request_time_mean_milliseconds{otel_scope_name="io.opentelemetry.jmx",type="CreatePartitions"} 0.0 1720520709290 ... ``` For an introduction to metrics, refer to the AutoMQ official documentation: [Prometheus Metrics▸](/automq/observability/integrating-metrics-with-prometheus/prometheus-metrics). ### Install and Configure DataKit Collection Tool DataKit is an open-source monitoring collection tool provided by Observing Cloud that supports Prometheus metrics scraping. You can use DataKit to pull monitoring data from AutoMQ and aggregate it to the Observing Cloud platform. #### Install the DataKit Tool > Tips: For more details on DataKit installation, refer to the documentation: [Host Installation - Guance Documentation](https://docs.guance.com/datakit/datakit-install/) \[6]. First, register for a Guance account and log in. Then, in the main interface, click "Integration" on the left side and select "DataKit" at the top to see the DataKit installation command. ```bash theme={null} DK_DATAWAY="https://openway.guance.com?token=" bash -c "$(curl -L https://static.guance.com/datakit/install.sh)" ``` Copy the above command and run it on all nodes in the cluster to complete the DataKit installation. > Tips: DataKit needs to be installed on all Brokers in the cluster that need to be monitored. After successfully executing the installation command, use the command `datakit monitor` to verify if DataKit is successfully installed. ![](https://mintcdn.com/automq/P6Ug3urJlyU1p2ee/automq/integrations/observability/guance-cloud/3.webp?fit=max\&auto=format\&n=P6Ug3urJlyU1p2ee\&q=85\&s=961be07d79d556ed664d5c6ff5908457) #### AutoMQ Collector Configuration and Activation Here, you need to configure the DataKit AutoMQ collector on the server of each node where data is to be collected. Enter the directory `/usr/local/datakit/conf.d/prom` and create a collector configuration file `prom.conf`. The collector configuration will include the open observable data interfaces, collector name, prom instance name, and important collection interval, etc. You can make some adjustments to the configuration on each server as needed: ```bash theme={null} [[inputs.prom]] urls = ["http://clientIP:8890/metrics"] # ClientIP Should Be Your Own Server Address. source = "AutoMQ" ## Keep Exist Metric Name ## If the Keep_exist_metric_name Is True, Keep the Raw Value for Field Names. keep_exist_metric_name = true [inputs.prom.tags_rename] overwrite_exist_tags = true [inputs.prom.tags_rename.mapping] service_name = "job" service_instance_id = "instance" [inputs.prom.tags] component="AutoMQ" interval = "10s" ``` Parameter Adjustment Instructions: | urls | AutoMQ metrics address, provide the corresponding metrics URL exposed by the component here | | - | - | | source | Collector alias, it is recommended to distinguish it | | interval | Collection interval, specifies the interval at which the collector collects data | Execute `datakit service -R` to restart the DataKit on that node to activate the collector configuration. ## Monitor AutoMQ Clusters Via GUI-Based Management The monitoring platform has integrated AutoMQ and provides multiple default dashboards. You can view the [Dashboard Examples](https://console.guance.com/scene/dashboard/createDashboard?w=wksp_63b96920660e4962a07429b65ef163e7\&lak=Scene)\[7]. Below are examples of several commonly used templates, and we will introduce their functions: ### Cluster Monitoring The main display shows the number of currently active Brokers, the total number of Topics, Partitions, etc. Additionally, you can specify which node to query specifically by selecting in the Cluster\_id. ![By monitoring the status of the Kafka cluster, potential issues such as node failures, insufficient disk space, and network latency can be quickly identified and resolved to ensure a more controllable and stable system.](https://mintcdn.com/automq/P6Ug3urJlyU1p2ee/automq/integrations/observability/guance-cloud/4.webp?fit=max\&auto=format\&n=P6Ug3urJlyU1p2ee\&q=85\&s=a7d153dae67430227fddaaaeac2de065) By monitoring the status of the Kafka cluster, potential issues such as node failures, insufficient disk space, network delays, etc., can be detected and resolved promptly to ensure a more controllable and stable system. ### Broker Monitoring The cloud observability `AutoMQ Broker` dashboard describes several metrics of all Brokers, such as the number of connections, partitions, the number of messages received per second (ops), and the amount of data input and output per second, measured in Bytes. ![](https://mintcdn.com/automq/P6Ug3urJlyU1p2ee/automq/integrations/observability/guance-cloud/5.webp?fit=max\&auto=format\&n=P6Ug3urJlyU1p2ee\&q=85\&s=5ea1791ffce557f2d8c76a50fa0cf830) ### Topic Monitoring This section provides an overview of all the Topics contained within all nodes. As previously mentioned, you can also specify a node to query the Topic information. These metrics primarily include the space occupied by each Topic, the number of messages received, and Request Throughput, which indicates the ability to process requests per unit of time. ![Currently, the state of the AutoMQ cluster is successfully monitored through Observability Cloud, with dashboard data obtained via aggregation or query of metrics indicators.](https://mintcdn.com/automq/P6Ug3urJlyU1p2ee/automq/integrations/observability/guance-cloud/6.webp?fit=max\&auto=format\&n=P6Ug3urJlyU1p2ee\&q=85\&s=4e85e3ff07533d63ffadde6b35967018) At this point, the cloud observability has successfully monitored the AutoMQ cluster status, and the data in the dashboard is obtained by aggregating or querying the Metrics indicators. ## Summary This article introduced how to integrate the cloud observability platform with AutoMQ to monitor the status information of the AutoMQ cluster. There are actually more advanced operations, such as custom alert functions, custom data queries, etc., which can be done DIY according to the rules provided officially. You can experiment with these operations manually, and you will find the ones that suit your needs. ## References \[1] Cloud Observability: [https://docs.guance.com/product-introduction/](https://docs.guance.com/product-introduction/) \[2] DataKit: [https://docs.guance.com/datakit/](https://docs.guance.com/datakit/) \[3] AutoMQ: [https://www.automq.com](https://www.automq.com) \[4] Host Installation - Observability Cloud Documentation: [https://docs.guance.com/datakit/datakit-install/](https://docs.guance.com/datakit/datakit-install/) \[5] Dashboard Example: [https://console.guance.com/scene/dashboard/createDashboard?w=wksp\_63b96920660e4962a07429b65ef163e7\&lak=Scene](https://console.guance.com/scene/dashboard/createDashboard?w=wksp_63b96920660e4962a07429b65ef163e7\&lak=Scene) # Prometheus/VictoriaMetrics Source: https://docs.automq.com/automq/integrations/observability/prometheus Optimize AutoMQ clusters with Prometheus and VictoriaMetrics for cloud-native scalability, Kafka compatibility, and reduced storage costs. ## Introduction Monitoring your AutoMQ cluster helps you detect issues early and optimize performance. This guide shows how to integrate Prometheus \[2] and VictoriaMetrics \[3] to collect, store, and query AutoMQ metrics. ### AutoMQ Overview AutoMQ is a Kafka-compatible streaming platform \[1]. See [Overview](/automq/what-is-automq) for details. ![](https://mintcdn.com/automq/HSGTYilF9PkMVbaa/automq/integrations/observability/prometheus/1.gif?s=b169b35f176be2d1cd58a3df3893d7fa) ### Prometheus Overview Prometheus is an open-source system monitoring and alerting toolkit initially developed by SoundCloud and released as open source in 2012. It offers robust data collection, storage, and querying capabilities, enabling real-time monitoring of system and application performance metrics. Prometheus utilizes a multidimensional data model that uses labels to tag and query monitoring data, and it supports the flexible query language PromQL. The primary advantages of Prometheus include efficient data collection, strong query functionality, and a rich alerting mechanism, making it widely used in the cloud-native ecosystem. However, Prometheus has certain limitations in large-scale data storage, particularly when it comes to long-term storage and high-concurrency querying. Its storage performance and query efficiency may be affected. Consequently, integrating an efficient storage backend becomes essential to address these challenges. ### VictoriaMetrics Overview VictoriaMetrics is a high-performance, open-source time-series database designed for high-concurrency data writing and querying. It features efficient data compression and storage capabilities, offering high throughput for data writes and queries with minimal hardware resource consumption. VictoriaMetrics supports Prometheus' remote storage interface, allowing seamless integration into existing Prometheus monitoring systems. Below is an architecture diagram of VictoriaMetrics: ![VictoriaMetrics Structure \[4\]](https://mintcdn.com/automq/P6Ug3urJlyU1p2ee/automq/integrations/observability/prometheus/2.webp?fit=max\&auto=format\&n=P6Ug3urJlyU1p2ee\&q=85\&s=64fb0249db4f14676f651c8a70608743) By utilizing VictoriaMetrics as the storage backend for Prometheus, organizations can significantly improve the storage and query performance of their monitoring systems, fulfilling the requirements for large-scale data storage and high-concurrency queries. The primary advantages of VictoriaMetrics include efficient data compression, rapid data querying, and low resource consumption, making it an excellent option as a storage backend for Prometheus. Below, I will proceed with the deployment of AutoMQ, Prometheus, and VictoriaMetrics. ## Prerequisites * Deploy a functional AutoMQ node/cluster and open the Metrics collection port * Deploy VictoriaMetrics as the storage backend for Prometheus * Deploy Prometheus to retrieve Metrics data ## Deploying AutoMQ, VictoriaMetrics, Prometheus ### Deploying AutoMQ Refer to the AutoMQ documentation: [Deploy Multi-Nodes Cluster on Linux▸](/automq/deployment/deploy-multi-nodes-cluster-on-linux). Before starting deployment, add the following configuration parameters to enable Prometheus's pull interface. Once the AutoMQ cluster is launched with these parameters, each node will additionally open an HTTP interface for retrieving AutoMQ monitoring metrics. These metrics comply with the Prometheus Metrics format. ```bash theme={null} bin/kafka-server-start.sh ...\ --override s3.telemetry.metrics.exporter.type=prometheus \ --override s3.metrics.exporter.prom.host=0.0.0.0 \ --override s3.metrics.exporter.prom.port=8890 \ .... ``` With AutoMQ monitoring metrics enabled, you can access Prometheus format monitoring metrics from any node via HTTP at the address: `http://{node_ip}:8890`, with the response example as follows: ```text theme={null} .... kafka_request_time_mean_milliseconds{otel_scope_name="io.opentelemetry.jmx",type="DescribeDelegationToken"} 0.0 1720520709290 kafka_request_time_mean_milliseconds{otel_scope_name="io.opentelemetry.jmx",type="CreatePartitions"} 0.0 1720520709290 ... ``` For a detailed introduction to the metrics, refer to the AutoMQ official documentation: [Prometheus Metrics▸](/automq/observability/prometheus-metrics). ### Deploying VictoriaMetrics Reference documentation: [VictoriaMetrics](https://docs.victoriametrics.com/?_gl=1*196n44l*_ga*NjU0MDAxODA2LjE3MjE3OTA1NTM.*_ga_N9SVT8S3HK*MTcyMTc5MDU1Mi4xLjAuMTcyMTc5MDU1Mi42MC4wLjA.) \[7]. VictoriaMetrics supports deployments via binary versions, Docker images, and source code. Here, we choose to deploy via Docker. Execute the following command to start the VictoriaMetrics container and map the data files to the folder `/home/VictoriaMetrics/data` for easy monitoring of data import changes: ```bash theme={null} # Create a New Data Folder sudo mkdir -p /home/VictoriaMetrics/data # Docker Start Command, Mount the Data Folder docker run -d --name victoria-metrics \ -p 8428:8428 \ -v /home/VictoriaMetrics/data:/victoria-metrics-data \ victoriametrics/victoria-metrics ``` Verify a successful installation by accessing: `http://{client_ip}:8428` in a browser. ### Deploying Prometheus Prometheus can be deployed by downloading the binary package or using Docker. Below is an introduction to both deployment methods. #### **Binary Deployment** For ease of use, you can create a new script and modify the Prometheus download version as needed. After creating the script, execute it to complete the deployment. First, create a new script: ```bash theme={null} cd /home vim install_prometheus.sh # !!! Paste the Script Content Below, Save, and Exit # Grant Permissions chmod +x install_prometheus.sh # Execute Script ./install_prometheus.sh ``` The content of the script is as follows: ```bash theme={null} version=2.45.3 filename=prometheus-${version}.linux-amd64 mkdir -p /opt/prometheus wget https://github.com/prometheus/prometheus/releases/download/v${version}/${filename}.tar.gz tar xf ${filename}.tar.gz cp -far ${filename}/* /opt/prometheus/ # Config as a Service cat </etc/systemd/system/prometheus.service [Unit] Description="prometheus" Documentation=https://prometheus.io/ After=network.target [Service] Type=simple ExecStart=/opt/prometheus/prometheus --config.file=/opt/prometheus/prometheus.yml --storage.tsdb.path=/opt/prometheus/data --web.enable-lifecycle --web.enable-remote-write-receiver Restart=on-failure SuccessExitStatus=0 LimitNOFILE=65536 StandardOutput=syslog StandardError=syslog SyslogIdentifier=prometheus [Install] WantedBy=multi-user.target EOF systemctl enable prometheus systemctl restart prometheus systemctl status prometheus ``` Next, modify Prometheus's configuration file, **add the task to collect AutoMQ observable data**, and **restart** Prometheus. Execute the command: ```bash theme={null} # Fill in the Following for the Configuration File Content: vim /opt/prometheus/prometheus.yml # Restart Prometheus systemctl restart prometheus ``` **The configuration file reference is as follows:** Please change the `client_ip` to the address exposed by AutoMQ for observable data. ```yaml theme={null} # My Global Config global: scrape_interval: 15s # Set the Scrape Interval to Every 15 Seconds. Default Is Every 1 Minute. evaluation_interval: 15s # Evaluate Rules Every 15 Seconds. the Default Is Every 1 Minute. scrape_configs: # The Job Name Is Added as a Label `job=` to Any Timeseries Scraped from This Config. - job_name: "prometheus" static_configs: - targets: ["localhost:9090"] - job_name: "automq" static_configs: - targets: ["{client_ip}:8890"] # Config VictoriaMetrics IO Port remote_write: - url: "http://{client_ip}:8428/api/v1/write" remote_read: - url: "http://{client_ip}:8428/api/v1/read" ``` After deployment, you can access Prometheus via a browser to verify if the Metrics data from AutoMQ has been successfully collected. Visit `http://{client_ip}:9090/targets`. ![](https://mintcdn.com/automq/P6Ug3urJlyU1p2ee/automq/integrations/observability/prometheus/4.webp?fit=max\&auto=format\&n=P6Ug3urJlyU1p2ee\&q=85\&s=4b4b859f4f14c235733e9cbe77b81e87) #### Docker Deployment If you have a running Prometheus Docker container, execute the command to remove the container first: ```bash theme={null} docker stop prometheus docker rm prometheus ``` Create a new configuration file and attach it when launching Docker: ```bash theme={null} mkdir -p /opt/prometheus vim /opt/prometheus/prometheus.yml # Use the Configuration Details Provided in the Previous "Binary Deployment" Section. ``` Launch the Docker container: ```bash theme={null} docker run -d \ --name=prometheus \ -p 9090:9090 \ -v /opt/prometheus/prometheus.yml:/etc/prometheus/prometheus.yml \ -m 500m \ prom/prometheus \ --config.file=/etc/prometheus/prometheus.yml \ --enable-feature=otlp-write-receiver \ --web.enable-remote-write-receiver ``` This sets up a Prometheus service to collect AutoMQ Metrics. For further details on integrating AutoMQ Metrics with Prometheus, please visit: [Integrating Metrics into Prometheus | AutoMQ](/automq/observability/overview) \[8]. ## Check the Integration Results. ### VictoriaMetrics Data Verification VictoriaMetrics offers a Dashboard accessible via `http://{client_ip}:8428/vmui`, where the initial display is: ![Data file verification. Existing data files are identified in the data directory:](https://mintcdn.com/automq/P6Ug3urJlyU1p2ee/automq/integrations/observability/prometheus/5.webp?fit=max\&auto=format\&n=P6Ug3urJlyU1p2ee\&q=85\&s=dd29e8e681d594b48c033233e5569df4) Data file verification. Existing data files are identified in the data directory: ```bash theme={null} root@debian: ls /home/VictoriaMetrics/data/small/2024_07/ 17E5088F4DC9C068 17E5088F4DC9C073 17E5088F4DC9C0B3 17E509EE0189D399 17E509EE0189D39C 17E509EE0189D39F 17E509EE0189D3A2 17E509EE0189D3A5 17E5088F4DC9C06A 17E5088F4DC9C075 17E509EE0189D38D 17E509EE0189D39A 17E509EE0189D39D 17E509EE0189D3A0 17E509EE0189D3A3 17E509EE0189D3A6 17E5088F4DC9C071 17E5088F4DC9C07B 17E509EE0189D398 17E509EE0189D39B 17E509EE0189D39E 17E509EE0189D3A1 17E509EE0189D3A4 parts.json ``` By accessing the status at `http://{client_ip}:8428/api/v1/status/tsdb`, you can obtain a JSON file: ```json theme={null} "status": "success", "data": { "totalSeries": 3125, "totalLabelValuePairs": 15564, "seriesCountByMetricName": [ { "name": "prometheus_http_request_duration_seconds_bucket", "value": 150 }, { "name": "prometheus_http_response_size_bytes_bucket", "value": 135 }, { "name": "kafka_request_queue_time_50p_milliseconds", "value": 90 }, ............... ``` ### Grafana Dashboard (Optional) Since we have used VictoriaMetrics as Prometheus storage, we can configure it as a data source for Grafana at `http://{client_ip}:8428`, to access the status information of the AutoMQ cluster. For Grafana template files, you can refer to the official AutoMQ templates: [grafana](https://github.com/AutoMQ/automq/tree/main/docker/telemetry/grafana/provisioning/dashboards) \[9]. The final demonstration output is as follows: **Cluster Overview:** Provides cluster-level monitoring information, including metrics like the number of nodes, data size, and cluster traffic. Additionally, it offers an overview of dimensions such as Topic, Group, and Broker, with support for drill-down functionality to examine detailed monitoring information. ![With this, our integration process concludes; more features to explore can be referenced at VictoriaMetrics ](https://mintcdn.com/automq/P6Ug3urJlyU1p2ee/automq/integrations/observability/prometheus/6.webp?fit=max\&auto=format\&n=P6Ug3urJlyU1p2ee\&q=85\&s=c9e345d4e0ec045dee85da5417e43446) With this, our integration process concludes; further features to explore can be found in the VictoriaMetrics [official documentation](https://docs.victoriametrics.com/?_gl=1*196n44l*_ga*NjU0MDAxODA2LjE3MjE3OTA1NTM.*_ga_N9SVT8S3HK*MTcyMTc5MDU1Mi4xLjAuMTcyMTc5MDU1Mi42MC4wLjA.) \[10]. ## **Summary** In this article, we have thoroughly examined how to integrate AutoMQ, Prometheus, and VictoriaMetrics to enable comprehensive monitoring of AutoMQ clusters. We began by introducing the functions and advantages of each component, explaining why Prometheus was chosen as the monitoring system and why VictoriaMetrics is essential as the storage backend for Prometheus. Next, we offered step-by-step guidance on deploying and configuring AutoMQ, VictoriaMetrics, and Prometheus, and confirmed the effectiveness of this integration. With this integration approach, enterprises can gain the following benefits: 1. Efficient data collection and storage: Prometheus handles efficient data collection, while VictoriaMetrics provides efficient data storage and compression capabilities, ensuring that the system can store large-scale time-series data with minimal hardware resource consumption. 2. Fast data querying: VictoriaMetrics offers rapid data query performance to meet high concurrent query demands, ensuring efficient queries in scenarios involving large-scale data storage. 3. Prometheus Integration: VictoriaMetrics supports Prometheus' remote storage interface, enabling smooth integration with existing Prometheus monitoring systems and enhancing the overall performance and stability of such systems. Through this integration, enterprises can achieve comprehensive monitoring of AutoMQ clusters, ensuring high availability and performance optimization, promptly detecting and addressing potential issues, optimizing system performance, and ensuring business continuity and stability. Looking ahead, as business demands evolve and technology advances, we can further explore and refine monitoring solutions to address more complex application scenarios and higher performance requirements efficiently. ## References \[1] AutoMQ: [https://www.automq.com/zh](https://www.automq.com/zh) \[2] Prometheus: [https://prometheus.io/docs/prometheus/latest/getting\_started/](https://prometheus.io/docs/prometheus/latest/getting_started/) \[3] VictoriaMetrics: [https://docs.victoriametrics.com/](https://docs.victoriametrics.com/) \[4] VictoriaMetrics Structure: [https://docs.victoriametrics.com/cluster-victoriametrics/](https://docs.victoriametrics.com/cluster-victoriametrics/) \[5] Cluster Deployment | AutoMQ: [https://docs.automq.com/automq/getting-started/deploy-multi-nodes-test-cluster-on-docker](https://docs.automq.com/automq/getting-started/deploy-multi-nodes-test-cluster-on-docker) \[6] Metrics | AutoMQ: [https://docs.automq.com/automq/observability/overview](https://docs.automq.com/automq/observability/overview) \[7] VictoriaMetrics Installation Documentation: [https://docs.victoriametrics.com/](https://docs.victoriametrics.com/) \[8] Integrating Metrics with Prometheus: [https://docs.automq.com/automq/observability/overview](https://docs.automq.com/automq/observability/overview) \[9] grafana: [https://github.com/AutoMQ/automq/tree/main/docker/telemetry/grafana/provisioning/dashboards](https://github.com/AutoMQ/automq/tree/main/docker/telemetry/grafana/provisioning/dashboards) \[10] VictoriaMetrics Official Documentation: [https://docs.victoriametrics.com/](https://docs.victoriametrics.com/) # RustFS Source: https://docs.automq.com/automq/integrations/storage/rustfs AutoMQ partners with RustFS to provide a scalable, cost-efficient Kafka-compatible cloud service. Leverage cloud-native benefits with superior performance and licensing ease. ## Preface Enterprises' thirst for real-time data is driving significant shifts in data architecture. However, building efficient data streaming platforms faces two major bottlenecks: the severe cost and operational challenges of traditional Apache Kafka in cloud environments, and the architectural complexity or restrictive AGPL licensing of existing object storage solutions. These hurdles create significant barriers to cost-effective, scalable, and commercially viable real-time data processing. To address these challenges, AutoMQ and RustFS have formed a strategic partnership. This collaboration deeply integrates AutoMQ's cloud-native, 100% Kafka-compatible stream processing with RustFS, a high-performance, Apache 2.0 licensed distributed object storage. By combining these two technologies, enterprises gain access to a next-generation Diskless Kafka platform that delivers a superior architecture, lower TCO, and complete avoidance of licensing risks. ## **Hands-On Guide: Deploying AutoMQ with RustFS in 4 Steps** ### Precondition Before starting, make sure you have Docker and Docker Compose installed and running on your system. This guide uses Docker Compose to deploy a decoupled AutoMQ and RustFS stack. We'll solve the two main challenges: service startup dependency and automatic S3 bucket initialization. ### Deployment Instructions With the precondition met, we'll now build the stack. This process is broken down into the key phases of the deployment: first, defining all services in the complete docker-compose.yaml, then analyzing how they're orchestrated, and finally, validating the end-to-end data flow. 1. **The S3 Backend-RustFS:** This service acts as our S3-compatible storage. * `healthcheck` **:** This block is crucial. It tells Docker not to just assume the service is "on," but to actively check its /health endpoint. Only when this check passes is the service considered "ready" to handle S3 requests. 2. **The Bucket Initializer-mc-init:** This is a small utility container whose only job is to create our S3 buckets. * `depends_on: service_healthy` **:** This line is the key to our automation. It explicitly tells Docker Compose: "Do not *even start* this mc-init container until the rustfs service's healthcheck is passing." This prevents errors where the script tries to create buckets on a service that isn't ready. 3. **The AutoMQ Service-server1:** This is the main Kafka broker service. * `depends_on` **:** This service depends on *both* rustfs and mc-init being Up. This guarantees that when AutoMQ starts, the S3 backend is ready *and* the mc-init script has already finished creating the required buckets. * `Endpoint Override` **:** The command block's --override flags (e.g., endpoint=[http://rustfs:9000](http://rustfs:9000)) are critical. They redirect AutoMQ's S3 requests away from the public internet and toward our own rustfs container within the Docker network. ### Configuration This entire stack—all three services and their dependencies—is defined in a single docker-compose.yaml file. Create this file now and paste the complete configuration block below into it. ```yaml theme={null} services: rustfs: image: rustfs/rustfs:latest container_name: rustfs-server ports: - "9000:9000" - "9001:9001" environment: - RUSTFS_VOLUMES=/data - RUSTFS_ADDRESS=0.0.0.0:9000 - RUSTFS_CONSOLE_ADDRESS=0.0.0.0:9001 - RUSTFS_CONSOLE_ENABLE=true - RUSTFS_ACCESS_KEY=rustfsadmin - RUSTFS_SECRET_KEY=rustfsadmin volumes: - rustfs_data:/data networks: - automq_net restart: unless-stopped healthcheck: test: ["CMD", "sh", "-c", "curl -f http://localhost:9000/health"] interval: 30s timeout: 10s retries: 3 start_period: 40s # 1.5. MC (MinIO Client) mc-init: container_name: mc-init-rustfs image: minio/mc:latest depends_on: rustfs: condition: service_healthy networks: - automq_net entrypoint: > /bin/sh -c " echo 'Waiting for RustFS service...'; /usr/bin/mc alias set myrustfs http://rustfs:9000 rustfsadmin rustfsadmin; echo 'RustFS is ready. Creating buckets...'; /usr/bin/mc mb myrustfs/automq-data; /usr/bin/mc mb myrustfs/automq-ops; echo 'Buckets created successfully. Keeping container alive.'; tail -f /dev/null " server1: container_name: "automq-server1" image: automqinc/automq:1.6.0 stop_grace_period: 1m environment: - KAFKA_S3_ACCESS_KEY=rustfsadmin - KAFKA_S3_SECRET_KEY=rustfsadmin - AWS_ACCESS_KEY_ID=rustfsadmin - AWS_SECRET_ACCESS_KEY=rustfsadmin - KAFKA_HEAP_OPTS=-Xms1g -Xmx4g -XX:MetaspaceSize=96m -XX:MaxDirectMemorySize=1G - CLUSTER_ID=3D4fXN-yS1-vsQ8aJ_q4Mg command: - bash - -c - | /opt/automq/kafka/bin/kafka-server-start.sh \ /opt/automq/kafka/config/kraft/server.properties \ --override cluster.id=$$CLUSTER_ID \ --override node.id=0 \ --override controller.quorum.voters=0@server1:9093 \ --override controller.quorum.bootstrap.servers=server1:9093 \ --override advertised.listeners=PLAINTEXT://server1:9092 \ --override s3.data.buckets='0@s3://automq-data?region=us-east-1&endpoint=http://rustfs:9000&pathStyle=true' \ --override s3.ops.buckets='1@s3://automq-ops?region=us-east-1&endpoint=http://rustfs:9000&pathStyle=true' \ --override s3.wal.path='0@s3://automq-data?region=us-east-1&endpoint=http://rustfs:9000&pathStyle=true' networks: - automq_net depends_on: - rustfs - mc-init networks: automq_net: driver: bridge volumes: rustfs_data: ``` ### Validate Deployment Time to see it all work. With your docker-compose.yaml file saved, launch the stack. We will then verify that the three services defined in your YAML have orchestrated correctly. The test will use the standard Kafka bin scripts, found inside the automq-server1 container, to create a topic and send messages, proving that AutoMQ is successfully reading and writing data to the RustFS backend. #### 4.1 Launch and Check Status ```bash theme={null} # Start all services docker compose up -d # Check the status to see if everything is running docker compose ps ``` **Expected Result:** The STATUS for rustfs-server should include (healthy), and all three services should show as Up. ```text theme={null} NAME IMAGE COMMAND SERVICE CREATED STATUS PORTS automq-server1 automqinc/automq:1.6.0 "bash -c '/opt/autom…" server1 ... Up ... mc-init-rustfs minio/mc:latest "/bin/sh -c ' echo '…" mc-init ... Up ... rustfs-server rustfs/rustfs:latest "/entrypoint.sh rust…" rustfs ... Up ... (healthy) ... ``` #### 4.2 Create a Topic This step proves AutoMQ can successfully write to the RustFS backend by creating a Kafka topic. ```bash theme={null} docker exec -it automq-server1 bash /opt/automq/kafka/bin/kafka-topics.sh --create --topic test-topic --bootstrap-server server1:9092 --partitions 1 --replication-factor 1 ``` **Expected Result:** You will see the message Created topic test-topic. #### 4.3 Produce and Consume Finally, let's confirm the full data flow by sending and receiving a message. This requires two terminals. Terminal 1 (Consumer): ```bash theme={null} /opt/automq/kafka/bin/kafka-console-consumer.sh --bootstrap-server server1:9092 --topic test-topic ``` Terminal 2 (Producer): ```bash theme={null} docker exec -it automq-server1 bash /opt/automq/kafka/bin/kafka-console-producer.sh --broker-list server1:9092 --topic test-topic > Hello, AutoMQ and RustFS! ``` Expected Result: The message Hello, AutoMQ and RustFS! will instantly appear in Terminal 1. This confirms the entire data flow—from producer to S3 storage and back to the consumer—is fully operational. ## **Future Outlook** The integration of AutoMQ with RustFS demonstrates significant advantages over using standard object storage or complex traditional systems. RustFS provides a high-performance, stable storage layer, delivering high read/write throughput with stable memory usage, which allows AutoMQ to maintain its P99 low latency targets. Additionally, its lightweight, metadata-free architecture and Apache-2.0 license drastically reduce operational complexity and eliminate commercial compliance risks. Ultimately, this partnership highlights a compelling synergy. [AutoMQ](https://www.automq.com/?utm_source=automq_rustfs_partner) provides a modern, elastic, and cost-effective architecture for Kafka by making brokers stateless and leveraging compute-storage separation. When paired with [RustFS](https://rustfs.com/?utm_source=automq_rustfs_partner), which provides a high-performance, license-friendly, and easy-to-operate S3-compatible backend, the result is a highly reliable, scalable, and resource-efficient streaming platform. This combination is engineered to meet modern data demands, delivering both architectural elasticity (at the compute layer) and high-performance, compliant persistence (at the storage layer). # Tigris Source: https://docs.automq.com/automq/integrations/storage/tigris Deploy AutoMQ statelessly with Tigris. Achieve Kafka compatibility, cloud-native scalability, and cost efficiency with S3 integration for global storage. [Tigris](https://www.tigrisdata.com/) is a globally distributed, multi-cloud object storage service with built-in support for the S3 API. It uses Dynamic Data Placement and Access-Based Rebalancing to deliver low-latency access worldwide — without the need to manage replication or caching. When paired with Tigris, AutoMQ can run as fully stateless brokers, leveraging Tigris's unique architecture to eliminate attached disks and replication overhead. ## Quick Start with Docker Compose: The easiest way to run AutoMQ with Tigris is using Docker Compose. This guide will walk you through setting up a single-node AutoMQ cluster backed by Tigris storage. ### Prerequisites * **Docker** and **Docker Compose** installed * A **Tigris account** - create one at [https://storage.new](https://storage.new/) * **Tigris credentials** - create Access Key and Secret Key from your Tigris dashboard at [https://console.storage.dev](https://console.storage.dev) ### Create Buckets in Tigris AutoMQ requires two buckets: one for data storage and one for cluster's metrics and logs. You can create them via the Tigris console or using the AWS CLI: ```bash theme={null} # Configure credentials export AWS_ACCESS_KEY_ID=YOUR_TIGRIS_ACCESS_KEY export AWS_SECRET_ACCESS_KEY=YOUR_TIGRIS_SECRET_KEY export AWS_ENDPOINT_URL_S3=https://t3.storage.dev # Create buckets for AutoMQ data and operations storage aws s3api create-bucket --bucket your-automq-data --endpoint-url https://t3.storage.dev aws s3api create-bucket --bucket your-automq-ops --endpoint-url https://t3.storage.dev ``` **Note** : Bucket names must be globally unique across all Tigris users. ### Configure Docker Compose Edit the `docker-compose.yaml` file and update the Tigris credentials and bucket names: ```yaml theme={null} services: server1: container_name: "automq-server1" image: automqinc/automq:1.6.0-rc0 stop_grace_period: 1m environment: # Replace with your Tigris credentials - KAFKA_S3_ACCESS_KEY=tid_YOUR_ACCESS_KEY_HERE - KAFKA_S3_SECRET_KEY=tsec_YOUR_SECRET_KEY_HERE - KAFKA_HEAP_OPTS=-Xms1g -Xmx4g -XX:MetaspaceSize=96m -XX:MaxDirectMemorySize=1G - CLUSTER_ID=3D4fXN-yS1-vsQ8aJ_q4Mg command: - bash - -c - | /opt/automq/kafka/bin/kafka-server-start.sh \ /opt/automq/kafka/config/kraft/server.properties \ --override cluster.id=$$CLUSTER_ID \ --override node.id=0 \ --override controller.quorum.voters=0@server1:9093 \ --override controller.quorum.bootstrap.servers=server1:9093 \ --override advertised.listeners=PLAINTEXT://server1:9092 \ --override s3.data.buckets='0@s3://your-automq-data?region=auto&endpoint=https://t3.storage.dev' \ --override s3.ops.buckets='1@s3://your-automq-ops?region=auto&endpoint=https://t3.storage.dev' \ --override s3.wal.path='0@s3://your-automq-data?region=auto&endpoint=https://t3.storage.dev' networks: - automq_net networks: automq_net: driver: bridge ``` **Key Configuration Parameters:** * `KAFKA_S3_ACCESS_KEY` - Your Tigris Access Key (starts with `tid_`) * `KAFKA_S3_SECRET_KEY` - Your Tigris Secret Key (starts with `tsec_`) * `s3.data.buckets` - Your data bucket name in the S3 URL (stores Kafka data) * `s3.ops.buckets` - Your ops bucket name in the S3 URL (stores operational metadata) * `s3.wal.path` - Write-Ahead Log path (typically same as data bucket) * `endpoint=https://t3.storage.dev` - Tigris S3-compatible endpoint * `region=auto` - Tigris automatically routes to the nearest region For detailed information on these Tigris and S3 configuration parameters, refer to the [AutoMQ Broker and Controller Configuration guide](https://docs.automq.com/automq/configuration/broker-and-controller-configuration#s3-data-buckets). ### 4. Start AutoMQ Start the AutoMQ cluster with Docker Compose: ```bash theme={null} docker-compose up -d ``` Check the logs to verify AutoMQ is running: ```bash theme={null} docker-compose logs -f ``` You should see messages indicating: * `Readiness check pass! (ObjectStorageReadinessCheck)` - Connected to Tigris * `The broker has been unfenced` - Broker is ready * `Kafka Server started` - AutoMQ is running ### Create a Topic Create a Kafka topic using the AutoMQ CLI: ```bash theme={null} docker run --network automq_net automqinc/automq:1.6.0-rc0 \ /bin/bash -c "/opt/automq/kafka/bin/kafka-topics.sh \ --create \ --topic my-test-topic \ --bootstrap-server server1:9092 \ --partitions 3 \ --replication-factor 1" ``` List all topics to verify: ```bash theme={null} docker run --network automq_net automqinc/automq:1.6.0-rc0 \ /bin/bash -c "/opt/automq/kafka/bin/kafka-topics.sh \ --list \ --bootstrap-server server1:9092" ``` Describe the topic: ```bash theme={null} docker run --network automq_net automqinc/automq:1.6.0-rc0 \ /bin/bash -c "/opt/automq/kafka/bin/kafka-topics.sh \ --describe \ --topic my-test-topic \ --bootstrap-server server1:9092" ``` ### Produce and Consume Messages **Produce test messages:** ```bash theme={null} docker run --network automq_net automqinc/automq:1.6.0-rc0 \ /bin/bash -c "/opt/automq/kafka/bin/kafka-producer-perf-test.sh \ --topic my-test-topic \ --num-records=10000 \ --throughput 1000 \ --record-size 1024 \ --producer-props bootstrap.servers=server1:9092" ``` **Consume messages:** ```bash theme={null} docker run --network automq_net automqinc/automq:1.6.0-rc0 \ /bin/bash -c "/opt/automq/kafka/bin/kafka-console-consumer.sh \ --topic my-test-topic \ --bootstrap-server server1:9092 \ --from-beginning \ --max-messages 10" ``` ## Congratulations! 🎉 You've successfully deployed AutoMQ with Tigris as the storage backend! In this guide, you: * Created Tigris buckets for data and operational storage * Configured and launched a single-node AutoMQ cluster using Docker Compose * Connected AutoMQ to Tigris using S3-compatible endpoints * Created a Kafka topic with multiple partitions * Produced and consumed messages through AutoMQ Your AutoMQ cluster is now running entirely stateless with all data durably stored in Tigris object storage. You can scale brokers up or down without worrying about data migration, and benefit from Tigris' global distribution and zero egress fees. ## Learn More ### Tigris Resources * [Tigris Documentation](https://www.tigrisdata.com/docs/) * [Tigris Overview](https://www.tigrisdata.com/docs/overview/) * [Tigris Get Started](https://www.tigrisdata.com/docs/get-started/) * [Tigris Buckets](https://www.tigrisdata.com/docs/buckets/create-bucket/) * [Tigris Blog](https://www.tigrisdata.com/blog/) # Migrating from Apache Kafka to AutoMQ Source: https://docs.automq.com/automq/migration/migrating-from-apache-kafka-to-automq Migrate from Apache Kafka to AutoMQ with cloud-native scalability, full Kafka compatibility, and cost efficiency. Follow detailed steps for seamless transition and minimize disruption. This article details the plan and implementation process for migrating from Apache Kafka® to AutoMQ. > [!TIP] > > AutoMQ commercial editions offer the [Kafka Linking Tool](https://docs.automq.com/automq-cloud/migrate-to-automq/overview#overview-of-kafka-linking) that supports byte-for-byte message synchronization, ensuring that message offsets remain identical before and after synchronization, and enables zero-downtime migrations. If your business scenario requires a smoother migration approach, you can reach out to the AutoMQ team for necessary assistance and best practices through [this form](https://www.automq.com/contact). ## Prerequisites ### Feature List Currently, AutoMQ only provides the Kafka Server component and does not offer other ecosystem components. Therefore, before migrating to AutoMQ, you need to confirm whether the following features are used and handle them according to the following guidelines: * **Kafka Server:** AutoMQ provides a more cost-effective and flexible Kafka Server solution, **compatible with Apache Kafka versions 0.9.x to 3.9.x**. If your current Apache Kafka Server version falls outside the supported range, please contact us for support and updates. * **Kafka Client:** AutoMQ is fully compatible with the original Apache Kafka Client SDK; ensure your SDK version is between **0.9.x and 3.9.x** for full compatibility. * **Kafka Connector:** AutoMQ is compatible with the Apache Kafka Connector. If you are using Kafka Connector, it is recommended to maintain the existing service and replace the Kafka Server endpoint in the Connector configuration with the AutoMQ instance endpoint. ### Business Scope Migrating from Apache Kafka® to AutoMQ in a production environment is generally recommended to be done in batches, gradually migrating Topics and Consumer Groups from the source cluster based on business chains and scopes. Therefore, it is advisable to follow the process below for business scope assessment: 1. **Inventory Source Cluster Resources:** It is recommended to use Kafka Admin CLI or other tools to export all Topics and Consumer Groups from the source cluster, categorizing them by business systems. Clean up any invalid or unclaimed Topics and Consumer Groups in advance. > [!TIP] > > It is advisable to check the Topics in the source cluster and clean up those that have not been written to or subscribed to for a long time, thereby narrowing the scope of migration. 2. **Batch Division by Business Systems:** In a production environment, it is recommended to plan migration batches based on business systems. Start with offline or non-core business systems and gradually expand the scope of migration to avoid unexpected risks. 3. **Coordinate with Business Personnel for Migration:** The process of migrating from Apache Kafka to AutoMQ requires cooperation from business personnel to change access points and restart applications. Therefore, before executing the migration plan, coordination with business personnel is necessary. > [!NOTE] > > Once a connection is established between the Apache Kafka Client and the server, the connection to the source cluster will not be disconnected. Therefore, even if the server is accessed via a domain name, it is still necessary to restart the client application to connect to the new AutoMQ cluster. ## Migration Process From migrating from Apache Kafka® to AutoMQ, the primary considerations include the following tasks: * **Message Data Migration:** Kafka stores both consumed and unconsumed historical message data. The migration process must ensure that the message data is replicated to the new cluster as needed, with no message loss. * **Consumer Progress Metadata Migration:** The metadata of consumer progress that Kafka consumers have already processed in the source cluster needs to be reconstructed in the new cluster to avoid losing progress and re-consuming messages, which can result in a large amount of duplication. * **Producer Switch:** Besides data synchronization, the migration work also involves switching producer applications at the appropriate time so that producers connect to the target cluster to produce new messages. * **Consumer Switch:** Besides data synchronization, the migration work also involves switching consumer applications at the appropriate time so that consumers connect to the target cluster and continue consuming messages from the previous progress. The overall migration plan can be referenced in the process diagram below: ![](https://mintcdn.com/automq/P6Ug3urJlyU1p2ee/automq/migration/migrating-from-apache-kafka-to-automq/1.webp?fit=max\&auto=format\&n=P6Ug3urJlyU1p2ee\&q=85\&s=4a8c3cb06d9935847181159145ed9d86) ### Step 1: **Create a Migration Task and Synchronize Data** Refer to [Overview▸](/automq-cloud/migrate-to-automq/overview). AutoMQ recommends using a separate MirrorMaker2 Connector for each batch task to optimize data synchronization and enhance isolation. Fill in the following parameters according to your specific requirements: * **Source Cluster:** Specify the source cluster that needs migration. * **Target Cluster:** Specify the target cluster for the migration. Here, select the AutoMQ cluster. * **List of Topics to Sync:** Set the list of Topics covered by the migration task. This list supports wildcard inputs, allowing you to configure multiple Topics at once. > [!TIP] > > The AutoMQ migration tool supports automatic syncing of dynamic Topic updates. Once a migration task is created, any new Topics or changes in the number of partitions of existing Topics that meet the current list criteria will be automatically synced to the target cluster. * **Sync Consumer Progress:** It is recommended to enable this. When enabled, the migration task will map the consumption progress of the ConsumerGroup from the source cluster to the target cluster, ensuring that consumers can continue from where they left off after switching, thus avoiding a large amount of duplicate processing. > [!WARNING] > > It is important to note that the offsets of messages in the clusters synced by MirrorMaker2 are inconsistent. Therefore, the consumption progress of the source cluster will be remapped to the target cluster. This process may result in a slight rollback of offsets. * **List of Topics to Exclude:** If wildcards are used in the **List of Topics to Sync** but some Topics need to be excluded from the migration, you can set the list of Topics to exclude, removing the relevant Topics from the migration. ### Step 2: **Monitor Sync Progress and Wait for the Migration to Approach Completion** MirrorMaker2 supports viewing synchronization latency via JMX metrics. Users should monitor the synchronization task's latency metrics and wait until the metrics approach zero. > [!TIP] > > Monitoring synchronization completion helps reduce the observation wait time for subsequent application switchovers. In MirrorMaker2, synchronization latency refers to the time taken for messages from the migrated Topic to be produced in the source cluster and synchronized. When multiple Topics are involved in a single migration task, the maximum latency among all Topics is considered. According to the migration plan description, it is necessary to regularly monitor the synchronization latency and the synchronization backlog metrics of the migration task. It is recommended to prepare for the next step of application switchover when the **synchronization latency is less than 1 minute**. ### Step 3: **Stop the Source Cluster Consumers** Application switchover requires switching the consumers first. It is advisable to stop the consumer applications initially and wait for the consumption progress data from the source cluster to be synchronized to the target cluster before switching to the target cluster. > [!TIP] > > It is recommended to wait for a period, allowing the consumption progress to be fully synchronized. The default time is 60 seconds, but it can be customized in the advanced configuration of the migration task. > > Alternatively, the application can first start new consumers in the target cluster with the same Consumer Group, and then stop the consumers in the source cluster. This will result in both ends consuming simultaneously for a period. ### Step 4: Switch Consumers to the Target Cluster After completing Step 3, update the consumer configuration to replace the endpoint with the one provided by the AutoMQ instance, then restart the application. > [!NOTE] > > According to MirrorMaker2's technical implementation, there may be some consumer duplication during Steps 3 and 4. If you want to reduce the likelihood of duplication, you can customize the configuration in the advanced parameters of the migration task. ### Step 5: Stop Producers on the Source Cluster For each Topic, ensure that Steps 3 and 4 have been repeated for all consumers of the current Topic. Once all consumers have been switched, you can stop the producers on the source cluster and wait for all message data to synchronize to the target cluster. > [!WARNING] > > Stopping the producers is necessary to prevent the target cluster from receiving messages from both producers and MirrorMaker2 simultaneously, which could lead to message disorder. > [!TIP] > > The switch to the producer process must be completely shut down to ensure messages are not processed out of order. AutoMQ commercial editions offer the [Kafka Linking Tool](https://docs.automq.com/automq-cloud/migrate-to-automq/overview#overview-of-kafka-linking) that supports byte-for-byte message synchronization, ensuring that message offsets remain identical before and after synchronization, and enables zero-downtime migrations. If your business scenario requires a smoother migration approach, you can reach out to the AutoMQ team for necessary assistance and best practices through [this form](https://www.automq.com/contact). ### Step 6: Switch Producers to the Target Cluster Monitor the synchronization delay of the migration task. Once the synchronization delay is confirmed to be zero, restart the producers with the new endpoint address to connect to the AutoMQ target cluster, completing the entire migration task. > [!WARNING] > > Monitoring the upstream and downstream applications of the Topic continuously is necessary after switching producers to ensure they meet expectations. ### Step 7: Repeat Steps 3 Through 6 Until the Migration Is Complete, Then Delete the Migration Task. 1. **Repeatedly check if all Topic migrations are completed.** Steps 3 to 6 are performed at the granularity of the Topic and the associated producer and consumer applications. Therefore, continuous checks are needed until all Topics in the current migration task are completed. 2. **Delete the migration task.** Once all Topic migrations are completed, click confirm to delete the task. AutoMQ will clean up the underlying machine resources and configuration information. > [!WARNING] > > After deleting the migration task, it cannot be recovered. Even if a migration task for the same Topic is recreated, it will be treated as a new task and will not continue from the previous migration state. Therefore, ensure that the current migration task has successfully completed its work before deletion. ## Rollback Process During various stages of the migration process, if unexpected exceptions occur and cannot be quickly diagnosed, users can attempt to rollback using the following process and be aware of the impacts caused by the rollback.
Migration Stage Rollback Plan Rollback Impact
Step 1: Create Task
  • Delete Task
  • Delete the Topic and Consumer Group of the target instance, and clean up synchronized data
At this stage, since the application has not yet switched, there is no impact on the application
Step 2: Monitor Synchronization Progress
Step 3: Stop Source Cluster Consumers
  • Resume Source Cluster Consumers, roll back to Step 2 stage
Data remains unaffected, only causing consumption pauses and delays
Step 4: The consumer has been switched to the target cluster
  • Stop the target cluster consumer, switch back to the source cluster access point, and roll back to Step 2
Rolling back to the source cluster will reconsume data during the switching period
Step 5: The source cluster producer has been stopped
  • Resume the source cluster producer, and roll back to Step 4
Step 6: The producer has been switched to the target cluster
  • Stop the target cluster producer, switch back to the source cluster access point, and roll back to Step 4
During Step 6, messages produced to the target cluster cannot be reverse-synchronized back to the source cluster and require application processing.
In Step 7, the migration task has been deleted.
  • After deleting the task rollback is not possible
Not applicable
# Overview Source: https://docs.automq.com/automq/migration/overview Migrate to AutoMQ, a next-gen Kafka-compatible cloud-native service, with ease. Enjoy seamless cluster migration and cost-efficient scalability using MirrorMaker2. # Migration AutoMQ is a next-generation Kafka release redesigned based on cloud-native concepts, and it is compatible with Apache Kafka®. This article will detail how to migrate from Apache Kafka® or other Kafka distributions to AutoMQ. ## Migration Tool The AutoMQ Open Source recommends using the MirrorMaker2 tool for cluster migration, supporting transitions from Apache Kafka or other Kafka distributions to AutoMQ. > [!TIP] > > AutoMQ commercial editions provide a [Kafka Linking tool](https://docs.automq.com/automq-cloud/migrate-to-automq/overview#overview-of-kafka-linking), which supports Byte-to-Byte message synchronization (ensuring that message offsets remain completely consistent before and after synchronization) and enables zero-downtime migration. If your business scenario requires a smoother migration solution, you can reach out to the AutoMQ team via [this form](https://www.automq.com/contact) for assistance and best practices. MirrorMaker2 migration tool has the following capabilities: * **Supports batch migration of clusters:** MirrorMaker2 facilitates batch migration of Topics and Groups from the source cluster to the target cluster, enabling phased rollout and validation. * **Supports synchronization of consumption progress:** MirrorMaker2 ensures real-time synchronization of consumption progress from the source cluster, allowing consumers to continue consuming from the target cluster after migration. * **Supports dynamic updates of Topics and Groups:** MirrorMaker2 enables real-time monitoring of dynamic updates of Topics and Groups, ensuring that no updates are missed during the migration process. The technical architecture of MirrorMaker2 is as follows: ![](https://mintcdn.com/automq/s9vNxeyMGZ1r1DRV/automq/migration/overview/1.webp?fit=max\&auto=format\&n=s9vNxeyMGZ1r1DRV\&q=85\&s=7414d41c4c87246d3fdedcdaeff2f369) ## Core Concepts MirrorMaker2 defines several Connectors to implement data synchronization tasks between two Apache Kafka® clusters, including necessary configurations and real-time running states. * **MirrorSourceConnector**: Used for synchronizing message data from the source cluster. * **MirrorCheckpointConnector**: Used to synchronize the consumption progress data of the source cluster ConsumerGroup. * **MirrorHeartbeatConnector**: Used for system detection of the synchronization link's operational status. ## Deploying MirrorMaker2 For the installation and deployment of MirrorMaker2, refer to the relevant links from the Apache Kafka community: * [MirrorMaker2 Design Document.](https://cwiki.apache.org/confluence/display/KAFKA/KIP-382%3A+MirrorMaker+2.0#KIP382:MirrorMaker2.0-ConnectorConfigurationProperties) * [MirrorMaker2 Configuration Documentation.](https://kafka.apache.org/documentation/#mirrormakerconfigs) ## Constraints and Limitations MirrorMaker2 uses Connectors to synchronize messages between the source and target clusters. This mechanism cannot guarantee complete data consistency between the source and target clusters. Therefore, when using the migration tool, please note the following constraints and limitations: > [!WARNING] > > **Minor Message Duplication** > > Consumer progress data is asynchronously and intermittently synchronized, which may cause offset rollbacks and result in duplicate consumption when switching consumers. > > Message synchronization is an asynchronous operation, and due to machine anomalies or fault recovery, partial data may be duplicated. > > **Minor Message Reordering** > > If offset rollbacks occur when switching consumers, a small number of messages will be reconsumed, leading to disorder in the message sequence. ## Next Steps After understanding the background of cluster migration, it is recommended to choose the corresponding solution based on the current cluster situation: * **Migrating from Apache Kafka to AutoMQ:** Follow the migration plan and execute the migration step by step in batches. [Migrating from Apache Kafka to AutoMQ▸](/automq/migration/migrating-from-apache-kafka-to-automq) # Dashboard Configuration Source: https://docs.automq.com/automq/observability/dashboard-configuration Monitor and optimize your AutoMQ cloud-native Kafka environment with customizable Grafana dashboards, enhancing scalability and cost-efficiency. The AutoMQ team has set up a series of Grafana dashboard templates tailored to production environment scenarios. Once users export metrics to Prometheus, they can import these Grafana dashboard templates, configure the Grafana data source to link to the respective Prometheus, and begin monitoring AutoMQ. > [!TIP] > > To obtain the Grafana dashboard template collection, you can reach out to the AutoMQ team by [filling out the form](https://www.automq.com/contact). ### Cluster Overview **Cluster Overview** provides monitoring information at the cluster level, including metrics like the number of nodes, data size, and cluster traffic. It also includes an overview with dimensions such as Topic, Group, and Broker, allowing users to delve into detailed monitoring information. ![](https://mintcdn.com/automq/s9vNxeyMGZ1r1DRV/automq/observability/dashboard-configuration/1.webp?fit=max\&auto=format\&n=s9vNxeyMGZ1r1DRV\&q=85\&s=23dcc2f0d5a032b2b5aeacca40135fb0) ### Broker Dashboard **Broker Metrics** provides monitoring data for brokers, including metrics like connection count, partition count, node traffic, and node requests. ![](https://mintcdn.com/automq/s9vNxeyMGZ1r1DRV/automq/observability/dashboard-configuration/2.webp?fit=max\&auto=format\&n=s9vNxeyMGZ1r1DRV\&q=85\&s=c5945045cfaac78d0616ae73adb255d4) ### Topic Dashboard **Topic Metrics** offers tailored monitoring for topics, covering metrics such as message throughput, total data volume, partition count, and consumption lag. ![](https://mintcdn.com/automq/s9vNxeyMGZ1r1DRV/automq/observability/dashboard-configuration/3.webp?fit=max\&auto=format\&n=s9vNxeyMGZ1r1DRV\&q=85\&s=a71404f323e51cd1958563e24123554a) ### Group Dashboard **Group Metrics** delivers monitoring indicators for groups, encompassing consumption rate and consumption latency. ![](https://mintcdn.com/automq/s9vNxeyMGZ1r1DRV/automq/observability/dashboard-configuration/4.webp?fit=max\&auto=format\&n=s9vNxeyMGZ1r1DRV\&q=85\&s=99dfdb9fb52a8a2e275b773c73e66fa3) ### Detail Dashboard **Detailed Metrics** provide a robust set of metrics at the implementation layer, allowing developers to effectively monitor, troubleshoot, and gain deeper insights into the operational mechanisms of AutoMQ. ![](https://mintcdn.com/automq/s9vNxeyMGZ1r1DRV/automq/observability/dashboard-configuration/5.webp?fit=max\&auto=format\&n=s9vNxeyMGZ1r1DRV\&q=85\&s=a5f54d3682d7239326a13ccc0d724566) # Integrating Metrics with Prometheus Source: https://docs.automq.com/automq/observability/integrating-metrics-with-prometheus Integrate AutoMQ with Prometheus for metrics collection and visualization. Leverage cloud-native scalability, Kafka compatibility, and cost efficiency. Prometheus is a widely adopted service for monitoring, alerting, and time series data storage. It facilitates the collection, storage, and querying of metrics. This article outlines how to integrate AutoMQ with Prometheus to achieve metrics data collection and querying. ## Metrics Integration AutoMQ Open Source uses the OpenTelemetry SDK to implement metrics collection and export, enabling the exposure of Apache Kafka business metrics and underlying storage-related metrics. Both types of metrics are unified and transformed using the OTLP format for exposure. ![Based on the diagram above, first choose an appropriate metrics export solution to export metrics data to Prometheus. There are three ways to export metrics data:](https://mintcdn.com/automq/s9vNxeyMGZ1r1DRV/automq/observability/integrating-metrics-with-prometheus/1.webp?fit=max\&auto=format\&n=s9vNxeyMGZ1r1DRV\&q=85\&s=4b95439d7172f23968d62d0944944c19) For the above figure, first select an appropriate metrics export solution to export metrics data to Prometheus. There are three methods to export metrics data: * Using OpenTelemetry Collector * Using Prometheus OTLP Receiver * Directly Pulling Metrics from the Server ## Prometheus Metrics Definition After integrating the metrics into Prometheus through either the OT Collector or Prometheus OTLP Receiver, you can refer to [Prometheus Metrics▸](/automq/observability/prometheus-metrics) to view the metrics definitions. ## Option 1: Using OpenTelemetry Collector 1. Start the OpenTelemetry Collector and configure the Prometheus Exporter to collect and export metrics data. ```yaml theme={null} exporters: prometheus: endpoint: $endpoint_for_promehteus ``` 2. When starting the Prometheus service, make sure to add the following configuration. ```yaml theme={null} scrape_configs: - job_name: $job_name scrape_interval: 5s honor_labels: true # DO NOT CHANGE THIS static_configs: - targets: ["$endpoint_for_prometheus"] ``` 3. Configure AutoMQ to push metrics data to the Collector. ```properties theme={null} s3.telemetry.metrics.exporter.type=otlp s3.telemetry.exporter.otlp.protocol=grpc s3.telemetry.exporter.otlp.endpoint=http://${endpoint}:4317 # Or with Http Protocol # s3.telemetry.exporter.otlp.protocol=http # s3.telemetry.exporter.otlp.endpoint=http://${endpoint}:4318/v1/metrics ``` ## Option 2: Using Prometheus OTLP Receiver ### **Integration into Self-Managed Open Source Prometheus** According to Prometheus's [version requirements](https://prometheus.io/docs/prometheus/latest/querying/api/#otlp-receiver), the user's Prometheus service needs to meet the following conditions: * Prometheus version must be at least 2.47. * Prometheus needs to enable feature flags: --enable-feature=otlp-write-receiver. Refer to the command below for enabling it. ```bash theme={null} ./prometheus --config.file=prometheus.yml --enable-feature=otlp-write-receiver ``` > [!NOTE] > > If your current self-hosted Prometheus service is based on the [VictoriaMetrics](https://github.com/VictoriaMetrics/VictoriaMetrics) Enterprise edition, ensure that the version of [VictoriaMetrics](https://github.com/VictoriaMetrics/VictoriaMetrics) is at least 1.92.0. Configure the access point according to the relevant documentation on [Sending Data via OpenTelemetry](https://docs.victoriametrics.com/single-server-victoriametrics/#sending-data-via-opentelemetry). ### **Integrate into Cloud Provider's Prometheus Service** If users use managed services provided by public cloud vendors, it is advisable to consult the technical staff from the cloud vendor. Taking Alibaba Cloud as an example, Alibaba Cloud's Prometheus service provides ready-to-use support for the OT protocol. Refer to the [OT Protocol Data Reporting Documentation](https://help.aliyun.com/arms/prometheus-monitoring/instructions-for-using-the-reporting-address-of-opentelemetry-indicator?spm=a2c4g.11186623.0.i1). After starting the Prometheus service, configure AutoMQ to push metrics to Prometheus: ```properties theme={null} s3.telemetry.metrics.exporter.type=otlp s3.telemetry.exporter.otlp.protocol=http s3.telemetry.exporter.otlp.endpoint=http://${endpoint}:9090/api/v1/otlp/v1/metrics # Or Use with Aliyun Prometheus OpenTelemetry Endpoint # s3.telemetry.exporter.otlp.endpoint=https://${endpoint}/api/v1/metrics ``` ## Solution Three: Pull Metrics Directly from the Server In this mode, AutoMQ acts as a Prometheus HTTP Server, and users can configure scrape tasks on the Prometheus backend service to fetch Prometheus metrics from specific endpoints. The configuration method is as follows: ```properties theme={null} s3.telemetry.metrics.exporter.type=prometheus s3.metrics.exporter.prom.host=127.0.0.1 s3.metrics.exporter.prom.port=9090 ``` # Overview Source: https://docs.automq.com/automq/observability/overview Discover AutoMQ's Kafka compatibility and cloud-native scalability. Elevate monitoring with Grafana dashboards and Prometheus integration for optimized alerts. This document explains how to monitor, set up alerts, and visualize dashboards when using AutoMQ. ### Metrics Collection AutoMQ is fully compatible with Apache Kafka. Along with supporting native Kafka metrics, it also introduces new system metrics such as S3 Stream. AutoMQ system metrics are exposed in the following ways: * **Native JMX Metrics Query:** AutoMQ Open Source supports Apache Kafka's native JMX metrics query. All metrics can be accessed through the JMX API. * [Integrating Metrics with Prometheus▸](/automq/observability/integrating-metrics-with-prometheus)**:** AutoMQ Open Source uses the OpenTelemetry SDK for metrics collection and export. Users can deploy an OTLP Collector or use components like Prometheus OTLP Receiver to report and transfer metrics to Prometheus. ### Visualization & Monitoring Alerts In real-world production environments, the AutoMQ team has set up a collection of Grafana dashboard templates and monitoring alert templates. Once users export metrics to Prometheus, they can import these Grafana dashboard templates and configure the Grafana data source to align with Prometheus, thereby starting the monitoring of AutoMQ. > [!TIP] > > To obtain the Grafana dashboard templates and monitoring alert templates, you can [contact the AutoMQ team](https://www.automq.com/contact) by filling out the form. ### Operation Guide * [Integrating Metrics with Prometheus▸](/automq/observability/integrating-metrics-with-prometheus) * [Dashboard Configuration▸](/automq/observability/dashboard-configuration) # Prometheus Metrics Source: https://docs.automq.com/automq/observability/prometheus-metrics AutoMQ offers Kafka-compatible metrics with Prometheus format, enhancing cloud-native scalability and cost efficiency. Understand performance deeply with detailed insights. This document provides detailed observability metrics for AutoMQ, enabling you to better understand its performance and operational status. > [!NOTE] > > AutoMQ metrics are defined and presented in the Prometheus format. If other protocol formats are needed, independent conversion is required. ## **General Metrics** ### Kafka\_server\_connection\_count The current number of connections established by the node. * Type: Gauge ### Kafka\_network\_threads\_idle\_rate The idle rate of Kafka SocketServer network threads, ranging from \[0, 1.0]. * Type: Gauge ### Kafka\_io\_threads\_idle\_time\_nanoseconds\_total The idle time of Kafka request handler threads is measured by the Apache Kafka native metric RequestHandlerAvgIdlePercent and is expressed as a percentage. By differentiating over time, you can determine the thread idle rate. Note that when a node functions as both a Controller and a Broker, each having its own request handler, this metric represents the combined value of both the Controller and Broker. The maximum idle rate derived from differentiation in this scenario is 2.0. * Type: Counter ## Controller Metrics ### Kafka\_controller\_active\_count This indicates whether the current Controller node is active. A metric value of 1 signifies it is active, while 0 indicates it is inactive. * Type: Gauge ### Kafka\_broker\_active\_count The number of active Brokers in the current cluster. * Type: Gauge ### Kafka\_broker\_fenced\_count The number of Brokers that are fenced in the current cluster. * Type: Gauge ### Kafka\_topic\_count Total number of topics in the current cluster. * Type: Gauge ### Kafka\_partition\_total\_count Total number of partitions in the current cluster. * Type: Gauge ### Kafka\_partition\_offline\_count Total number of partitions without leaders in the current cluster. * Type: Gauge ### Kafka\_stream\_auto\_balancer\_metrics\_time\_delay\_milliseconds The delay time for each broker node in the cluster to report AutoBalancer monitoring metrics. When this delay time exceeds a certain threshold, the broker node is deemed out-of-sync by the AutoBalancer and excluded from partition reassignment by the AutoBalancer. * Type: Gauge * Labels: * node\_id: The ID of the node reporting AutoBalancer monitoring metrics. ### Kafka\_stream\_s3\_object\_count The current total number of objects uploaded to object storage by the cluster, categorized by object state. * Type: Gauge * Labels: * State: Object state, divided into the following three categories: * Prepared: Objects that have not yet completed writing and have not been committed * Committed: Objects that have completed writing and have been committed * Mark\_destroyed: Objects marked for deletion, which will be removed from object storage after a certain delay ### Kafka\_stream\_s3\_object\_size\_bytes The total size of objects uploaded to object storage by the current cluster. * Type: Gauge ### Kafka\_stream\_stream\_object\_num The number of StreamObjects uploaded to object storage by the current cluster. * Type: Gauge ### Kafka\_stream\_stream\_set\_object\_num The number of StreamSetObjects uploaded to object storage by each Broker within the current cluster. * Type: Gauge * Labels: * node\_id: The corresponding Broker node ID ## Broker Metrics ### Kafka\_message\_count\_total The derivative of the total number of messages received by the Broker node with respect to time gives the message count throughput. * Type: Counter * Labels: * topic ### Kafka\_network\_io\_bytes\_total The derivative of the total size of messages received and sent by the Broker node with respect to time gives the message size throughput. * Type: Counter * Labels: * topic * partition * direction: * "in": indicates incoming messages * "out": indicates outgoing messages ### Kafka\_topic\_request\_count\_total The total number of requests received for each Topic on the Broker node includes only the produce and fetch types of requests. * Type: Counter * Labels: * topic * type: Request Type * produce * fetch ### Kafka\_topic\_request\_failed\_total The total number of request failures for each topic on the Broker node, including only produce and fetch request types. * Type: Counter * Labels: * topic * type: Request Type * produce * fetch ### Kafka\_request\_count\_total The total number of requests received by the Broker node. * Type: Counter * Labels: * type: Request Type * version: The API version for the request of this type ### Kafka\_request\_error\_count\_total The total number of failed requests on the Broker node. Note that this metric also accounts for successful requests, where the error code for a successful request is NONE. * Type: Counter * Labels: * type: Request Type * error: Error code, with NONE indicating a successful request ### Kafka\_request\_size\_bytes\_total The total size of requests received by the Broker node. * Type: Counter * Labels: * type: Request Type ### Kafka\_request\_size\_50p(99p/mean/max)\_bytes The size of requests received by Broker nodes, represented by different percentiles. * Type: Gauge * Labels: * type: Request Type ### Kafka\_request\_time\_milliseconds\_total The total time taken by Broker nodes to process requests. * Type: Counter * Labels: * type: Request Type ### Kafka\_request\_time\_50p(99p/mean/max)\_milliseconds Processing time for broker node requests, shown in various percentiles. * Type: Gauge * Labels: * type: Request Type ### Kafka\_request\_queue\_time\_milliseconds\_total Total request queue time for broker nodes. When Kafka IO threads are busy, it results in longer request queue times. * Type: Counter * Labels: * type: Request Type ### Kafka\_request\_queue\_time\_50p(99p/mean/max)\_milliseconds Request queue time for broker nodes, illustrated in different percentiles. * Type: Gauge * Labels: * type: Request Type ### Kafka\_response\_queue\_time\_milliseconds\_total The response queue time on Broker nodes increases when Kafka Network threads are busy. * Type: Counter * Labels: * type: Request Type ### Kafka\_response\_queue\_time\_50p(99p/mean/max)\_milliseconds Broker node response queue time is represented by different percentiles. * Type: Gauge * Labels: * type: Request Type ### Kafka\_request\_queue\_size The request queue size for the broker node. * Type: Gauge ### Kafka\_response\_queue\_size The response queue size for the broker node. * Type: Gauge ### Kafka\_purgatory\_size The number of requests in the producer or fetch purgatory on the broker node. * Type: Gauge * Labels: * type: * Produce * Fetch ### Kafka\_partition\_count The number of partitions currently assigned to the broker node. * Type: Gauge ### Kafka\_logs\_flush\_time\_50p(99p/mean/max)\_milliseconds The log flush time of the broker node; in AutoMQ, this indicates the flush time of Delta WAL, expressed by different percentiles. * Type: Gauge ### Kafka\_log\_end\_offset The maximum logical offset for each partition on the broker node. * Type: Gauge * Labels: * topic * partition ### Kafka\_log\_size The message size for each partition on the broker node. * Type: Gauge * Labels: * topic * partition ### Kafka\_group\_commit\_offset The consumption offset for each Consumer Group on the corresponding partition; note that this metric is reported by the Broker where the Group Coordinator for each Consumer Group resides. * Type: Gauge * Labels: * consumer\_group * topic * partition ### Kafka\_group\_count The number of Consumer Groups managed by the Broker node where each Group Coordinator is located. * Type: Gauge ### Kafka\_group\_preparing\_rebalance\_count The number of Consumer Groups that are preparing to rebalance. * Type: Gauge ### Kafka\_group\_completing\_rebalance\_count Number of Consumer Groups waiting for state assignment from the Leader. * Type: Gauge ### Kafka\_group\_stable\_count Number of Consumer Groups in a Stable state. * Type: Gauge ### Kafka\_group\_empty\_count Number of Consumer Groups with no members but not yet expired. * Type: Gauge ### Kafka\_group\_dead\_count Number of Consumer Groups with no members and metadata already removed. * Type: Gauge ### Kafka\_stream\_upload\_size\_bytes\_total Total size of data uploaded by Broker nodes to object storage. * Type: Counter ### Kafka\_stream\_download\_size\_bytes\_total The total size of data downloaded from object storage by the Broker node. * Type: Counter ### Kafka\_stream\_network\_inbound\_usage\_bytes\_total The total inbound bandwidth usage of the Broker node, including received messages and data downloaded from object storage, can be analyzed over time to determine inbound throughput. * Type: Counter ### Kafka\_stream\_network\_outbound\_usage\_bytes\_total The total outbound bandwidth usage of the Broker node, including consumed messages and data uploaded to object storage, can be analyzed over time to determine outbound throughput. * Type: Counter ### Kafka\_stream\_network\_inbound\_available\_bandwidth\_bytes Inbound throughput reserved for cold reads and Compaction on the Broker node—when this value is less than what is required for cold reads and Compaction inbound traffic, the respective requests are queued in the rate limiting queue, thus not affecting the normal message sending and receiving traffic. Note that this metric only represents the instantaneous value at the time of sampling and is for reference only due to constraints from the sampling interval and rate limiting strategy implementation. * Type: Gauge ### Kafka\_stream\_network\_outbound\_available\_bandwidth\_bytes Outbound throughput reserved for cold reads and Compaction on the Broker node—when this value is less than what is required for cold reads and Compaction outbound traffic, the respective requests are queued in the rate limiting queue, thus not affecting the normal message sending and receiving traffic. Note that this metric only represents the instantaneous value at the time of sampling and is for reference only due to constraints from the sampling interval and rate limiting strategy implementation. * Type: Gauge ### Kafka\_stream\_network\_inbound\_limiter\_queue\_time\_50p(99p/mean/max)\_nanoseconds The queuing time for incoming requests for cold reads and Compaction in the rate limiting queue during execution. * Type: Gauge ### Kafka\_stream\_network\_outbound\_limiter\_queue\_time\_50p(99p/mean/max)\_nanoseconds The queuing time for outgoing requests for cold reads and Compaction in the rate limiting queue during execution. * Type: Gauge ### Kafka\_stream\_operation\_latency\_50p(99p/mean/max)\_nanoseconds The operational duration of each stage in the AutoMQ S3Stream module. * Type: Gauge * Labels: * operation\_type * operation\_name ### Kafka\_stream\_cert\_expiry\_timestamp\_milliseconds This metric shows the expiration UNIX timestamp of the TLS certificate, measured in milliseconds. * Type: gauge * Labels: * instance: Instance ID. * job: Task identifier. * host\_name: System hostname. * cert\_subject: Certificate subject. * cert\_type: Certificate type, where `server_cert` represents a server certificate, and `truststore_cert` represents a CA certificate. ### Kafka\_stream\_cert\_days\_remaining This metric indicates the number of days remaining until the expiration of the TLS certificate from the current moment. * Type: gauge * Labels: * instance: Instance ID. * job: Task identifier. * host\_name: System hostname. * cert\_subject: Certificate subject. * cert\_type: Certificate type, where `server_cert` represents a server certificate, and `truststore_cert` represents a CA certificate. # Glossary Source: https://docs.automq.com/automq/reference/glossary AutoMQ offers cloud-native scalability, Kafka compatibility, and cost efficiency with unique modules like S3Stream and WAL. Explore our glossary for detailed insights. This article lists the technical terms and provides a brief overview of various modules involved in AutoMQ. ## Terminology Classification * **Cloud Service Concepts:** Covers the cloud services and product components used by AutoMQ. Users can refer to the documentation of each cloud provider for more detailed information. * **Apache Kafka Concepts:** Covers some existing concepts of Apache Kafka that may vary due to AutoMQ's implementation. * **AutoMQ Concepts:** Covers the new concepts defined within the various modules of AutoMQ. ## Cloud Service Terminology ### EBS EBS (Elastic Block Store) is a high-performance, scalable, durable, and low-latency block storage service. In AutoMQ's system design, EBS is used to temporarily store some message data that has not yet been uploaded to object storage, aiming to achieve lower message sending and receiving latency. Different cloud service providers may have different product names for EBS. ### S3 S3 (Simple Storage Service) is a secure, durable, and highly scalable object storage service. In AutoMQ's system design, object storage is used as the primary storage medium for messages, allowing for on-demand usage and pay-as-you-go pricing, reducing storage costs by up to 90% compared to Apache Kafka. S3 also refers to object storage in subsequent documentation, and different cloud service providers may have different product names for their object storage services. ### Bucket Bucket is the fundamental container for object storage services, used for efficient data management. When deploying AutoMQ, some Buckets need to be pre-allocated as message storage configuration. ### Auto Scaling Group (ASG) Auto Scaling Group (ASG) is a service that can automatically adjust computing resources to meet application load demands. ASG can automatically increase or decrease the number of instances in a group of virtual hosts, ensuring high availability of applications and optimizing costs. AutoMQ uses ASG to implement automatic elasticity and scaling features. Different cloud providers may use different product names for ASG. ## Apache Kafka Terminology ### Broker Broker is the logical role in the Apache Kafka system responsible for processing, storing, and transmitting messages. Multiple Broker nodes together form a Kafka cluster. In AutoMQ's system design, Broker specifically refers to the logical role that handles routine message sending and receiving, excluding the Controller role used for scheduling and allocation. ### Controller Controller is the logical role in the Apache Kafka system responsible for scheduling and coordinating task allocation among multiple nodes. Depending on the version, the Controller might have different implementation schemes. In AutoMQ's system design, the Controller is built on the KRaft mode, no longer relying on ZooKeeper services. Among multiple Controller nodes, there will be one Active Controller node serving as the primary decision-making node. ### Partition Partition is the logical shard of an Apache Kafka Topic, used to achieve parallel data processing and increase throughput. Each Partition is an ordered, immutable sequence of messages. In AutoMQ's system design, Partition retains its original functional definition but no longer stores data on local disks. Instead, it leverages object storage to achieve infinite capacity and on-demand scalability. ## AutoMQ Terminology ### AutoMQ AutoMQ is a next-generation Apache Kafka release redesigned based on cloud-native concepts, offering up to 10x lower TCO (see [Cost Benchmark](/automq/benchmarks/automq-vs-apache-kafka-benchmarks-and-cost)) and seconds-level scaling while being 100% compatible with the Apache Kafka protocol. ### S3Stream S3Stream is a low-latency, high-throughput, elastic, and cost-effective streaming repository built on cloud storage services, integrating externally through the Stream operation interface. AutoMQ replaces Apache Kafka's Log storage with S3Stream, ensuring 100% compatibility with Apache Kafka's upper-layer functionalities while offering up to 10x lower TCO (see [Cost Benchmark](/automq/benchmarks/automq-vs-apache-kafka-benchmarks-and-cost)) and seconds-level scaling. ### S3Url S3Url is a unified configuration item used by AutoMQ for rapid cluster deployment, containing information such as object storage access points and identity credentials. It is recommended to use the installation tool to generate the S3Url configuration to pre-validate parameter legality and resource compatibility, avoiding the cumbersome cluster ID generation and storage formatting operations in Apache Kafka. ### WAL WAL (Write-Ahead Log) is a high-throughput persistent write buffer in the S3Stream library. It temporarily caches data not yet committed to object storage. WAL supports multiple storage backends, including S3 WAL, EBS WAL, Regional EBS WAL, and NFS WAL. Latency characteristics depend on the backend: EBS WAL and Regional EBS WAL are designed for lower-latency workloads, while S3 WAL is the default option for AutoMQ Open Source and is better suited to latency-insensitive scenarios. In AutoMQ, WAL is allocated at the Broker level. When a Broker receives a message, it first writes the message sequentially to the WAL and immediately returns a client response, then asynchronously uploads the WAL data to object storage. ### Stream Object Stream Object is the smallest unit for storing Stream data in S3Stream. Data from each Stream is distributed across multiple Stream Objects, which collectively simulate an infinite Stream. ### Stream Set Object Stream Set Object is a temporary data structure in S3Stream used to merge scattered Stream write requests. When uploading the temporary data from WAL to object storage, data from multiple scattered Streams is merged into a single Stream Set Object before uploading. Subsequently, the Stream Set Object is asynchronously classified and organized into regular Stream Objects. # Release notes Source: https://docs.automq.com/automq/releases/release-notes # Software Artifact Source: https://docs.automq.com/automq/releases/software-artifact AutoMQ delivers cloud-native Kafka compatibility with full scalability, cost efficiency, and Java support. Deploy on Linux for optimal performance. AutoMQ is a cloud-native Kafka distribution developed entirely in the Java language, supporting most Java platforms. For optimal performance, deploy on the Linux operating system, preferably on amd64 or arm64 architecture. If you need further guidance on deployment, refer to [Deploy Multi-Nodes Cluster on Linux▸](/automq/deployment/deploy-multi-nodes-cluster-on-linux). ## Versioning AutoMQ adheres to the semantic versioning specification, formatted as `{major version}.{minor version}.{patch version}`, where: * major version: Incremented for significant upgrades or incompatible changes. * minor version: Incremented when new features are added while maintaining backward compatibility. * patch version: Used for bug fixes. Each AutoMQ version is compatible with specific versions of Apache Kafka. Refer to the [release notes](https://github.com/AutoMQ/automq/releases) for historical versions and detailed version mappings to choose the appropriate AutoMQ version. ## Software Artifacts > [tab] Binaries > > AutoMQ provides binary packages as pure Java installations, requiring Java 17 or later to run. You can use the following download script to obtain and deploy the latest version. Java 17 can be downloaded via the following link: [Java 17 Download Link](https://www.oracle.com/java/technologies/downloads/#java17). > > ```bash theme={null} > curl -O https://download.automq.com/community_edition/artifacts/automq-kafka-latest.tgz > ``` > [tab] Docker > > You can use the following command to get the latest release version Docker image. > > ```bash theme={null} > > docker pull automqinc/automq:latest > > ``` > > For more historical versions, visit [this link](https://hub.docker.com/r/automqinc/automq/tags). ## AutoMQ Open Source Code Refer to [Licensing and Enterprise Features▸](/automq/what-is-automq/licensing-and-enterprise-features). You can independently deploy clusters using AutoMQ Open Source, as its source code is publicly available. You can find the AutoMQ Open Source source code in the [GitHub project](https://github.com/AutoMQ/automq). # Overview Source: https://docs.automq.com/automq/table-topic/overview AutoMQ's Table Topic offers seamless Iceberg integration, auto-scaling, and ETL-free data lake ingestion, enhancing real-time analytics with S3 integration. Ideal for AWS. AutoMQ Table Topic provides built-in Iceberg integration, allowing streaming data to flow into the data lake for analysis and querying. This article introduces the technical architecture, principles, and core concepts related to the Table Topic feature. ## **Architecture and Benefits** The AutoMQ Table Topic feature enables one-stop real-time data lake entry and query analysis through its built-in stream table architecture. The technical architecture is outlined as follows: ![](https://mintcdn.com/automq/s9vNxeyMGZ1r1DRV/automq/table-topic/overview/1.webp?fit=max\&auto=format\&n=s9vNxeyMGZ1r1DRV\&q=85\&s=11e3a60f5260e8b7cf156c326675008b) Compared to traditional ETL data lake solutions, Table Topic offers the following advantages: * **Out-of-the-box:** With just one click, AutoMQ Table Topic can be activated, streaming data into Iceberg tables for continuous and real-time analysis. * **ETL-Free (Extract, Transform, Load):** Traditional data lake ingestion methods often require tools like Kafka Connect or Flink. Table Topic eliminates the need for such ETL pipelines, significantly cutting costs and reducing operational complexity. * **Auto-Scaling:** AutoMQ features a stateless and elastic architecture, enabling brokers to scale up or down with dynamic partition reassignment. Table Topic uses this framework to efficiently manage data ingestion rates ranging from hundreds of MiB/s to several GiB/s. * **Seamless Integration with AWS S3 Table:** Table Topic integrates with S3 Table, leveraging its Data Catalog and maintenance functions, such as compression, snapshot management, and unreferenced file deletion. This integration also enables large-scale data analytics via AWS Athena. ## Constraints and Limitations To utilize AutoMQ's Table Topic functionality, the following conditions must be met: * **Version Constraint:** Requires AutoMQ version >= 1.5. * **Feature Constraint:** The Table Topic feature must be configured at the time of deploying the AutoMQ cluster for subsequent use. Once the cluster is deployed, the Table Topic feature cannot be enabled. * **Catalog Requirements:** To use Table Topic, users must provide an externally accessible Data Catalog service. Currently, AutoMQ supports the following Catalog types: * **AWS S3 Table Catalog:** AWS S3 offers a new Table Bucket with integrated Catalog management and data lake storage. * **AWS Glue Catalog:** AWS Glue provides cloud-based unified Catalog management, supporting integration with query tools such as Athena. * **Hive Catalog:** Users can either set up their own Hive Metastore Catalog within the Hadoop ecosystem or choose a managed EMR HMS service offered by a cloud provider. ## Procedure To use the AutoMQ Table Topic feature, users should follow these configuration steps: ![](https://mintcdn.com/automq/s9vNxeyMGZ1r1DRV/automq/table-topic/overview/2.webp?fit=max\&auto=format\&n=s9vNxeyMGZ1r1DRV\&q=85\&s=7aa25c9a9a164511ad8b7bba97d53555) # Table Topic Configuration Source: https://docs.automq.com/automq/table-topic/table-topic-configuration Optimize your Kafka data management with AutoMQ's Table Topic feature. Enjoy seamless Kafka compatibility, cloud-native scalability, and cost-efficient Iceberg integration. This document outlines the configuration of the AutoMQ Table Topic feature, which includes the Schema Registry, Catalog, and the setup of the AutoMQ server. ## Schema Registry Configuration The Schema Registry manages the Kafka Topic message Schema, ensuring data consistency and compatibility between producers and consumers. AutoMQ Table Topic uses the Schema Registry to parse Topic data and synchronize with the Iceberg table structure, supporting Schema evolution. ### Constraints Table Topic supports only the following Schema Registry implementations. * **Confluent Schema Registry**: Facilitates schema management for Kafka and offers a REST API. * **Aiven Karapace**: An open-source Schema Registry that is compatible with the Confluent Schema Registry's REST API. > [!NOTE] > > For Schema Registry client options, use the `automq.table.topic.schema.registry.config.*` prefix. AutoMQ removes this prefix and passes the remaining keys to the Schema Registry client as `schema.registry.*` options. ### Configure Schema Registry Users specify the Schema Registry service address via the following parameters (cluster-level configuration). **Configuration Parameters**: * `automq.table.topic.schema.registry.url`: The URL of the Schema Registry (e.g., `http://schema-registry.example.com:8081`). AutoMQ uses this URL to retrieve and synchronize the Schema. * `automq.table.topic.schema.registry.config.*`: Optional Schema Registry client configuration. For example, `automq.table.topic.schema.registry.config.ssl.truststore.type=PEM` becomes `schema.registry.ssl.truststore.type=PEM`. **Note**: * Configure this when using the deprecated `automq.table.topic.schema.type=schema` value or when either `automq.table.topic.convert.value.type` or `automq.table.topic.convert.key.type` is set to `by_schema_id` or `by_latest_schema`. **Example**: ```properties theme={null} automq.table.topic.schema.registry.url=https://schema-registry.example.com:8081 automq.table.topic.schema.registry.config.ssl.truststore.type=PEM automq.table.topic.schema.registry.config.ssl.truststore.certificates=${CA_PEM} ``` ## Catalog Configuration In Apache Iceberg, the **Catalog** plays a crucial role in managing table metadata. Its primary responsibilities include: 1. **Tracking the current metadata pointer for each Iceberg table.** This pointer indicates the location of the latest metadata file (e.g., `vN.metadata.json`). 2. **Providing atomic operations to update this metadata pointer.** This is critical for ensuring data consistency during commit processes such as writing new data or evolving schemas. 3. **Organizing tables into namespaces** and providing methods to list, create, delete, and rename tables. Essentially, a Catalog serves as the entry point for any Iceberg operation, guiding the query engine on where to find authoritative information regarding a table's schema, partitions, snapshots, and data files. ### Configuring the Catalog Table Topic uses an external Iceberg Catalog to manage the metadata of its "table topics." * **General Configuration Prefix**: All Iceberg Catalog settings related to the AutoMQ Table Topic use the prefix `automq.table.topic.catalog.*`. * **Primary Configuration Key**: Specifies the type of Iceberg Catalog, as defined by the `automq.table.topic.catalog.type` attribute. * **Catalog option pass-through**: AutoMQ removes the `automq.table.topic.catalog.` prefix and passes the remaining key-value pairs to the Iceberg Catalog implementation. For example, `automq.table.topic.catalog.header.x-custom=my-x` becomes `header.x-custom=my-x`. Use this for Catalog-specific options such as REST headers, custom `io-impl`, or authentication properties. * **Hadoop option pass-through**: AutoMQ removes the `automq.table.topic.hadoop.` prefix and adds the remaining key-value pairs to the Hadoop configuration used by the Catalog. AutoMQ Table Topic supports the following catalog types: `rest`, `glue`, `tablebucket`, `nessie`, `hive`. ### Supported Catalog Types and Configuration #### 1. REST Catalog This method uses the standard Iceberg REST Catalog service. * **Type Setting**: `automq.table.topic.catalog.type=rest` * **Configuration Property**: * `automq.table.topic.catalog.uri` : The URI for the REST Catalog service (e.g., `http://rest:8181`). * `automq.table.topic.catalog.warehouse` : Defines the S3 path for the Iceberg data warehouse. If not set, it will default to the Iceberg directory of the DataBucket. * `automq.table.topic.catalog.oauth2-server-uri` : The OAuth2 token endpoint used by the REST Catalog client when client credentials authentication is enabled. * `automq.table.topic.catalog.credential` : The client credential used to fetch an OAuth2 token from the REST Catalog token endpoint. * `automq.table.topic.catalog.token` : A static bearer token. If this is set, REST Catalog requests use it in the HTTP Authorization header. * `automq.table.topic.catalog.scope` : The OAuth2 scope used when requesting a token through the client credentials flow. * `automq.table.topic.catalog.header.*` : Additional HTTP headers for REST Catalog requests. For example, `automq.table.topic.catalog.header.x-custom=my-x` sends `x-custom: my-x`. * **Required Permissions**: * Credentials (if authentication is needed) that allow listing, creating, reading, and updating table metadata. * AutoMQ requires read/write/delete permissions for the S3 warehouse path. **Example**: ```properties theme={null} automq.table.topic.catalog.type=rest automq.table.topic.catalog.uri=http://rest:8181 automq.table.topic.catalog.warehouse=s3://automq-bucket/wh/ ``` **Authentication examples**: ```properties theme={null} # Static bearer token automq.table.topic.catalog.type=rest automq.table.topic.catalog.uri=http://rest:8181 automq.table.topic.catalog.token=${REST_CATALOG_TOKEN} ``` ```properties theme={null} # OAuth2 client credentials automq.table.topic.catalog.type=rest automq.table.topic.catalog.uri=http://rest:8181 automq.table.topic.catalog.oauth2-server-uri=http://rest:8181/oauth/tokens automq.table.topic.catalog.credential=${CLIENT_ID}:${CLIENT_SECRET} automq.table.topic.catalog.scope=catalog ``` #### 2. AWS Glue Data Catalog Using AWS Glue as the Iceberg Catalog. * **Type Setting**: `automq.table.topic.catalog.type=glue` * **Configuration Property**: * `automq.table.topic.catalog.warehouse`: Specifies the S3 path for the Iceberg data warehouse. * **Required Permissions**: * AutoMQ requires database and table management permissions for AWS Glue. * AutoMQ needs read/write/delete permissions on the S3 warehouse path. **Example:** ```properties theme={null} automq.table.topic.catalog.type=glue automq.table.topic.catalog.warehouse=s3://automq-bucket/glue/ ``` #### 3. TableBucket (S3Table) * **Type Setting**: `automq.table.topic.catalog.type=tablebucket` * **Configuration Property**: * `automq.table.topic.catalog.warehouse`: Specifies the TableBucket ARN (e.g., `arn:aws:s3tables:::bucket-name`). * **Required Permissions**: * AutoMQ requires read and write access to the S3Table. **Example**: ```properties theme={null} automq.table.topic.catalog.type=tablebucket automq.table.topic.catalog.warehouse=arn:aws:s3tables:us-east-1:xxxxxx:bucket/xxxxx ``` #### 4. Nessie Catalog Use Project Nessie, a transactional data lake catalog with Git-like semantics. * **Type Setting**: `automq.table.topic.catalog.type=nessie` * **Configuration Property**: * `automq.table.topic.catalog.uri` : Specifies the URI of the Nessie server (e.g., `http://nessie-server:19120/api/v2` ). * `automq.table.topic.catalog.warehouse` : Defines the S3 path for the Iceberg data warehouse. If not set, it will default to the Iceberg directory of the DataBucket. **Example**: ```properties theme={null} automq.table.topic.catalog.type=nessie automq.table.topic.catalog.uri=http://nessie-server:19120/api/v2 automq.table.topic.catalog.warehouse=s3://automq-bucket/nessie/ ``` #### 5. Hive Metastore Catalog Use the existing Hive Metastore as an Iceberg Catalog. When configuring Hive Metastore as the Catalog, refer to [documentation](https://iceberg.apache.org/docs/latest/hive/#enabling-iceberg-support-in-hive) for enabling Iceberg in Hive. * **Type Setting**: `automq.table.topic.catalog.type=hive` * **Configuration Property**: * `automq.table.topic.catalog.uri`: Specifies the Hive Metastore URI (e.g., `thrift://hostname:9083`). * `automq.table.topic.catalog.warehouse` : Specifies the HDFS or S3 path for the Iceberg data warehouse. If not configured, the Iceberg directory of DataBucket will be used. * **Authentication Configuration**: * **Simple Authentication**: * `automq.table.topic.catalog.auth=simple://?username=xxx` . * **Kerberos Authentication**: ```properties theme={null} automq.table.topic.catalog.auth=kerberos://?principal=base64(clientPrincipal)&keytab=base64(keytabFile)&krb5conf=base64(krb5confFile) ``` * `clientPrincipal` : Base64 encoded client Kerberos principal. * `keytabFile`: Base64 encoded content of the client keytab file. * `krb5confFile`: Base64 encoded content of the `krb5.conf` file. * `automq.table.topic.hadoop.metastore.kerberos.principal`: Kerberos principal for the Hive Metastore server (e.g., `hive/_HOST@REALM`). * **Required Permissions**: * Create, alter, and drop table permissions for the Hive Metastore. * Kerberos authentication requires a valid principal and keytab. * AutoMQ needs read, write, and delete permissions in the repository path (HDFS or S3). **Example**: ```properties theme={null} automq.table.topic.catalog.type=hive automq.table.topic.catalog.uri=thrift://hostname:9083 automq.table.topic.catalog.warehouse=s3://automq-bucket/hive/ automq.table.topic.catalog.auth=simple://?username=user&password=pass ``` # Table Topic Configuration The following configurations are all topic-level settings that allow for enabling Table Topic features, adjusting the Iceberg commit interval, and configuring features such as partitioning and upsert. ## Enabling the Table Topic Feature The AutoMQ Table Topic feature allows for the conversion of data from a specified Kafka Topic into an Apache Iceberg table to support structured queries and analysis. **Configuration Parameters**: * `automq.table.topic.enable` : Determines whether the Table Topic is enabled. Setting this to `true` will result in the creation of an Iceberg table for data storage. * `automq.table.topic.namespace` : Specifies the namespace for the Iceberg table under the Catalog, adhering to the naming conventions of the Catalog (such as a combination of letters, numbers, and underscores). This should be configured at the time of Topic creation and cannot be modified later. * `automq.table.topic.schema.type` **(deprecated)**: \[DEPRECATED] The table topic schema type configuration. This setting will be removed in a future release. Please migrate to the converter and transform configurations. * `schemaless`: Maps to `automq.table.topic.convert.value.type=raw` and `automq.table.topic.transform.value.type=none`. * `schema`: Maps to `automq.table.topic.convert.value.type=by_schema_id` and `automq.table.topic.transform.value.type=flatten`. ```properties theme={null} automq.table.topic.enable=true automq.table.topic.namespace=default automq.table.topic.convert.value.type=by_schema_id automq.table.topic.transform.value.type=flatten ``` **Compatibility Example (deprecated)**: ```properties theme={null} automq.table.topic.schema.type=schema ``` ### Record Conversion Settings Decide how Table Topic parses Kafka records before they are written to Iceberg. **Value converter (`automq.table.topic.convert.value.type`)** * `raw`: Pass the Kafka payload through without interpretation. Use this when the downstream query only needs the opaque bytes (for example, storing binary blobs). Schema Registry is not consulted. * `string`: Decode the payload as UTF-8 text and expose it as a string column. Useful for topics that store plain text or JSON strings but you still want Iceberg queries to treat them as text. * `by_schema_id`: Resolve the schema ID encoded in the Confluent wire format (leading magic byte plus 4-byte schema ID) and deserialize Avro/Protobuf data using Schema Registry. Choose this for producers that already register schemas and include the schema ID with every record. * `by_latest_schema`: **Only supports Protobuf format**. Fetch the most recent schema from Schema Registry and use it to decode raw Protobuf payloads that do not carry a schema ID. Configure the subject and the fully qualified message name as described below. **Key converter (`automq.table.topic.convert.key.type`)** The key converter accepts the same options (`raw`, `string`, `by_schema_id`, `by_latest_schema`). Configure it when the Kafka record key is meaningful for your table: * Use `raw` when the key should stay opaque (for example, binary hash keys). * Use `string` when the key is textual. * Use `by_schema_id` or `by_latest_schema` when keys are structured Avro/Protobuf objects and you need individual fields for partitioning or equality deletes. **Configuring latest-schema lookup** When either converter uses `by_latest_schema`, the service needs hints to select the right schema version. * `automq.table.topic.convert.value.by_latest_schema.subject` (or the key variant) overrides the Schema Registry subject. If unset, it defaults to `-value` or `-key`. * `automq.table.topic.convert.value.by_latest_schema.message.full.name` (and the key equivalent) specifies the fully qualified Protobuf message name. If not configured, the system defaults to using the first message definition in the schema file; explicit specification is required when a single schema file contains multiple messages to avoid ambiguity. * The latest version of the subject is used, so align your Schema Registry retention and compatibility rules accordingly. ```properties theme={null} automq.table.topic.convert.value.type=by_latest_schema automq.table.topic.convert.value.by_latest_schema.subject=product-value automq.table.topic.convert.value.by_latest_schema.message.full.name=examples.clients.proto.ProductData ``` ### Value Transformation After conversion, you can apply an optional transformation to reshape the data before writing to Iceberg. * `none`: Persist the converted value as-is. Choose this when you only need the raw payload or when downstream consumers will parse it later. * `flatten`: Expand fields from structured Avro/Protobuf objects into top-level Iceberg columns. This is the typical choice for analytics-friendly tables. * `flatten_debezium`: A specialized transformer that extracts the row state from the Debezium envelope. It adds a `_cdc.op` field to indicate the operation type (e.g., 'c' for create, 'u' for update, 'd' for delete). This requires a schema-aware converter (`by_schema_id` or `by_latest_schema`). ```properties theme={null} automq.table.topic.transform.value.type=flatten_debezium automq.table.topic.convert.value.type=by_schema_id automq.table.topic.cdc.field=_cdc.op automq.table.topic.id.columns=[id] ``` #### Example: none vs flatten The following shows a single Kafka record and how query results differ between `none` and `flatten` value transformations. Kafka record (value payload): ```json theme={null} { "order_id": 1, "product_name": "str_1_xaji0y" } ``` * With `none`: ```properties theme={null} automq.table.topic.convert.value.type=by_schema_id automq.table.topic.transform.value.type=none ``` Query result: ```text theme={null} _kafka_value | _kafka_key | _kafka_metadata | _kafka_header --------------------------------------------------------+------------+--------------------------------------------------+--------------- {order_id=1, product_name=str_1_xaji0y} | | {partition=0, offset=0, timestamp=1762138970865} | {} ``` * With `flatten` (expanded business columns + system columns): ```properties theme={null} automq.table.topic.convert.value.type=by_schema_id automq.table.topic.transform.value.type=flatten ``` Query result (one row, illustrative): ```text theme={null} order_id | product_name | _kafka_header | _kafka_key | _kafka_metadata ----------+---------------+---------------+------------+-------------------------------------------------- 1 | str_1_xaji0y | {} | | {partition=0, offset=0, timestamp=1762138970865} ``` ### Error Handling The `automq.table.topic.errors.tolerance` property controls how the Table Topic pipeline behaves when it encounters errors during record conversion or transformation. * **`none`**: In this mode, any error encountered during processing will halt the pipeline for the affected topic partition. The system will continuously retry to process the problematic record, effectively blocking any further records from that partition until the issue is resolved. This mode guarantees that no data is skipped, but it can cause data processing to stall. * **`invalid_data` (default)**: This mode skips records with content issues, such as a missing magic code or an unresolvable schema ID (`InvalidDataException`). It continuously retries on `RestClientException` / `SerializationException` and exceptions in later processing stages to prevent data loss. Other data exceptions are skipped. This is the recommended setting for most production environments. * **`all`**: This mode skips any record that causes an exception. ```properties theme={null} automq.table.topic.errors.tolerance=invalid_data ``` ## Configuration Commit Interval To enhance real-time analytics, you can modify the commit frequency of an Iceberg table to improve data freshness. **Configuration Parameters**: * `automq.table.topic.commit.interval.ms`: Specifies the data commit interval in milliseconds. The default is 60,000 (1 minute). Valid values are from 1 to 900,000 (15 minutes). Shorter intervals improve real-time capability but increase processing overhead. **Note**: * Frequent commits may result in commit conflicts and MetadataFile bloat, which can raise storage and query costs. * AutoMQ automatically deletes snapshots that are older than one hour to prevent the `metadata.json` file from becoming excessively large over time. * Regular table maintenance is necessary through compaction to merge small files, optimizing the size of the `ManifestFile` and improving query performance. **Example**: ```properties theme={null} automq.table.topic.commit.interval.ms=60000 ``` ## Optimize Query Performance: Partition Configuration To enhance the query performance of Iceberg tables, especially in scenarios involving selective filtering, partitioning rules can be configured. **Configuration Parameters**: * `automq.table.topic.partition.by`: Specifies partitioning rules, supporting partitioning by fields or functions. For example, `[bucket(name, 3), month(timestamp)]` means partitioning by hashing the `name` field into 3 buckets and partitioning by the month of the `timestamp`. **Supported Partition Strategies**: * Bucket Partitioning: `bucket(field, N)`, partitions by the hash value of the field. * Truncate Partitioning: `truncate(field, N)`, partitions by the truncated value of the field. * Temporal Partitioning: `year(timestamp)`, `month(timestamp)`, `day(timestamp)`, `hour(timestamp)`. For more details, refer to [Iceberg Partitioning Documentation](https://iceberg.apache.org/docs/latest/partitioning/). **Note**: * Having too many partitions may increase metadata management overhead, leading to query planning delays and higher storage costs. It is recommended to set a reasonable number of partitions based on data volume and query patterns, and to regularly optimize small files through Compaction. **Example**: ```properties theme={null} automq.table.topic.partition.by=[bucket(name, 3), month(timestamp)] ``` ## Upsert and CDC Mode Support To facilitate Upsert or Change Data Capture (CDC) operations, you can enable the following features for dynamic data management. A primary key must be configured to support row-level operations. **Configuration Parameters**: * `automq.table.topic.id.columns`: Specify the primary key columns (composite keys are supported), such as `[region, name]`. * `automq.table.topic.upsert.enable`: Indicate whether to enable Upsert mode. Set to `true` to have the system insert or update records based on the primary key. * `automq.table.topic.cdc.field`: Indicates the type of CDC operation, which can be either `I` (insert), `U` (update), or `D` (delete). **Note**: * To enable Upsert or CDC mode, it is necessary to configure `automq.table.topic.id.columns`; otherwise, only append-only writes will be supported. * Iceberg V2 tables support row-level operations: * **Creation Logic**: Records inserted or updated are kept in the datafile, while deleted records are marked via a deletefile (which includes the primary key and deletion marker). An Upsert operation might create a new datafile, and the CDC's delete operation results in a deletefile. * **Query Logic**: Use the Merge-on-Read (MOR) mechanism to combine data files and delete files during queries, filtering out records marked for deletion using equality delete. * Enhance query performance consistently by merging data files and delete files through Compaction. **Example**: 1. Enable Upsert Mode: ```properties theme={null} automq.table.topic.upsert.enable=true automq.table.topic.id.columns=[id, name] ``` 2. Enable CDC Mode ```properties theme={null} automq.table.topic.cdc.field=op_type automq.table.topic.id.columns=[id, name] ``` # Table Topic Quick Start Source: https://docs.automq.com/automq/table-topic/table-topic-quick-start Discover seamless data integration with AutoMQ's Table Topic, enhancing data lakes through cloud-native scalability and Kafka compatibility. Perfect for swift trials. Table Topic is a core feature of AutoMQ, designed for modern data lake architectures. Its primary purpose is to create direct integration between streaming data and static data lakes through architectural innovation, addressing traditional issues like stream-batch separation, complex ETL processes, and high costs. This document is aimed at new users experiencing AutoMQ for the first time, focusing on how to deploy an AutoMQ cluster with Table Topic support in a local development environment (by deploying MinIO to provide object storage services), enabling users to quickly experience the features of Table Topic. > [!TIP] > > This document is intended solely for testing and learning scenarios. For production environments, please use the Table Topic feature and refer to deployment documentation such as [Deploy Multi-Nodes Cluster on Linux▸](/automq/deployment/deploy-multi-nodes-cluster-on-linux). ## Prerequisites * Linux/Mac/Windows Subsystem for Linux * Docker * Docker Compose version > 2.22.0 * At least 8GB of free memory ## Install and Start AutoMQ Cluster Run the following command to download the Docker Compose configuration file for a single-node deployment and start the AutoMQ cluster using Docker Compose. ```bash theme={null} curl -O https://raw.githubusercontent.com/AutoMQ/automq/refs/tags/1.5.5/docker/table_topic/docker-compose.yml && docker-compose up -d ``` Once started successfully, we will send Table Topic messages and perform queries using Spark SQL to experience automatic table creation, table querying and updating, schema changes, data partitioning, and CDC capabilities. Users can open [http://localhost:8888](http://localhost:8888) in their browser and interactively execute commands using Jupyter Notebook. ![](https://mintcdn.com/automq/s9vNxeyMGZ1r1DRV/automq/table-topic/table-topic-quick-start/1.webp?fit=max\&auto=format\&n=s9vNxeyMGZ1r1DRV\&q=85\&s=e9cca71194f523431750ca97ee38c298) ## Create Table The first three steps in the Notebook involve the creation of a Table Topic, writing a single message, and triggering the creation of an Iceberg table. ![](https://mintcdn.com/automq/s9vNxeyMGZ1r1DRV/automq/table-topic/table-topic-quick-start/2.webp?fit=max\&auto=format\&n=s9vNxeyMGZ1r1DRV\&q=85\&s=c9d4b7ac946534c9fa21d6f40fa0862d) ## Query Data ![](https://mintcdn.com/automq/s9vNxeyMGZ1r1DRV/automq/table-topic/table-topic-quick-start/3.webp?fit=max\&auto=format\&n=s9vNxeyMGZ1r1DRV\&q=85\&s=dbf13af21f4bf29c59286ac967f8c3fa) > [!TIP] > > **Note:** > > There may be a delay between writing the message and the data being entered into the table. If an error occurs during the query, we recommend retrying after a short wait. ## Update Records ![](https://mintcdn.com/automq/s9vNxeyMGZ1r1DRV/automq/table-topic/table-topic-quick-start/4.webp?fit=max\&auto=format\&n=s9vNxeyMGZ1r1DRV\&q=85\&s=df71713449e7501c5e9dcadd7ce961f0) When querying updated results, the data `ops` will change from `I` to `U`. ![](https://mintcdn.com/automq/s9vNxeyMGZ1r1DRV/automq/table-topic/table-topic-quick-start/5.webp?fit=max\&auto=format\&n=s9vNxeyMGZ1r1DRV\&q=85\&s=2c8f028c18671275b36f439085d69af9) ## Delete Data ![](https://mintcdn.com/automq/s9vNxeyMGZ1r1DRV/automq/table-topic/table-topic-quick-start/6.webp?fit=max\&auto=format\&n=s9vNxeyMGZ1r1DRV\&q=85\&s=7784cedeb1077756b41a2ee70511d8cc) After querying the deletion results, records are empty. ![](https://mintcdn.com/automq/s9vNxeyMGZ1r1DRV/automq/table-topic/table-topic-quick-start/7.webp?fit=max\&auto=format\&n=s9vNxeyMGZ1r1DRV\&q=85\&s=561fb20be3619642407c172d27ea4750) ## Delete Table ![](https://mintcdn.com/automq/s9vNxeyMGZ1r1DRV/automq/table-topic/table-topic-quick-start/8.webp?fit=max\&auto=format\&n=s9vNxeyMGZ1r1DRV\&q=85\&s=4da82b27805ab79ad4f8bf4bd354f912) ## Stop and Uninstall the AutoMQ Cluster Once you have completed the functional tests, run the following commands to stop and uninstall the current AutoMQ cluster. ```bash theme={null} curl -O https://raw.githubusercontent.com/AutoMQ/automq/refs/tags/1.5.0/docker/table_topic/docker-compose.yml && docker-compose down -v ``` > [!TIP] > > For detailed parameter configurations, please refer to the [Table Topic Configuration▸](/automq/table-topic/table-topic-configuration) section. # Compatibility with Apache Kafka Source: https://docs.automq.com/automq/what-is-automq/compatibility-with-apache-kafka AutoMQ is a cloud-native, Kafka-compatible service offering seamless integration with Apache Kafka. Enjoy scalable, cost-efficient performance while maintaining API compatibility. AutoMQ is a next-generation Apache Kafka distribution reimagined with cloud-native principles, fully compatible with Apache Kafka protocols and features. This document provides a comprehensive overview of AutoMQ's compatibility across different versions. ## Apache Kafka Compatibility Overview AutoMQ strategically leverages the Apache Kafka computing layer code, making only minimal modifications in the storage layer. This approach ensures full compatibility with relevant versions of Apache Kafka. Applications built on Apache Kafka can transition to AutoMQ seamlessly. During the compatibility verification phase, AutoMQ employed Apache Kafka's test case projects and successfully passed the tests for relevant versions. AutoMQ corresponds directly to Apache Kafka version numbers. For details on the compatibility between AutoMQ and Apache Kafka versions, please refer to the [Release Notes▸](https://github.com/AutoMQ/automq/releases/). Each AutoMQ version ensures compatibility with Kafka Client, Connector, Proxy, and other components within the Apache Kafka ecosystem. > [!NOTE] > > AutoMQ achieves adaptation to Apache Kafka by replacing micro facets at the storage layer, allowing for swift adaptation to new community versions. It supports the latest updates to Apache Kafka versions within T+1 month. ## Compatibility with Products in the Apache Kafka Ecosystem AutoMQ's complete compatibility with Apache Kafka enables direct integration with all ecosystem products. The following Apache Kafka ecosystem products have passed AutoMQ's compatibility tests and are available for use. ### Data Analysis * [RisingWave▸](/automq/integrations/data-analysis/risingwave) * [Databend▸](/automq/integrations/data-analysis/databend) * [Apache Doris▸](/automq/integrations/data-analysis/apache-doris) * [Flink▸](/automq/integrations/data-analysis/flink) * [StarRocks▸](/automq/integrations/data-analysis/starrocks) ### Kafka UI * [Kafdrop▸](/automq/integrations/kafka-ui/kafdrop) * [Redpanda Console▸](/automq/integrations/kafka-ui/redpanda-console) ### Observability * [Prometheus/VictoriaMetrics▸](/automq/integrations/observability/prometheus) * [Guance Cloud▸](/automq/integrations/observability/guance-cloud) * [Flashcat▸](/automq/integrations/observability/flashcat) ### Data Integration * [Debezium▸](/automq/integrations/data-integration/debezium) * [Airbyte▸](/automq/integrations/data-integration/airbyte) # Difference with Apache Kafka Source: https://docs.automq.com/automq/what-is-automq/difference-with-apache-kafka AutoMQ delivers cloud-native scalability and cost efficiency while ensuring 100% API compatibility with Apache Kafka. Experience up to 10x cost savings and enhanced flexibility. AutoMQ is a next-generation Apache Kafka® distribution redesigned with cloud-native principles. It offers up to 10x lower TCO ([see benchmark](/automq/benchmarks/automq-vs-apache-kafka-benchmarks-and-cost)) and elasticity advantages while maintaining 100% compatibility with the Apache Kafka® protocol. This article primarily introduces the main differences and connections between AutoMQ and Apache Kafka®. ## Differences from Apache Kafka® ### Architecture: Shared Nothing Vs Shared Storage Apache Kafka® uses local disk storage and constructs a highly reliable storage system through software-level high availability replica replication logic (ISR mechanism). This provides a "limitless" stream storage abstraction to the business logic side. All Kafka® data is stored on local disk media according to specific logic, a method generally referred to as a Shared Nothing architecture. AutoMQ differs from Apache Kafka® by adopting a compute-storage separation approach. Instead of using local disks, it uses shared object storage services to store data. AutoMQ abstracts an S3Stream storage repository (software library) to replace Apache Kafka®'s local log storage. This transparent use of object storage to store Kafka® data while ensuring the upper layer Apache Kafka® functionalities and semantics remain unchanged is known as a Shared Storage architecture. ![Architecture comparison: Apache Kafka Shared Nothing architecture vs AutoMQ Shared Storage architecture](https://mintcdn.com/automq/s9vNxeyMGZ1r1DRV/automq/what-is-automq/difference-with-apache-kafka/1.webp?fit=max\&auto=format\&n=s9vNxeyMGZ1r1DRV\&q=85\&s=5b38761d79cfe8c2be3e70f6721fef7a) A comparison of the two different architectures of Apache Kafka® and AutoMQ is as follows: | **Apache Kafka** Utilizes Shared Nothing architecture | **AutoMQ** Utilizes Shared Storage architecture | | - | - | | Data is stored on local disks, requiring cross-node multiple replica replication | Data is stored in S3 shared storage (high reliability with three replicas), eliminating the need for multiple replica replication | | Data is isolated across nodes, and data access is bound to specific nodes. | Data is shared across nodes, allowing cross-node access. | | When adding nodes for horizontal scaling or replacing faulty nodes, shard data must be reassigned. | When adding nodes or replacing faulty nodes, data reassignment is not needed for quick switching. | > [!NOTE] > > Since version 3.6, Apache Kafka has been planning tiered storage capabilities (not yet production-ready), which supports the offloading of historical data to object storage services. This architecture shares certain similarities and differences with AutoMQ, which fully relies on object storage to construct its storage layer. For a detailed comparison, see [Difference with Tiered Storage▸](/automq/what-is-automq/difference-with-tiered-storage). ### Flexibility: Second-level Partition Reassignment vs. Hour-level Partition Reassignment Partition reassignment is a frequent and unavoidable issue in Apache Kafka production environments, required in scenarios like **partial node failures, cluster scaling, and partial hotspot handling**. Apache Kafka uses a Shared Nothing architecture, where each partition's data is stored entirely on specific storage nodes. When partition reassignment is involved, the full data of the partition must be transferred to the new target node before service can be provided. This process can be time-consuming and unpredictable. > [!NOTE] > > **Example:** > > For a Kafka partition with a write throughput of 100MiB/s, the data generated in one day is approximately 8.2TiB. If this partition needs to be reassigned, all the data must be moved to another node. Even with a network bandwidth of 1Gbps, it would take hours to complete the reassignment. AutoMQ adopts a storage-compute separation architecture, where the entire data of each partition is stored in S3 object storage. During partition reassignment, only a small amount of metadata needs to be synchronized to complete the switch. AutoMQ can ensure the switch is completed in seconds for partitions with any write throughput scale. AutoMQ supports second-level partition reassignment, providing AutoMQ with faster and more predictable flexibility advantages over Apache Kafka in scenarios such as cluster scaling and fault recovery. ### Cost: 10x Cost Difference Referencing the above architectural differences, AutoMQ and Apache Kafka also have significant cost structure differences in terms of computing and storage. AutoMQ does not require cross-node multiple replica replication when writing messages, saving most of the cross-node replication traffic and pressure. Additionally, AutoMQ uses S3 object storage as the storage medium, which is far less costly than mounting EBS block storage to each node in typical Public Cloud environments. The specific comparison items are as follows: | **Cost Comparison** | **Apache Kafka** | **AutoMQ** | | - | - | - | | Storage Unit Price |
  • Scenario: 1GB data requires 3GB EBS (three replicas)
  • Cost: 0.288 USD/month
|
  • Scenario: 1GB business data requires 1GB S3
  • Cost: 0.023 USD/month
| | Cross-Node Replication Traffic |
  • Scenario: Writing 1GB of data requires cross-node replication of 2GB traffic (three replicas)
  • Cost: 0.04 USD
|
  • Scenario: Writing 1GB of data, directly uploading to S3, no cross-node traffic needed (three replicas)
  • Cost: 0 USD
| > [!NOTE] > > The storage unit prices above are based on a comparison between AWS S3 US East EBS GP3 instances and S3 Standard storage. For detailed information, refer to [AWS S3 Pricing](https://aws.amazon.com/cn/s3/pricing/?did=ap_card\&trk=ap_card). > > The cross-node replication traffic costs above are based on the cost of data transfer between AWS AZs. > > For a detailed cost comparison between AutoMQ and Apache Kafka, refer to [AutoMQ vs. Apache Kafka Benchmarks and Cost▸](/automq/benchmarks/automq-vs-apache-kafka-benchmarks-and-cost). ### Capacity: Reserved Vs Pay-as-you-go Capacity planning is another challenge when Kafka is applied on a large scale in production environments. Due to the architectural differences and storage media differences between AutoMQ and Apache Kafka, there are differences in capacity planning: | **Apache Kafka** Uses local disks, integrated storage and compute | **AutoMQ** Uses S3 object storage, separated storage and compute | | - | - | | Disk space must be reserved in advance | Storage space is on-demand, pay-as-you-go | | Limited storage on a single node, poor storage scalability | S3 object storage space is nearly unlimited, with good storage scalability | ## 100% Compatible with Apache Kafka® As a redesigned, next-generation Kafka release, AutoMQ provides a cost-effective and elastic alternative while ensuring 100% compatibility with Apache Kafka®. Applications based on Apache Kafka can migrate to AutoMQ without any modifications or adaptations. Referencing the architectural comparison above, AutoMQ abstracts the S3Stream storage repository to replace Apache Kafka's local log storage at the storage layer. The storage layer exposes the same Partition abstraction to the upper layers, allowing modules such as KRaft metadata management, Coordinator, ReplicaManager, and KafkaApis to reuse the original code logic. The storage layer reuses Apache Kafka's logic. AutoMQ supports 100% compatibility with Apache Kafka protocols and semantics and can continuously follow the latest features and bug fixes of Apache Kafka. For compatibility details between AutoMQ and Apache Kafka, see [Compatibility with Apache Kafka▸](/automq/what-is-automq/compatibility-with-apache-kafka). # Difference with Tiered Storage Source: https://docs.automq.com/automq/what-is-automq/difference-with-tiered-storage AutoMQ offers seamless cloud-native scalability, cost-efficient storage, and Kafka compatibility by leveraging object storage and treating cloud storage as a service, ensuring stateless and rapid partition reassignments. AutoMQ uses object storage as its primary storage service, while Apache Kafka® introduced tiered storage with [KIP-405](https://cwiki.apache.org/confluence/display/KAFKA/KIP-405%3A+Kafka+Tiered+Storage) starting from version 3.6.0, leveraging object storage to offload historical data. The [Overview▸](/automq/architecture/s3stream-shared-streaming-storage/overview) of AutoMQ consists of WAL (Write-Ahead Logging) storage and data main memory, whereas Kafka's tiered storage includes primary EBS storage and secondary object storage. Developers often assume AutoMQ's WAL storage is similar to Kafka's primary EBS storage, but they fundamentally differ. This article will highlight the advantages and differences of AutoMQ in comparison to Apache Kafka's tiered storage. ## Architectural Differences According to the design outlined in [KIP-405](https://cwiki.apache.org/confluence/display/KAFKA/KIP-405%3A+Kafka+Tiered+Storage), Apache Kafka's tiered storage version adopts a two-tier storage approach, relying on both local disk and object storage. Message data is initially written to the local disk and then asynchronously uploaded to object storage based on a cooling-off strategy. Since local disks are susceptible to failure, each message needs to be replicated across multiple disks on different nodes via the ISR mechanism to ensure durability. Currently, when deploying the tiered storage version in a Public Cloud environment, Apache Kafka's architecture remains unchanged, still using EBS as a replacement for local disks, requiring messages to be replicated across multiple EBS instances. In summary, **Apache Kafka still treats EBS as a standard block storage device**, with no fundamental difference from a physical hard drive in a local data center. AutoMQ employs object storage as its primary storage method, without the concept of storage tiers. However, to optimize storage efficiency, such as reducing latency for writing to object storage and improving write efficiency for large partitions, AutoMQ introduces a WAL storage mechanism. The architectural comparison is as follows: ![Storage architecture comparison: AutoMQ WAL storage and object storage vs Apache Kafka Tiered Storage with EBS primary and object storage secondary](https://mintcdn.com/automq/s9vNxeyMGZ1r1DRV/automq/what-is-automq/difference-with-tiered-storage/1.webp?fit=max\&auto=format\&n=s9vNxeyMGZ1r1DRV\&q=85\&s=fec16a36ac9c4108d84402930dc4cbf2) Since WAL storage can use EBS as storage media, developers might think it has similarities with Kafka's primary storage. However, WAL storage fundamentally differs from Kafka in terms of design philosophy and implementation, including storage responsibilities, storage efficiency, storage space, storage media, durability, and multi-AZ disaster recovery design. Please refer to the table below for detailed differences: | - | WAL Storage | Kafka Tier 1 Storage | | - | - | - | | Responsibilities | Similar to a database Binlog, used for quick data persistence writes and data recovery during failures. | Core data storage, providing read, write, and replay functionalities. | | Storage Efficiency | Centralized storage, mixing all partitions' data into one WAL file or object, offering high write efficiency and low IOPS consumption. | Decentralized storage, where the system uses independent file lists to store data of each partition, resulting in low write efficiency and high IOPS consumption. | | Storage Space | Occupies less space, around 10GiB, with deterministic storage needs. | Occupies large and uncertain space, requiring capacity assessment, with single nodes typically needing several hundred GiB. | | Storage Medium | Can choose block storage, object storage, or file storage provided by cloud providers based on latency level and durability requirements. | Usually recommended to use local hard drives or block storage services provided by cloud vendors. | | Durability Guarantee | Utilizing multiple replicas or EC (Erasure Coding) technologies in cloud storage services, data durability can generally reach reliability levels between 99.999% and 99.999999999%. | Apache Kafka's ISR replica mechanism provides reliability but does not guarantee durability metrics. | | Multi-AZ Disaster Recovery | Cloud providers offer regional EBS, object storage, and file storage (such as AWS EFS and FSx) with multi-AZ data durability, and they waive Inter-Zone replication traffic fees. | Using ISR to implement Inter-Zone data replication will incur Inter-Zone traffic replication fees. | ## Cost Advantage In Apache Kafka's tiered storage architecture, the first tier of EBS storage is still used as the primary storage for read and write operations. Each Kafka partition must retain at least the latest active segment on the first tier storage. This leads to the following phenomenon: * EBS space is uncertain and directly related to the number of partitions in the cluster. * Reserving a large EBS space in the production environment is necessary to reduce risks. * EBS reservation costs are high, and the cost reduction potential through tiered storage is limited. > [!NOTE] > > **Example:** > > Taking the default configuration of Apache Kafka® as an example, with each segment size set to 1GB, if the number of active partitions is 1000, it still requires reserving 1TB of EBS. In AutoMQ's architecture, object storage is used as the primary storage. WAL storage provides a lightweight buffer for fault recovery, with multiple backend options available. For example, with EBS WAL, each AutoMQ Broker node only needs a 2GB EBS volume and can guarantee the temporary storage of approximately 500MB of data (the aforementioned space sizes are customizable). With S3 WAL (the default for AutoMQ Open Source), no additional block storage is needed at all. This design ensures that AutoMQ's WAL space consumption is **predictable**. When using EBS WAL, the additional storage cost remains low because the required EBS volume is small. When using S3 WAL (the default for AutoMQ Open Source), no additional block storage cost is incurred at all. ## Operations Advantage Due to the non-fixed primary storage space in Apache Kafka's multi-tiered storage architecture, the data left on EBS for each partition is also non-fixed. Therefore, during operations like elastic scaling and fault reassignment, the time required is also uncertain, making quick scaling unachievable. While AutoMQ's buffer only contains up to 500MB of data that needs to be uploaded to object storage, the upload can be completed within seconds, thereby supporting second-level partition reassignment. > [!NOTE] > > In the case of Confluent, an expansion operation on a high-traffic cluster takes 43 hours in a non-tiered storage architecture and still requires 1.4 hours in a tiered storage architecture. ## Summary Compared to Apache Kafka's tiered storage solution, AutoMQ represents a qualitative leap driven by quantitative changes. Through architectural optimization, AutoMQ achieves a "stateless" state, allowing for arbitrary scaling and second-level partition reassignments. In contrast, Apache Kafka's tiered storage architecture remains an optimized yet stateful solution, making it challenging to achieve lightweight scaling and partition reassignment. # Licensing and Enterprise Features Source: https://docs.automq.com/automq/what-is-automq/licensing-and-enterprise-features AutoMQ offers cloud-native scalability and cost-efficient Kafka compatibility, reducing deployment hassles with its fully managed cloud services and open-source options. Users can follow the deployment methods listed below to install and use AutoMQ: * **Install AutoMQ Open Source:** Deploy and operate AutoMQ Open Source within your private network environment or data center. * **AutoMQ Cloud Service (Recommended):** Simplify the process by directly enabling the AutoMQ Cloud service in a public cloud environment, thereby avoiding installation and maintenance hassles. AutoMQ Cloud is a fully managed, maintenance-free cloud service provided by the AutoMQ team. For more details, please refer to the [reference documentation](https://docs.automq.com/automq-cloud/getting-started/install-byoc-environment/aws/install-automq-on-aws). > [!TIP] > > AutoMQ Cloud provides developers with a 30-day free trial credit worth \$1,400, without the need for credit card registration or payment information. ## AutoMQ Open Source AutoMQ Open Source is covered under the [Apache License 2.0](https://github.com/AutoMQ/automq/blob/main/LICENSE), and the source code for all related functionalities is available for review in the [GitHub project](https://github.com/AutoMQ/automq). AutoMQ Open Source is fully production-ready and widely deployed across numerous industry-leading enterprises; however, significant challenges remain with self-hosting distributed storage software. For best practices in the open-source community regarding deployment, operations, monitoring, and performance tuning, please reach out to [Community Support](https://www.automq.com/contact). ## Product Comparison Below is a comparison between AutoMQ Open Source and AutoMQ BYOC: | **Product Name** | **AutoMQ Open Source** | **AutoMQ BYOC** | | - | - | - | | **Service Model** | Open-source software (Apache License 2) | Fully managed service, AutoMQ BYOC deployment \[1] | | **Deployment Environment** | Supported cloud providers:
  • AWS
  • Other cloud providers (compatible with S3 API)
Private data centers require the following storage software:
  • MinIO
  • Ceph
  • CubeFS
  • Other software compatible with S3 protocol
| Supported mainstream cloud providers:
  • AWS
  • Azure
  • GCP
  • OCI
  • Other cloud providers supporting object storage
| | **WAL Storage Engine** | S3 WAL Produce RT: P99 600+ milliseconds | Low-latency storage WAL (EBS, FSx) Produce RT: P99 \< 10 milliseconds | | **Self-Balancing** | Basic scheduling strategy, balancing network throughput only | Comprehensive multi-metric scheduling strategy, balancing the following metrics:
  • Network throughput
  • Request QPS
  • Data cold read accumulation
  • Slow node isolation
| | **Cluster Migration** | Open-source MirrorMaker2 has the following issues:
  • Message replication offset inconsistency
  • Cluster switching requires downtime
| Kafka Linking, a non-downtime migration tool, supports:
  • Offset-consistent ByteToByte message synchronization
  • Non-downtime rolling cluster switch
| | **Enterprise Product Features** | None |
  • Out-of-the-box UI for managing cluster, Topic, and Group resources
  • Metrics integration: Prometheus, CloudWatch, etc.
  • Operation audit
  • RBAC & SSO
  • Terraform
| | **Disaster Recovery** |
  • Self-healing server failures
|
  • Self-healing server failures
  • Object storage redundancy
  • Multi-cloud redundancy
| | **Resource Ownership** | IaaS resources owned by users | Under BYOC model, IaaS resources belong to the customer | | **Data Sovereignty** | 100% private, data stays within the user's private network | Under BYOC model, data remains within user's private network VPC | | **Operation Method** | Self-deployment and operation | One-click activation through cloud marketplace, official website, etc., fully managed services covering the following scenarios:
  • Deployment
  • Version upgrades (new features and bug fixes)
  • Parameter tuning
  • System alerts\[2]
  • Online fault handling\[3]
| | **Cost Structure** |
  • Machine resource costs (self-provided)
  • Operations and development manpower investment
  • **Commercial paid technical consultation (optional)**
|
  • Subscription fees
  • Cloud resource costs (only in BYOC mode), direct payment to cloud providers
| | **Technical Support** |
  • None
  • Community technical support
|
  • Expert technical support
  • Online emergency response support
| * \[1] involves deploying both the control plane and the data plane of AutoMQ BYOC under the customer's primary account VPC. * \[2] During the operation of the AutoMQ Server, all generated logs, metrics, and diagnostic data will be stored in a separate object storage bucket. Customers need to grant cross-account permissions for this bucket to the AutoMQ team's main account. The AutoMQ operations platform will analyze the logs and metrics of customer clusters in real-time to ensure stable cluster operation, supported by AutoMQ's professional R\&D team. * \[3] AutoMQ Server is outfitted with automatic fault recovery capabilities, offering real-time monitoring of various cluster performance metrics and automatically isolating any nodes that show anomalies. This ensures fault recovery occurs before any failure impacts the application, usually completing this process within minutes. Following this, engineers from the AutoMQ team carry out a backend analysis to determine the fault's causes. > If you're interested in evaluating our cloud services or need paid technical support, [please fill out the form, and our product experts will get in touch with you promptly.](https://www.automq.com/contact) # Overview Source: https://docs.automq.com/automq/what-is-automq/overview AutoMQ is a cloud-native, fully Kafka-compatible streaming platform built on S3. It reduces storage costs by up to 90% and delivers seconds-level elasticity. # What Is AutoMQ AutoMQ is a cloud-native streaming platform that is fully compatible with Apache Kafka. Built on object storage (S3), AutoMQ delivers up to **10x lower TCO** ([see benchmark](/automq/benchmarks/automq-vs-apache-kafka-benchmarks-and-cost)) and **seconds-level elasticity** compared to self-managed Kafka. ## Why AutoMQ: The Cloud Changed Everything Apache Kafka was designed over a decade ago for on-premise data centers, where disks were physically attached to servers and hardware failures were common. To handle this reality, Kafka adopted a Shared Nothing architecture: each broker manages its own local storage, and data is replicated across multiple nodes for durability and availability. This made perfect sense for the infrastructure of that era. But the cloud fundamentally changed the rules. In cloud environments, compute and storage are decoupled by design. Services like AWS S3 deliver 99.999999999% durability with production-grade SLAs. Storage is no longer a liability—it's a managed, virtually infinite resource. Yet when Kafka is lifted-and-shifted to the cloud, it still treats storage as unreliable local disks, replicating data multiple times across brokers. The result: redundant replication on top of already-durable cloud storage, leading to unnecessary compute, storage, and network costs. Kafka remains the de facto standard for data streaming—the backbone of modern data infrastructure. A technology this critical deserves an architecture built for the cloud, not just deployed on it. That's why we created AutoMQ. ## Design Philosophy ### Rewrite Storage, Preserve Compute AutoMQ is not a ground-up rewrite of Kafka. After a decade of development, Kafka has a battle-tested compute layer with sophisticated APIs, complex protocol handling, and proven production reliability. Rewriting all of this would be both impractical and unnecessary. The real problem is storage. Kafka's Shared Nothing storage architecture—designed for unreliable local disks—is the root cause of its cloud inefficiency. Our strategy is surgical: replace the storage layer while keeping the compute layer intact. This approach delivers: * **100% Kafka API compatibility**—every client, every protocol version works unchanged * **100% ecosystem compatibility**—Kafka Connect, Kafka Streams, Schema Registry, and MirrorMaker work out of the box * **Migration without application changes**—existing workloads move to AutoMQ without application changes ### S3-First, Diskless Architecture We chose S3 as AutoMQ's storage foundation. S3 is the largest-scale storage service in the cloud, and that scale is precisely why it works: massive scale enables elasticity, pay-per-use pricing, and unmatched cost efficiency. S3 by the numbers: * **500+ trillion objects** stored globally * **>1 PB/s** peak traffic capacity * **1/10 the cost** of block storage * **Universal availability**—every region, every major cloud, accessible via simple HTTP S3 isn't just an AWS service—it's a cloud standard. Nearly every provider offers S3-compatible storage, making AutoMQ portable across clouds. By building on S3, AutoMQ brokers become completely diskless. No local storage means no state, and stateless brokers can be replaced instantly, scheduled anywhere, and scaled without data migration. ### Built for Cloud Economics True cloud-native means designing for how the cloud actually works—not just running traditional software on cloud VMs. AutoMQ is architected around cloud primitives: * **Cloud storage for durability**—leverage S3's eleven 9s instead of application-level replication * **Cloud APIs for orchestration**—automated scaling, recovery, and resource management * **Cloud pricing models**—Spot Instances, pay-per-use, no over-provisioning In on-premise environments, capacity changes require procurement cycles. In the cloud, resources arrive via API in seconds. AutoMQ embraces this reality: scale out instantly when traffic spikes, scale in when it drops, and never pay for idle capacity. ## Key Benefits ### Simplified Operations Running self-managed Kafka requires significant operational investment: disk provisioning, capacity planning, manual partition rebalancing, and around-the-clock monitoring for disk failures. These tasks create on-call burden and slow down your team. AutoMQ's stateless architecture eliminates these operational challenges: * **No disk management**—brokers store no persistent data locally, removing the need for disk provisioning, RAID configuration, and capacity planning * **Automatic failover**—when a broker fails, a replacement takes over in seconds without data recovery or manual intervention * **Self-balancing clusters**—partitions automatically redistribute as brokers join or leave the cluster ### Scale in Seconds, Not Hours Scaling self-managed Kafka is notoriously difficult. Adding brokers triggers partition reassignment, which copies terabytes of data across the network—a process that can take hours or days. Worse, this replication traffic competes with production workloads, potentially degrading performance exactly when you need more capacity. Because all data resides in S3, AutoMQ scaling requires no data migration: * **Seconds-level partition reassignment**—what takes hours in traditional Kafka completes in seconds * **On-demand capacity**—add brokers during traffic spikes, remove them when demand drops * **Native auto-scaling integration**—connect to cloud auto-scaling groups for fully automated capacity management This matters for business continuity. When traffic spikes unexpectedly, you can't afford to wait hours for rebalancing to complete. With AutoMQ, capacity scales as fast as your business needs it—protecting revenue and customer experience during peak demand. ### Lower Costs AutoMQ reduces total cost of ownership by up to 10x lower TCO compared to self-managed Kafka ([see benchmark](/automq/benchmarks/automq-vs-apache-kafka-benchmarks-and-cost)): * **Storage costs reduced by 90%**—S3 is approximately 1/10 the price of EBS, and AutoMQ eliminates the 3x replication overhead of traditional Kafka * **Zero cross-AZ traffic fees**—shared storage architecture removes the expensive cross-AZ data transfer that multi-AZ Kafka deployments require * **Pay for what you use**—scale down during off-peak hours instead of provisioning for peak capacity ## Next Steps Ready to get started? Here's where to go next: * [Deploy Multi-Node Test Cluster on Docker](/automq/getting-started/deploy-multi-nodes-test-cluster-on-docker) — Get hands-on with AutoMQ in minutes * [Technical Architecture](/automq/architecture/overview) — Understand how AutoMQ works under the hood * [Difference with Apache Kafka](/automq/what-is-automq/difference-with-apache-kafka) — See a detailed comparison # AutoMQ Documentation Source: https://docs.automq.com/index # AutoMQ Documentation Comprehensive guides for AutoMQ - the S3-native diskless Kafka® with 10x cost savings and serverless scaling ## AutoMQ BYOC > [card] [Get started](/automq-cloud/getting-started/install-byoc-environment/aws/install-automq-on-aws) > > Install AutoMQ from the AWS Marketplace. > [card] [Deploy on Kubernetes](/automq-cloud/deploy-automq-on-kubernetes/overview) > > Deploy AutoMQ on AWS EKS, Azure AKS, or Google Cloud GKE. > [card] [Subscriptions & Billings](/automq-cloud/subscriptions-and-billings/overview) > > Understand the subscription and billing model for AutoMQ BYOC. > [card] [Table Topic](/automq-cloud/table-topic/overview) > > Integrate with data lakes like Iceberg for powerful analytics. > [card] [Zero-Downtime Migration](/automq-cloud/migrate-to-automq/overview) > > Seamlessly migrate from Apache Kafka to AutoMQ with zero downtime using Kafka-Linking. > [card] [Monitoring & Alerting](/automq-cloud/monitoring-alert/monitoring-alert-via-prometheus) > > Set up comprehensive monitoring and alerting with Prometheus. ## AutoMQ Open Source > [card] [Quick Deploy on Docker](/automq/getting-started/deploy-multi-nodes-test-cluster-on-docker) > > Deploy a multi-node test cluster in minutes using Docker. > [card] [Deploy on Kubernetes](/automq/deployment/deploy-multi-nodes-cluster-on-kubernetes) > > Deploy and manage AutoMQ clusters on Kubernetes with Helm. > [card] [Benchmark Report](/automq/benchmarks/automq-vs-apache-kafka-benchmarks-and-cost) > > Compare AutoMQ vs. Apache Kafka performance and see the 10x cost savings. > [card] [vs. Apache Kafka](/automq/what-is-automq/difference-with-apache-kafka) > > Understand the key architectural differences and advantages over Kafka. > [card] [Architecture](/automq/architecture/overview) > > Dive into the S3-native, shared storage architecture of AutoMQ. > [card] [Server Configuration](/automq/configuration/broker-and-controller-configuration) > > Configure brokers, controllers, and object storage for optimal performance. ### Ready to get started? Choose your deployment option and start building with AutoMQ today. From local development to enterprise-scale production. [Start for free](https://console.automq.cloud/) [Explore Github](https://github.com/AutoMQ/automq) # Azure BYOC Console Upgrade Guide to v8.x Source: https://docs.automq.com/automq-cloud/appendix/azure-byoc-console-upgrade-to-8.x-guide ## Background AutoMQ Console 8.x is distributed and started as a Docker image. For an existing AutoMQ BYOC environment on Azure, the upgrade keeps the environment data and Instances while moving the console service to Docker image mode. This guide applies to Azure 7.x environments that need to upgrade to 8.x. For a new environment, see [Install AutoMQ on Azure](../getting-started/install-byoc-environment/install-env-on-azure). ## Constraints * The existing Azure BYOC environment uses AKS as its data plane Kubernetes cluster. * Confirm that the AKS cluster, node pool, VNet, Subnet, Private DNS Zone, Storage Account, and Blob containers still exist. * AutoMQ technical personnel must help migrate the environment metadata and generate the Docker startup command. * Resource names in this guide are examples. Use the Terraform output and Azure resources from your environment. ## Pre-upgrade checks Confirm that: * You can SSH into the console VM. * The original console data directory still exists, for example `/home/admin/.cmp/data`, and its host path is on the mounted persistent disk. * The environment ID and Region match the current environment. * The Console UAMI is still bound to the VM. * The persistent disk that contains the console home directory is mounted, and the SQLite `-wal` and `-shm` files are accessible. ### Check the AKS identity configuration Check the AKS configuration before upgrading the console. Before you update an existing Instance to 8.x or create a new 8.x Instance, make sure the required data plane identity features are enabled: * **Microsoft Entra integration**: Recommended. It allows the console to access AKS as the Console UAMI instead of using a static `clusterAdmin` kubeconfig. If it is disabled, the console uses the existing static administrator access during the upgrade. * **Azure RBAC for Kubernetes Authorization**: Recommended when Microsoft Entra integration is enabled. It allows you to grant the console's Kubernetes permissions through Azure IAM. If it is disabled, a cluster administrator can maintain a Kubernetes `ClusterRoleBinding` for the Console UAMI principal after the upgrade. * **OIDC issuer**: Required before an Instance uses Azure Workload Identity. * **Workload Identity**: Required before an Instance uses Azure Workload Identity. Check all four settings: ```bash theme={null} az aks show \ --resource-group \ --name \ --query '{entraIntegration:aadProfile.managed,azureRbac:aadProfile.enableAzureRbac,oidcIssuer:oidcIssuerProfile.enabled,workloadIdentity:securityProfile.workloadIdentity.enabled}' \ -o yaml ``` Before an Instance update, verify that `oidcIssuer` and `workloadIdentity` are `true`. We also recommend setting `entraIntegration` and `azureRbac` to `true`. Do not add new 8.x permissions before the console upgrade; keep the existing Console UAMI assignments and data plane identity unchanged. The existing workload UAMI and its current permissions do not need to change for the console upgrade. New 8.x Instances require an AKS OIDC Federated Identity Credential whose subject matches its Kubernetes ServiceAccount. Useful inspection commands include: ```bash theme={null} az vm show -g -n --query identity az network private-dns zone show -g -n az storage account show -g -n ``` > [!TIP] > > A 7.x AKS cluster may still use the node pool VMSS identity for data plane access. Upgrading the console does not require immediately changing that identity. Keep the existing data plane authorization unchanged during the upgrade. New 8.x Instances use Azure Workload Identity. ## Upgrade steps The overall process is to register an AutoMQ account, confirm deployment information, obtain the upgrade command, stop the old console, back up the database, install Docker, start and verify the new console, and update the License. ### 1. Register an organization and account Register at [AutoMQ Cloud](https://console.automq.cloud/) and provide the organization ID to AutoMQ technical personnel. ### 2. Confirm deployment information Collect and send the following information to AutoMQ technical personnel: * Environment ID, Region, current console version, and installation ID. * Console endpoint. * Azure Subscription ID, Resource Group, and AKS cluster name. * Storage Account and Ops Blob container. * Console UAMI. Use the old console settings page, Terraform output, Azure Portal, or Azure CLI to confirm these values. ### 3. Obtain the upgrade command AutoMQ technical personnel use the current environment information to migrate the environment record and generate an Azure 8.x installation command. It contains the complete Base64 `CONFIG`, `CLOUD_PROVIDER=azure`, initial administrator settings, and Docker image address. Copy the complete command directly. Do not decode, split, or manually assemble `CONFIG`. Ask AutoMQ technical personnel to confirm that the command matches the environment and target version. Record the host mount source from the generated command and reuse it in later commands. Confirm that the host mount source is on the persistent disk and that the container target is `/root`: ```bash theme={null} CONSOLE_HOME="" findmnt -T "$CONSOLE_HOME" test -r "$CONSOLE_HOME/.cmp/data/sqlite.db" ``` ### 4. Stop the old console Stop the old service to prevent database writes and port conflicts: ```bash theme={null} sudo systemctl stop cmp.service sudo systemctl status cmp.service --no-pager sudo systemctl disable cmp.service ps -ef | grep -E 'cmp|java' | grep -v grep ss -ltnp | grep -E ':8080|:8085' || true ``` ### 5. Back up the database Back up SQLite after the service stops. The wildcard includes WAL and SHM files. ```bash theme={null} ts=$(date -u +%Y%m%dT%H%M%SZ) backup_dir="$CONSOLE_HOME/cmp-migration-backup-$ts" mkdir -p "$backup_dir" sudo cp -a "$CONSOLE_HOME"/.cmp/data/sqlite.db* "$backup_dir"/ ls -lh "$backup_dir" ``` ### 6. Install Docker Follow the official [Docker Engine installation instructions](https://docs.docker.com/engine/install/) for the VM operating system, then verify Docker: ```bash theme={null} sudo systemctl enable --now docker sudo docker version ``` ### 7. Start the AutoMQ console Run the complete upgrade command from Step 3. The following command only illustrates the startup shape. The `CONFIG` value and image must come from the same generated command. The generated command contains credentials. Do not share it or save it in shared shell history. ```bash theme={null} sudo docker run -d \ --name automq-cmp \ --restart unless-stopped \ -v "$CONSOLE_HOME:/root" \ --net=host \ -e CONFIG="" \ -e CLOUD_PROVIDER=azure \ -e CONSOLE_INITIAL_USER=admin \ -e CONSOLE_INITIAL_PASSWORD="" \ ``` Check the container and logs: ```bash theme={null} sudo docker ps sudo docker logs -f automq-cmp ``` When the container is healthy and port `8080` is reachable, open the console in your browser. ### 8. Verify the upgrade Complete these checks before any Instance update: * The Environment ID, Region, and Console version match the target environment. * Existing Instances are visible and remain healthy. * **System Initialization** is healthy. After the upgrade, open this page and grant the roles and scopes it currently requires. Do not preconfigure these 8.x permissions before the upgrade. * Console logs have no persistent database, Azure authentication, or cloud resource permission errors. * Existing AKS workloads remain healthy, and current application Kafka connections still work. Do not modify or upgrade an Instance until these checks pass. If validation fails before an Instance update, you can use the console rollback below. After an Instance update, contact AutoMQ technical personnel to assess the cloud resource state first. ### 9. Update the License The installation ID may change in 8.x. If the new console reports an invalid License, copy the displayed installation ID and contact AutoMQ technical personnel to update it. This prompt does not affect existing clusters. ## Roll back If Docker startup or pre-update validation fails and no Instance update has been performed, stop and remove the new Docker container, restore the SQLite backup, and start the original systemd service: ```bash theme={null} sudo docker rm -f automq-cmp backup_dir="" sudo cp -a "$backup_dir"/sqlite.db* "$CONSOLE_HOME/.cmp/data/" sudo systemctl enable cmp.service sudo systemctl start cmp.service sudo systemctl status cmp.service --no-pager ``` If an Instance update has already been performed, contact AutoMQ technical personnel to confirm the Helm release, Kubernetes resources, Azure RBAC, Blob, and Private DNS state before restoring the database. ## Troubleshooting ### Docker container fails to start Check: * The Docker image can be pulled. * Ports `8080` and `8085` are not occupied by the old process. * The generated host path is mounted to container `/root` and remains on the persistent disk. * The container process can read the SQLite files. * The Console UAMI can read the required AKS, Private DNS, and Blob resources. ### Console reports insufficient permissions after startup Check: * The correct Console UAMI is bound to the console VM. * The Console UAMI can read AKS, VMSS, Private DNS, VNet, Subnet, and Storage Account resources. * The Blob endpoint and Ops container match the environment. * The Private DNS Zone is linked to the selected VNet. * The permissions on the current **System Initialization** page have been granted. # AWS BYOC Console Upgrade Guide for Version 8.x Source: https://docs.automq.com/automq-cloud/appendix/byoc-console-upgrade-to-8.x-guide ## Background The AutoMQ Console (versions prior to 8.0) was distributed through cloud provider marketplaces and installed via AMI images. Starting from version 8.0, the AutoMQ Console is distributed and installed via Docker images. New users and new environments are recommended to follow the [Install BYOC Console](/automq-cloud/getting-started/install-byoc-environment/aws/prepare-vpc) documentation for installation. This document describes how to smoothly upgrade existing BYOC environments from earlier versions to version 8.x. ## Constraints * **Cloud Provider:** Currently, only AWS environments support the upgrade to version 8.x. Support for other cloud providers is in progress. If you have requirements for other clouds, please contact us by referring to the "Contact Us" documentation. * **No AWS Managed Service for Prometheus:** Confirm that your current environment is not using the AWS Managed Service for Prometheus. If it is, please contact AutoMQ technical personnel to discuss an appropriate solution. ## Upgrade Steps The overall process is divided into the following steps: Register an AutoMQ account, confirm deployment information, obtain the upgrade command, stop the old console, configure IAM permissions, and execute the upgrade. ### 1. Register an Organization and Account Go to the AutoMQ official website to register an organization and account. The registration URL is: [https://console.automq.cloud/](https://console.automq.cloud/). ### 2. Confirm Deployment Information Confirm the deployment information of your current BYOC console and send it to AutoMQ technical personnel. This information is used to migrate environment metadata and generate the installation command. The information to be collected includes: * Environment ID * Deployment Region * Deployment Version * Installation ID * OpsBucket It is recommended to log in to the AutoMQ console and navigate to the settings page to view this information. You also need to provide your newly registered AutoMQ Organization ID to the AutoMQ technical personnel. ### 3. Obtain the Upgrade Command AutoMQ technical personnel will generate the environment's metadata and an upgrade installation command based on the information from Step 2, which will be used for the subsequent upgrade. ### 4. Stop the Old Console Log in to the EC2 instance where the AutoMQ console is located and stop the current console application. The command to stop the service is as follows: ```bash theme={null} sudo systemctl stop cmp.service ``` ### 5. Modify EC2 Metadata Access Limit (Optional) The AutoMQ 8.x console is deployed using Docker containers. Programs inside the container need to access the EC2 instance metadata service, and by default, the installation command uses Host network mode. If you prefer to use Bridge or other network modes, you must set the EC2 instance metadata response hop limit (`HttpPutResponseHopLimit`) to `2`. The procedure is as follows: 1. Log in to the [AWS EC2 Console](https://console.aws.amazon.com/ec2/home). 2. In the instances list, select the EC2 instance hosting the AutoMQ console. 3. Select **Actions** > **Instance Settings** > **Modify instance metadata options**. 4. In the dialog box, change the value of **Metadata response hop limit** from `1` to `2`. 5. Click **Save**. ### 6. Create and Configure IAM Role Go to the AWS IAM console ([https://us-east-1.console.aws.amazon.com/iam/home?region=us-east-1#/roles](https://us-east-1.console.aws.amazon.com/iam/home?region=us-east-1#/roles)) to create a new IAM Role for the AutoMQ console and grant the necessary cloud resource operation permissions. Starting from version 8.x, the AutoMQ console requires permissions to create IAM Roles for the data plane clusters. This means the console will manage the IAM permissions and roles required for each data plane cluster to operate. The procedure is as follows: Go to the IAM console to create a custom IAM Policy, then create an IAM Role, select EC2 as the service type, and attach the newly created IAM Policy. Next, go to the EC2 console to modify the EC2 instance where the console is located and change its attached IAM Role. > [tab] Example AWS Policy > > ```json highlight={36,46} theme={null} > { > "Version": "2012-10-17", > "Statement": [ > { > "Sid": "BasicIamCheckPermissions", > "Effect": "Allow", > "Action": [ > "iam:GetPolicy", > "iam:ListRoles", > "iam:GetInstanceProfile", > "iam:ListInstanceProfilesForRole", > "iam:GetRole", > "iam:GetRolePolicy", > "iam:ListRolePolicies", > "iam:ListAttachedRolePolicies", > "iam:GetPolicyVersion", > "iam:GetUser", > "iam:GetUserPolicy", > "iam:ListUserPolicies", > "iam:ListAttachedUserPolicies" > ], > "Resource": "*" > }, > { > "Sid": "OpsBucketManagePermissions", > "Effect": "Allow", > "Action": [ > "s3:GetLifecycleConfiguration", > "s3:PutLifecycleConfiguration", > "s3:ListBucket", > "s3:PutBucketTagging", > "s3:GetBucketPolicy", > "s3:CreateBucket", > "s3:PutBucketPolicy" > ], > "Resource": "arn:aws:s3:::{Replace with your truly OpsBucket}" > }, > { > "Sid": "OpsBucketOperationPermissions", > "Effect": "Allow", > "Action": [ > "s3:PutObject", > "s3:GetObject", > "s3:DeleteObject" > ], > "Resource": "arn:aws:s3:::{Replace with your truly OpsBucket}/*" > }, > { > "Sid": "DataBucketManagePermissions", > "Effect": "Allow", > "Action": [ > "s3:ListBucket", > "s3:GetLifecycleConfiguration", > "s3:CreateBucket", > "s3:PutBucketTagging", > "s3:DeleteBucket", > "s3:ListBucketMultipartUploads" > ], > "Resource": "*" > }, > { > "Sid": "DataBucketObjectCleanPermissions", > "Effect": "Allow", > "Action": [ > "s3:AbortMultipartUpload", > "s3:DeleteObject" > ], > "Resource": "*" > }, > { > "Sid": "AutoScalingServiceRolePermissions", > "Effect": "Allow", > "Action": "iam:CreateServiceLinkedRole", > "Resource": "*", > "Condition": { > "StringEquals": { > "iam:AWSServiceName": "autoscaling.amazonaws.com" > } > } > }, > { > "Sid": "Ec2InstanceProfilePassPermissions", > "Effect": "Allow", > "Action": "iam:PassRole", > "Resource": "*", > "Condition": { > "StringLike": { > "iam:PassedToService": "ec2.amazonaws.com*" > } > } > }, > { > "Sid": "Ec2AndAutoscalingReadAndCreatePermissions", > "Effect": "Allow", > "Action": [ > "ssm:GetParameters", > "s3:ListAllMyBuckets", > "route53:ListHostedZones", > "route53:ListHostedZonesByName", > "route53:ListHostedZonesByVpc", > "autoscaling:DescribeAutoScalingGroups", > "autoscaling:CreateAutoScalingGroup", > "ec2:DescribeAvailabilityZones", > "ec2:DescribeInstanceTypeOfferings", > "ec2:DescribeVpcs", > "ec2:DescribeVpcEndpoints", > "ec2:DescribeSubnets", > "ec2:DescribeImages", > "ec2:DescribeKeyPairs", > "ec2:CreateKeyPair", > "ec2:DescribeVolumes", > "ec2:CreateVolume", > "ec2:DescribeSecurityGroups", > "ec2:CreateSecurityGroup", > "ec2:DescribeSecurityGroupRules", > "ec2:DescribeLaunchTemplates", > "ec2:DescribeLaunchTemplateVersions", > "ec2:CreateLaunchTemplateVersion", > "ec2:CreateLaunchTemplate", > "ec2:ModifyLaunchTemplate", > "ec2:DeleteLaunchTemplate", > "ec2:DescribeTags", > "ec2:CreateTags", > "ec2:DescribeInstances", > "ec2:DescribeInstanceAttribute", > "ec2:RunInstances" > ], > "Resource": "*" > }, > { > "Sid": "Ec2AndAutoscalingOperationPermissions", > "Effect": "Allow", > "Action": [ > "ec2:AttachVolume", > "ec2:DetachVolume", > "ec2:DeleteVolume", > "ec2:DeleteKeyPair", > "ec2:TerminateInstances", > "ec2:AuthorizeSecurityGroupIngress", > "ec2:AuthorizeSecurityGroupEgress", > "ec2:DeleteSecurityGroup", > "autoscaling:AttachInstances", > "autoscaling:DetachInstances", > "autoscaling:SuspendProcesses", > "autoscaling:ResumeProcesses", > "autoscaling:UpdateAutoScalingGroup", > "autoscaling:DeleteAutoScalingGroup", > "ec2:StopInstances", > "ec2:RebootInstances" > ], > "Resource": "*", > "Condition": { > "StringEquals": { > "aws:ResourceTag/automqVendor": "automq" > } > } > }, > { > "Sid": "EksReadPermissions", > "Effect": "Allow", > "Action": [ > "s3:ListAllMyBuckets", > "route53:ListHostedZones", > "route53:ListHostedZonesByName", > "route53:ListHostedZonesByVpc", > "eks:ListClusters", > "eks:DescribeCluster", > "eks:ListNodegroups", > "eks:DescribeNodegroup", > "eks:ListAccessEntries", > "eks:DescribeAccessEntry", > "eks:ListAssociatedAccessPolicies", > "elasticloadbalancing:DescribeTargetGroups" > ], > "Resource": "*" > }, > { > "Sid": "ClusterRoleManagementPermissions", > "Effect": "Allow", > "Action": [ > "iam:ListOpenIDConnectProviders", > "iam:GetOpenIdConnectProvider", > "iam:GetPolicy", > "iam:CreatePolicy", > "iam:TagPolicy", > "iam:CreatePolicyVersion", > "iam:GetPolicyVersion", > "iam:AttachRolePolicy", > "iam:DetachRolePolicy", > "iam:DeletePolicy", > "iam:ListRoles", > "iam:GetRole", > "iam:CreateRole", > "iam:TagRole", > "iam:DeleteRole", > "iam:ListRolePolicies", > "iam:ListAttachedRolePolicies", > "iam:ListPolicyVersions", > "iam:DeletePolicyVersion", > "iam:ListInstanceProfilesForRole", > "iam:GetInstanceProfile", > "iam:CreateInstanceProfile", > "iam:AddRoleToInstanceProfile", > "iam:RemoveRoleFromInstanceProfile", > "iam:DeleteInstanceProfile" > ], > "Resource": "*" > }, > { > "Sid": "Route53ManagementPermissions", > "Effect": "Allow", > "Action": [ > "route53:GetHostedZone", > "route53:ListResourceRecordSets", > "route53:ChangeResourceRecordSets", > "route53:CreateHostedZone", > "route53:DeleteHostedZone", > "route53:ChangeTagsForResource" > ], > "Resource": "*" > }, > { > "Sid": "NfsReadAndCreatePermissions", > "Effect": "Allow", > "Action": [ > "ec2:DescribeRouteTables", > "ec2:DescribeNetworkInterfaceAttribute", > "ec2:DescribeNetworkInterfaces", > "ec2:CreateNetworkInterface", > "fsx:TagResource", > "fsx:DescribeVolumes", > "fsx:CreateVolume", > "fsx:DescribeStorageVirtualMachines", > "fsx:CreateStorageVirtualMachine", > "fsx:DescribeFileSystems", > "fsx:CreateFileSystem", > "elasticfilesystem:CreateFileSystem", > "elasticfilesystem:DescribeFileSystems", > "elasticfilesystem:CreateMountTarget", > "elasticfilesystem:DescribeMountTargets", > "elasticfilesystem:DescribeMountTargetSecurityGroups", > "elasticfilesystem:TagResource" > ], > "Resource": "*" > }, > { > "Sid": "NfsOperationPermissions", > "Effect": "Allow", > "Action": [ > "ec2:DeleteNetworkInterface", > "fsx:UpdateVolume", > "fsx:DeleteVolume", > "fsx:DeleteStorageVirtualMachine", > "fsx:UpdateFileSystem", > "fsx:DeleteFileSystem", > "elasticfilesystem:UpdateFileSystem", > "elasticfilesystem:DeleteFileSystem", > "elasticfilesystem:DeleteMountTarget" > ], > "Resource": "*", > "Condition": { > "StringEquals": { > "aws:ResourceTag/automqVendor": "automq" > } > } > }, > { > "Sid": "Ec2PricingPermissions", > "Effect": "Allow", > "Action": [ > "pricing:DescribeServices", > "pricing:GetAttributeValues", > "pricing:GetProducts" > ], > "Resource": "*" > } > ] > } > ``` ### 7. Install Docker and Start the AutoMQ Console Before executing the upgrade command, please ensure that Docker is installed and running in your environment. ```bash theme={null} # Install docker sudo yum install docker -y # Start docker service sudo systemctl start docker # Enable docker to start on boot sudo systemctl enable docker ``` Copy the upgrade installation command from Step 3 to start the new version of the AutoMQ console. An example of the Docker run command is as follows: ```bash theme={null} sudo docker run -d -v /home/admin:/root \ -p 8080:8080 \ -e CLOUD_PROVIDER=aws \ -e REGION=ap-northeast-1 \ -e OPS_BUCKET=automq-ops-xxxx \ -e CONSOLE_INITIAL_USER=admin \ -e CONSOLE_INITIAL_PASSWORD=admin \ -e CLIENT_ID=env-xxxx \ -e CLIENT_SECRET=xxx \ xxx/automq/automq_byoc_console:xxxx ``` After observing that the Docker container is running correctly and that port 8080 is accessible, you can access the AutoMQ console service via a web browser. ### 8. Copy the Installation ID and Update the License Because version 8.x changes the installation media and startup method, the installation ID for the new version will be different. After logging into the new console, a "License invalid" prompt will appear. Copy the installation ID displayed on the console page and contact AutoMQ technical personnel to update the information. You will then be able to access the new version of the console. > [!TIP] > > **Note**: During the upgrade process, if the console displays a "License invalid" message, this will not affect the normal operation of the cluster. Contact AutoMQ technical personnel and provide the new installation ID to activate the license. # Cloud Resource List Source: https://docs.automq.com/automq-cloud/appendix/cloud-resource-list Deploy AutoMQ on AWS with cloud-native scalability, full Kafka compatibility, and cost efficiency. AutoMQ creates and manages essential AWS resources for you. ## AWS By default, creating AutoMQ from the AWS Cloud Marketplace will deploy a cluster with 6 AKUs across three availability zones. AutoMQ is responsible for creating network resources such as VPCs and subnets, and will create and rely on the following essential cloud resources: | Resource Name | Specification | Quantity | Description | | - | - | - | - | | VPC | - | 1 | The VPC used by AutoMQ control and data planes. | | Security Group | - | 1 | The security group used by AutoMQ, with 1 new rule created, | | Subnet | - | 4 | The control plane will use 1 subnet, and each of the 3 data plane nodes will use 1 subnet, | | IGW | - | 1 | For the control plane to be accessible from the public internet, | | VPC Internet Gateway | - | 1 | For the control plane to access the public internet, | | Network ACL | - | 1 | AutoMQ will create the following ACL rules.\[1] | | Route Table | - | - | Rules associated with local and endpoint | | Security Group | - | - | AutoMQ will create the following security group rules.\[2] | | EC2 | t3.large | 1 | Deploys the control plane | | EBS | GP3,20 GB | 1 | Used for the control plane system volume, encryption is disabled by default. | | EBS | GP3,20 GB | 3 | Used for the data plane system volume, encryption is disabled by default. | | EBS | GP3,20 GB | 3 | Used for the data plane data volume, encryption is disabled by default. | | EC2 | r6in.large | 3 | Provides support for AutoMQ data plane with 6 AKU capacity | | Elastic IP Address | - | 1 | Used by AutoMQ control plane | | IAM Instance Profile | - | 1 | Grants permissions to the control plane EC2 for executing data plane creation tasks | | IAM Policy | - | 1 | An IAM policy will be created for AutoMQ, used for authorization. The policy follows the principle of least privilege and can be referenced from the AWS installation documentation. This policy allows AutoMQ to create necessary resources when users need to create a new data plane cluster. | | IAM Role | - | 1 | An IAM role will be created for AutoMQ, associated with the IAM policy. | | Route 53 Records | - | 3 | AutoMQ provides Bootstrap Server endpoints, with a domain name assigned to each node. | | EC2 Endpoint | - | 1 | Used for EC2 to access AWS OpenAPI and query metadata. | | S3 Endpoint | - | 1 | Ensures that access to S3 is routed through the internal network. | | AutoScaling Group | - | 1 | Created only when using the AWS Cloud Marketplace CloudFormation method. | | Launch Template | - | 1 | Created only when using AWS CloudFormation from the AWS Marketplace, and will be dependent on the ASG. | | S3 Bucket | - | 2 | Using AutoMQ requires users to provide 2 S3 Buckets, one for storing primary data and the other for storing logs and monitoring data. By default, encryption options do not need to be enabled. | | Route 53 | - | 1 | Used for binding domain names to data nodes in subsequent steps. | #### \[1] AutoMQ AWS Network ACL ```hcl theme={null} // aws_default_network_acl egress { action = "allow" from_port = 0 ipv6_cidr_block = "::/0" protocol = "-1" rule_no = 101 to_port = 0 } egress { action = "allow" cidr_block = "0.0.0.0/0" from_port = 0 protocol = "-1" rule_no = 100 to_port = 0 } ingress { action = "allow" from_port = 0 ipv6_cidr_block = "::/0" protocol = "-1" rule_no = 101 to_port = 0 } ingress { action = "allow" cidr_block = "0.0.0.0/0" from_port = 0 protocol = "-1" rule_no = 100 to_port = 0 } ``` #### \[2] AutoMQ AWS Security Group ```hcl theme={null} // vpc_endpoint_sg ingress { from_port = 443 to_port = 443 protocol = "tcp" cidr_blocks = ["0.0.0.0/0"] } egress { from_port = 0 to_port = 0 protocol = "-1" cidr_blocks = ["0.0.0.0/0"] } // automq_byoc_console_sg ingress { from_port = 8080 to_port = 8080 protocol = "tcp" cidr_blocks = [var.automq_byoc_env_console_cidr] } egress { from_port = 0 to_port = 0 protocol = "-1" cidr_blocks = ["0.0.0.0/0"] } ``` ## Additional Information * All cloud resources created by AutoMQ will be tagged with the default label `automqVendor: automq` to facilitate users in filtering cloud resources related to AutoMQ. * AutoMQ uses the following supported Linux security image on AWS EC2: amzn2-ami-kernel-5.10-hvm-2.0.20241113.1-arm64-gp2 # Deploy AutoMQ Software Via Helm Chart Source: https://docs.automq.com/automq-cloud/appendix/deploy-automq-enterprise-via-helm-chart Deploy AutoMQ Software in a private Kubernetes data center using Helm Charts. Achieve 100% Kafka compatibility and cost efficiency with step-by-step setup instructions. This document details the process for deploying AutoMQ Software in a private Kubernetes data center using a Helm Chart. To deploy AutoMQ in a public cloud environment, refer to [Overview▸](/automq-cloud/getting-started/overview). ## Prerequisites Before installing AutoMQ with a Helm Chart, ensure the following prerequisites are satisfied: 1. **Prepare a Kubernetes Environment**: Establish an available Kubernetes cluster in advance, ensuring it meets the conditions below: 1. **Allocate Resources for AutoMQ**: It is recommended to allocate 4 cores and 16GB of memory for each AutoMQ Pod. Deploying on a dedicated Node is advisable for stable network throughput performance. 2. **Storage Plugin:** If your Kubernetes is provided by a cloud vendor, it is advisable to install the storage plugin offered by the vendor to manage EBS volume resources effectively. 2. **Prepare Object Storage Buckets:** Each AutoMQ cluster requires two separate object storage buckets: one Ops Bucket for system logs and metrics data, and one Data Bucket for message data. Please refer to the object storage product documentation for guidance on creating them. 3. **Install the Helm Chart Tool:** It is recommended to install version 3.6 or higher. You can [refer to the documentation](https://helm.sh/docs/intro/quickstart/) for detailed instructions. ## Obtain the Software Chart. For the current stable Chart version, see the [Data Plane Cluster release notes](/automq-cloud/release-notes#historical-versions-of-data-plane-cluster). The AutoMQ Software Chart image is published and made available to the public through an Azure Container Registry (East US). You can test the pull with the following command. ```bash theme={null} helm pull oci://automq.azurecr.io/helm/automq-software-chart --version ``` ## Install AutoMQ AutoMQ Software offers two types of WAL storage options: EBSWAL and S3WAL. A comparison of the two storage engines is as follows; it is recommended to choose based on your needs. For detailed principles, please refer to the [Technical Architecture](https://docs.automq.com/automq/architecture/s3stream-shared-streaming-storage/wal-storage). * **EBSWAL Mode:** WAL storage uses high-speed EBS volumes to deliver low-latency send performance, supported only in public cloud environments like AWS, GCP, and Azure. When using, you need to assign EBS volumes to AutoMQ's Pods via a StorageClass. * **S3WAL Mode:** Deployment is relatively simple, as WAL storage writes directly to object storage, offering sub-100 ms send RT performance. It supports all public cloud environments as well as private data centers (as long as they provide S3-compatible object storage). Deployment is relatively straightforward, with no need to allocate EBS volumes. > [!TIP] > > The following sections provide a simplified deployment scenario example for various cloud vendor environments. This example scenario deploys in S3WAL mode, uses static credentials to access cloud resources, and supports accessing AutoMQ within a Kubernetes cluster via a Headless service access point or from outside the Kubernetes cluster using a LoadBalancer access point. > > The AutoMQ team also provides a variety of advanced feature examples, including TLS, authentication and authorization, Auto-Scaler, and more. For details, please refer to the [Advanced Feature Examples ▸](https://github.com/AutoMQ/automq-labs/tree/main/software-examples/kubernetes/). ### Step 1: Create Credentials and Perform Authorization. AutoMQ clusters require access to external services such as object storage and storage volumes. Therefore, before installation, you need to create credentials for AutoMQ and complete the authorization process. > [tab] AWS > > If AutoMQ is deployed in the AWS public cloud environment using AWS S3 storage, you must access the IAM product to create an authorization policy. AutoMQ must be granted permission for the following operations to access AWS S3: > > ```yaml theme={null} > - actions: > - s3:GetLifecycleConfiguration > - s3:PutLifecycleConfiguration > - s3:ListBucket > - s3:PutObject > - s3:GetObject > - s3:AbortMultipartUpload > - s3:PutObjectTagging > - s3:DeleteObject > > ``` > > If you deploy using the EBSWAL mode, additional authorization for the following policy is required: > > ```yaml theme={null} > - actions: > - ec2:DescribeVolumes > - ec2:DetachVolume > - ec2:DescribeAvailabilityZones > > ``` > > After creating an IAM authorization policy, credentials can be generated using two methods. > > * **Using IAM Subaccount Static AccessKey:** In this approach, attach the authorization policy to the IAM subaccount and utilize the subaccount's static AccessKeyId and AccessKeySecret as credentials to access AutoMQ. > > * **Using IAM Role Dynamic Credentials:** For this approach, create an IAM Role and attach the authorization policy to the Role. Dynamic credentials allow access to AutoMQ through a Pod assuming the EC2 Role in EKS. > > > [!TIP] > > > > To clarify illustrations, the following configuration file example employs a static AccessKey as credentials. > [tab] Azure > > Deploying AutoMQ in the Azure public cloud environment requires using Azure Blob Storage. Authorization credentials must be configured within the Storage Account's access control (IAM). Users can opt for either of the following permission entities to assign the system role to Blob: `Storage Blob Data Owner`. > > * **Using Service Principal Static Secret**: In this setup, the AccessKey corresponds to the App's clientId, and the SecretKey corresponds to the Secret value along with the tenantId. Together, these serve as static credentials for accessing AutoMQ. > > * **Using Managed Identity Dynamic Credentials**: With this approach, in addition to having the ServiceAccount assigned the necessary roles, it is vital to associate it with the corresponding VMSS (virtual machine scale set) for AutoMQ. This way, you can access AutoMQ on AKS using the clientId of this dynamic credential. > [tab] OCI > > In an OCI environment, you need to generate a **Customer Secret Key** for a specific OCI user to serve as static credentials. This user must be granted appropriate permissions to access Object Storage. > > First, create the following IAM authorization policies for the user or user group managing AutoMQ: > > ```text theme={null} > Allow group to manage objects in compartment where any { > target.bucket.name = '', > target.bucket.name = '' > } > > Allow group to use buckets in compartment where any { > target.bucket.name = '', > target.bucket.name = '' > } > ``` > > * The `manage objects` permission set includes operations like creating, reading, deleting, and listing objects. > * The `use buckets` permission set includes permissions to manage bucket lifecycle policies. > > If you plan to use **EBSWAL** mode, OKE worker nodes require permissions to manage Block Volumes. Ensure you create a Dynamic Group for your node pool and grant it the following permissions: > > ```text theme={null} > Allow dynamic-group to manage block-volumes in compartment > Allow dynamic-group to manage volume-attachments in compartment > Allow dynamic-group to use subnets in compartment > Allow dynamic-group to inspect instances in compartment > ``` > > After creating the credentials, record the **Access Key** and **Secret Key**, as they will be used as static credentials in the subsequent Helm Chart configuration. ### Step 2: Create Storage Class Before installing AutoMQ, you must declare a Storage Class in the Kubernetes cluster for allocating storage volumes. These storage volumes serve several purposes: * **Storing AutoMQ Controller Metadata:** In the AutoMQ cluster, the Controller Pod responsible for metadata management must mount the storage volumes to store KRaft metadata. * **EBSWAL Mode Storage for WAL Data (Optional):** If you plan to deploy using the EBSWAL mode, each Broker Pod will also require a mounted data volume for writing WAL data. > [!TIP] > > Please specify the Storage Class based on the Kubernetes storage plugin from your cloud provider or private data center, then keep a record of the Storage Class name for later parameter configuration. > [tab] AWS > > ```yaml theme={null} > apiVersion: storage.k8s.io/v1 > kind: StorageClass > metadata: > name: automq-disk-eks-gp3 > provisioner: ebs.csi.aws.com > volumeBindingMode: WaitForFirstConsumer > parameters: > type: gp3 # EBS Volume Type > allowVolumeExpansion: true > > ``` > [tab] Azure > > ```yaml theme={null} > # Example StorageClass Definition (Azure Premium SSD Example) > apiVersion: storage.k8s.io/v1 > kind: StorageClass > metadata: > name: automq-disk-storage-class > provisioner: disk.csi.azure.com > parameters: > skuName: PremiumV2_LRS > reclaimPolicy: Delete > volumeBindingMode: WaitForFirstConsumer > allowVolumeExpansion: true > > ``` > [tab] GCP > > ```yaml theme={null} > apiVersion: storage.k8s.io/v1 > kind: StorageClass > metadata: > name: automq-disk-gcp-pd-balanced > provisioner: pd.csi.storage.gke.io > volumeBindingMode: WaitForFirstConsumer > allowVolumeExpansion: true > parameters: > type: pd-balanced # High Performance Cloud Disk. > > ``` > [tab] OCI > > ```yaml theme={null} > apiVersion: storage.k8s.io/v1 > kind: StorageClass > metadata: > name: automq-block-volume > provisioner: blockvolume.csi.oraclecloud.com > reclaimPolicy: Delete > volumeBindingMode: WaitForFirstConsumer > allowVolumeExpansion: true > parameters: > # vpusPerGB determines the IOPS and throughput performance of the volume > # 10: Provides basic performance > # 20: Provides higher performance, recommended for production environments > vpusPerGB: "20" > # attachmentType determines the type of volume attachment > # iscsi: iSCSI attachment, general purpose > # paravirtualized: Paravirtualized attachment, offers higher performance > attachmentType: "paravirtualized" > ``` ### Step 3: Initialize the Configuration File The configuration information for the AutoMQ Software Chart is composed of multiple parts, allowing for user customization via the values.yaml file. > [!TIP] > > **Required: Set a Unique Instance ID** > > A critical parameter you must define is `global.automqInstanceId`. This serves as a **required** unique identifier for your AutoMQ cluster. > > Why is it important? This ID ensures that resources are properly isolated, preventing data corruption or conflicts. Each cluster must have its own distinct `automqInstanceId`. First, create an empty file named `automq-values.yaml`. You can copy the example configuration below and edit it. ```yaml theme={null} global: cloudProvider: name: "Replace With Your True Cloud Provider Name" credentials: "Replace With Your True Your Credentials" config: | s3.ops.buckets=Replace With Your True Ops Bucket URL s3.data.buckets=Replace With Your True Data Bucket URL s3.wal.path=Replace With Your True WAL PATH controller: resources: requests: cpu: "3000m" memory: "12Gi" limits: cpu: "4000m" memory: "16Gi" persistence: metadata: storageClass: "Replace With Your True StroageClass" wal: enabled: false annotations: env: - name: "KAFKA_JVM_PERFORMANCE_OPTS" value: "-server -XX:+UseZGC -XX:ZCollectionInterval=5" - name: "KAFKA_OPTS" value: "-XX:+ExitOnOutOfMemoryError -XX:+HeapDumpOnOutOfMemoryError" - name: "KAFKA_HEAP_OPTS" value: "-Xmx6g -Xms6g -XX:MaxDirectMemorySize=6g -XX:MetaspaceSize=96m" - name: "KAFKA_S3_ACCESS_KEY" value: "Replace With Your True ACCESS_KEY" - name: "KAFKA_S3_SECRET_KEY" value: "Replace With Your True SECRET_KEY" broker: replicas: 0 resources: requests: cpu: "3000m" memory: "12Gi" limits: cpu: "4000m" memory: "16Gi" persistence: wal: enabled: false annotations: env: - name: "KAFKA_JVM_PERFORMANCE_OPTS" value: "-server -XX:+UseZGC -XX:ZCollectionInterval=5" - name: "KAFKA_OPTS" value: "-XX:+ExitOnOutOfMemoryError -XX:+HeapDumpOnOutOfMemoryError" - name: "KAFKA_HEAP_OPTS" value: "-Xmx6g -Xms6g -XX:MaxDirectMemorySize=6g -XX:MetaspaceSize=96m" - name: "KAFKA_S3_ACCESS_KEY" value: "Replace With Your True ACCESS_KEY" - name: "KAFKA_S3_SECRET_KEY" value: "Replace With Your True SECRET_KEY" externalAccess: controller: enabled: true service: type: LoadBalancer annotations: extraPorts: - name: "tcp-9092" port: 9092 protocol: "TCP" targetPort: 9092 ``` In the configuration file generated in the previous step, certain parameters must be updated according to your actual conditions. #### Modify Common Parameters. **global.cloudProvider.name** This parameter specifies the deployment cloud environment. Please insert the enumerated value according to the name of the cloud provider. If it is a private data center, you'll also need to fill it in with the enumerated value. | **Deployment Environment** | **Parameter Enumerated Value** | | - | - | | AWS | aws | | Google Cloud | gcp | | Azure | azure | | OCI | noop | | Alibaba Cloud | aliyun | **global.cloudProvider.credentials** This parameter details the public credentials used by the AutoMQ cluster to access cloud resources. The current example utilizes static credentials of the AccessKey type. To use the IAM Role method, please refer to the advanced parameter documentation for guidance on modifications. ```yaml theme={null} global: cloudProvider: credentials: static://?accessKey=&secretKey= ``` **KAFKA\_S3\_ACCESS\_KEY and KAFKA\_S3\_SECRET\_KEY Environment Variables** The example configuration file employs static credentials of the AccessKey type. Therefore, in addition to the global.cloudProvider.credentials parameter, you need to update the Controller and Broker environment variables with the correct credentials. Refer to the credentials created in Step 1 to update the credentials in the example: ```yaml theme={null} controller: env: - name: "KAFKA_S3_ACCESS_KEY" value: "Replace With Your True ACCESS_KEY" - name: "KAFKA_S3_SECRET_KEY" value: "Replace With Your True SECRET_KEY" broker: env: - name: "KAFKA_S3_ACCESS_KEY" value: "Replace With Your True ACCESS_KEY" - name: "KAFKA_S3_SECRET_KEY" value: "Replace With Your True SECRET_KEY" ``` **global.config** This parameter specifies the configuration for accessing object storage using S3URL, which includes three components: s3.ops.buckets, s3.data.buckets, and s3.wal.path. > [!TIP] > > Below is an example configuration using the S3WAL mode with static credentials. If you need to use EBSWAL mode, please refer to the advanced configuration section for modification instructions. > [tab] AWS > > Fill in the Ops Bucket and Data Bucket created in the prerequisites according to your actual scenario. > > ```yaml theme={null} > config: | > s3.data.buckets=0@s3://?region=xxxx&endpoint=https://s3.xxxx.amazonaws.com&authType=static > s3.ops.buckets=1@s3://?region=xxxx&endpoint=https://s3.xxxx.amazonaws.com&authType=static > s3.wal.path=0@s3://?region=xxxx&endpoint=https://s3.xxxx.amazonaws.com&authType=static > > ``` > [tab] Azure > > Fill in the Ops Bucket, Data Bucket, region, and Endpoint parameters according to your actual scenario. > > ```yaml theme={null} > config: | > s3.data.buckets=0@s3://?region=xxxx&endpoint=https://xxx_storage-account.blob.core.windows.net&authType=static > s3.ops.buckets=1@s3://?region=xxxx&endpoint=https://xxx_storage-account.blob.core.windows.net&authType=static > s3.wal.path=1@s3://?region=xxxx&endpoint=https://xxx_storage-account.blob.core.windows.net&authType=static > > ``` > [tab] Google Cloud > > AccessKey-type static credentials are not supported on GCP, requiring a different format. You need to fill in the Ops Bucket, Data Bucket, region, Endpoint, and GCP ServiceAccount parameters. > > ```yaml theme={null} > config: | > s3.data.buckets=0@s3://?region=xxxx&endpoint=https://xxx_storage-account.blob.core.windows.net&authType=instance&role= > s3.ops.buckets=1@s3://?region=xxxx&endpoint=https://xxx_storage-account.blob.core.windows.net&authType=instance&role= > s3.wal.path=1@s3://?region=xxxx&endpoint=https://xxx_storage-account.blob.core.windows.net&authType=instance&role= > > ``` > [tab] OCI > > Fill in the Ops Bucket, Data Bucket, region, and Endpoint parameters according to your actual scenario. > > ```yaml theme={null} > config: | > s3.data.buckets=0@s3://?region=xxxx&endpoint=https://xxx.compat.objectstorage.us-ashburn-1.oraclecloud.com&authType=static&pathStyle=true > s3.ops.buckets=1@s3://?region=xxxx&endpoint=https://xxx.compat.objectstorage.us-ashburn-1.oraclecloud.com&authType=static&pathStyle=true > s3.wal.path=0@s3://?region=xxxx&endpoint=https://xxx.compat.objectstorage.us-ashburn-1.oraclecloud.com&authType=static&pathStyle=true > ``` > [tab] Alibaba Cloud > > Input the Ops Bucket, Data Bucket, region, and Endpoint parameters according to the actual requirements. > > ```yaml theme={null} > > config: | > s3.data.buckets=0@s3://?region=xxxx&endpoint=https://oss-cn-xxxx.aliyuncs.com&authType=static > s3.ops.buckets=1@s3://?region=xxxx&endpoint=https://oss-cn-xxxx.aliyuncs.com&authType=static > s3.wal.path=1@s3://?region=xxxx&endpoint=https://oss-cn-xxxx.aliyuncs.com&authType=static > > ``` #### Set LoadBalancer Annotations to Enable External Kubernetes Cluster Access If you need to access AutoMQ from outside the Kubernetes cluster, you need to enable `externalAccess`. To configure an **internal LoadBalancer**, you should modify the `values.yaml` file, specifically the `externalAccess.controller.service.loadBalancerAnnotations` section, and add the following annotations based on your cloud provider: > [tab] AWS > > To create an internal Network Load Balancer (NLB), add the following annotations: > > ```yaml theme={null} > service.beta.kubernetes.io/aws-load-balancer-type: "nlb" > service.beta.kubernetes.io/aws-load-balancer-scheme: "internal" > # If you need to specify subnets, add: > # service.beta.kubernetes.io/aws-load-balancer-subnets: "subnet-xxxx,subnet-yyyy" > ``` > [tab] Azure > > To create an internal standard Load Balancer, add the following annotations: > > ```yaml theme={null} > service.beta.kubernetes.io/azure-load-balancer-internal: "true" > # If you need to specify a subnet, add: > # service.beta.kubernetes.io/azure-load-balancer-internal-subnet: "your-subnet-name" > ``` > [tab] GCP > > To create an internal TCP/UDP Load Balancer, add the following annotations: > > ```yaml theme={null} > networking.gke.io/load-balancer-type: "Internal" > # If you need to specify a subnet, add: > # cloud.google.com/load-balancer-subnet: "your-subnet-name" > ``` > [tab] OCI > > To create an internal Load Balancer, add the following annotations: > > ```yaml theme={null} > oci.oraclecloud.com/load-balancer-type: "nlb" > oci-network-load-balancer.oraclecloud.com/internal: "true" > oci-network-load-balancer.oraclecloud.com/subnet: "" > ``` **controller.persistence.metadata.storageClass** Substitute this parameter with the name of the Storage Class created in step 2, which is designated for storing metadata in the AutoMQ Controller Pod. #### Revise the Cluster Topology and Resource Request Parameters. Adjust the cluster topology and resource request parameters based on the resources allocated to AutoMQ Node. The parameters that need modification are as follows: **broker.replicas** The AutoMQ Software Chart will start with three Controller Pods by default. These Controller Pods also provide data read and write capabilities. If users wish to horizontally scale more Brokers, they can set the broker.replicas parameter. * Default value: 0, which represents a three-node cluster without the need for additional Brokers. * Setting range: >= 0, configured as needed. **Resource Request Parameters** AutoMQ Software Controller and Broker Pods need to have the Request and Limit parameters adjusted, along with the corresponding JVM HEAP settings. The configuration files mentioned earlier default to a 4Core16GB specification. Please update these parameters based on the actual allocated computing resources. * controller.resources.requests.cpu * controller.resources.requests.memory * controller.resources.limits.cpu * controller.resources.limits.memory * controller.env.\[KAFKA\_HEAP\_OPTS] * broker.resources.requests.cpu * broker.resources.requests.memory * broker.resources.limits.cpu * broker.resources.limits.memory * broker.env.\[KAFKA\_HEAP\_OPTS] ## Multi-AZ Deployment When Kubernetes nodes are distributed across multiple Availability Zones, enable the chart's cross-zone pod spreading constraints. Nodes must have the `topology.kubernetes.io/zone` label, and each zone must have sufficient compute capacity. ```yaml theme={null} global: zoneSpreadConstraints: true topologySpreadWhenUnsatisfiable: DoNotSchedule config: | automq.zonerouter.channels=0@s3://?region= controller: replicas: 3 broker: replicas: 0 ``` With `global.zoneSpreadConstraints` enabled, the chart spreads Controller and Broker pods across `topology.kubernetes.io/zone`. If dedicated Brokers are used, set `broker.replicas` to a replica count suitable for the number of zones. `automq.zonerouter.channels` reduces cross-AZ traffic in AWS or GCP; consumers can additionally use `client.rack`, or the server-side `automq.zone.cidr.blocks` mapping. If external access is required and the LoadBalancer should cover multiple AZs, configure multiple subnets in the Service annotations, such as AWS `service.beta.kubernetes.io/aws-load-balancer-subnets`. See the [AWS Software multi-AZ demo](https://github.com/AutoMQ/automq-labs/tree/main/software-examples/kubernetes/aws/external_dns) for a runnable example. ### Step 4: Install Chart and Access the Cluster After customizing the values.yaml configuration file to suit your deployment requirements, proceed with the installation of AutoMQ. ```bash theme={null} helm upgrade --install oci://automq.azurecr.io/helm/automq-software-chart --version -f --namespace --create-namespace ``` Once the installation is complete, users can access AutoMQ within the Kubernetes cluster, either through a Headless service or a LoadBalancer. > [!TIP] > > Note: We recommend deploying an Internal LoadBalancer to prevent changes in Pod IP addresses. ### Step 5: Connect and Test the Cluster #### Headless Service 1. **Locate the Headless service** ```bash theme={null} kubectl get svc --namespace -l "app.kubernetes.io/component=controller" -w ``` 2. **Connecting and Testing Using Kafka Clients** Use the Headless Service for your Kafka client’s `--bootstrap-server` option to send and receive messages. Here’s the command you can use: ```bash theme={null} ./kafka-console-producer.sh \ --bootstrap-server -automq-enterprise-controller-0.-automq-enterprise-controller-headless..svc.cluster.local:9092 \ --topic test-topic ``` #### LoadBalancer 1. **Find External Address** Wait for the EXTERNAL-IP to be assigned. Use the following command: ```bash theme={null} kubectl get svc automq-release-automq-enterprise-controller-loadbalancer -n automq -o jsonpath='{.status.loadBalancer.ingress[0].hostname}' ``` You can obtain the external IP of the LoadBalancer. 2. **Connect and Test Using Kafka Clients** Port `9092` is used for client access. ```bash theme={null} # Replace with the Address from the Previous Step ./kafka-console-producer.sh \ --bootstrap-server :9092 \ --topic test-topic ``` ## Other Advanced Configurations The deployment document above provides a basic example of deploying AutoMQ in S3WAL mode. In real-world production environments, users can choose more advanced configurations like EBSWAL and integrate Auto-Scaler support. For the full configuration file, refer to [Helm Chart Values Readme▸](/automq-cloud/appendix/helm-chart-values-readme). ### Configuring the WAL Type In the previously mentioned installation steps, S3WAL was used as an example. AutoMQ supports deployment options for both EBSWAL and S3WAL modes. > [tab] S3WAL Mode > > In S3WAL mode, there's no need to mount a WAL data volume, making the configuration relatively straightforward. First, configure the `global.config.s3.wal.path` parameter. > > ```yaml theme={null} > > config: | > s3.wal.path=0@s3://?region=&endpoint=&authType= > > ``` > > Then, disable `controller.persistence.wal.enabled` and `broker.persistence.wal.enabled`. > > ```yaml theme={null} > # Applying StorageClass in Controller/broker > controller: > persistence: > metadata: > storageClass: "your-storage-class" > wal: > enabled: false > broker: > persistence: > wal: > enabled: false > > > ``` > [tab] EBSWAL Mode > > In EBSWAL mode, each controller and broker requires a mounted WAL data volume. Therefore, you need to set `controller.persistence.wal.storageClass` and `broker.persistence.wal.storageClass`, ensuring these values are set to the previously created Storage Class. > > ```yaml theme={null} > # Applying StorageClass in Controller/broker > controller: > persistence: > metadata: > storageClass: "your-storage-class" > wal: > storageClass: "your-storage-class" > broker: > persistence: > wal: > storageClass: "your-storage-class" > > > ``` > > Next, configure the `global.config.s3.wal.path` parameter. > > ```yaml theme={null} > config: | > s3.wal.path=0@block:///dev/waliobandwidth=131072000&iodepth=8&iops=3000&capacity=2147483648 > > ``` ### Setting Credentials AutoMQ supports accessing external resources using either static AccessKeys or dynamic IAM Roles. To prevent the leakage of static AccessKey configurations in production environments, it is recommended to use dynamically generated credentials provided by the cloud provider's IAM Roles. > [tab] IAM Role Credentials > > When using IAM Role Credentials, it is necessary to attach the authorization policy to the Role in Step 1. Then, refer to the example below to modify the Credentials configuration. > > ```yaml theme={null} > global: > cloudProvider: > credentials: instance://?role= > > config: | > s3.data.buckets=0@s3://?authType=instance&role= > s3.ops.buckets=1@s3://?authType=instance&role= > ``` > > The format for filling out credentials parameters is outlined in the following table:\*\* > > | **Deployment Environment** | **Parameter Values** | > | - | - | > | AWS | instance://?role=\ For Role, enter the IAM instance profile, not the Role ARN. | > | Google Cloud | instance://?role=\ For Role, enter the name of the GCP ServiceAccount. | > | Azure | instance://?role=\ For Role, enter the Azure Managed Identity Client ID. | > | Alibaba Cloud | instance://?role=\ For Role, enter the RAM Role name of Alibaba Cloud. | > [tab] AccessKey Credentials > > When using AccessKey Credentials, you need to attach the authorization policy to the sub-account or service account in Step 1. Then modify the Credentials configuration as shown in the example below, setting authType to static. > > ```yaml theme={null} > global: > cloudProvider: > credentials: static://?accessKey=&secretKey= > > config: | > s3.data.buckets=0@s3://?authType=static > s3.ops.buckets=1@s3://?authType=static > ``` > > After configuring static AccessKey credentials, you must also set these credentials in the environment variables of the Controller and Broker as required by your cloud provider. > > ```yaml theme={null} > controller: > env: > - name: "KAFKA_S3_ACCESS_KEY" > value: "Replace With Your True ACCESS_KEY" > - name: "KAFKA_S3_SECRET_KEY" > value: "Replace With Your True SECRET_KEY" > > broker: > env: > - name: "KAFKA_S3_ACCESS_KEY" > value: "Replace With Your True ACCESS_KEY" > - name: "KAFKA_S3_SECRET_KEY" > value: "Replace With Your True SECRET_KEY" > > ``` > > > [!TIP] > > > > If deploying in Azure, you need to set an additional environment variable: AZURE\_TENANT\_ID, which corresponds to the current tenant ID (tenantId). ### Set Fine-grained Scheduling Policies In Kubernetes, AutoMQ's fine-grained scheduling policy is implemented using node affinities and tolerations. Users are advised to customize label matching rules based on their node types: #### Tolerations It's recommended to add a taint to the Kubernetes node group with the key "dedicated," operator "Equal," value "automq," and effect "NoSchedule." Then, configure the corresponding toleration rules in global.tolerations to schedule Pods: ```yaml theme={null} global: tolerations: - key: "dedicated" operator: "Equal" value: "automq" effect: "NoSchedule" ``` #### Node Affinities Override default values in the controller/agent configuration to align with node labels (e.g., node-type: automq-worker): ```yaml theme={null} controller: nodeAffinity: requiredDuringSchedulingIgnoredDuringExecution: nodeSelectorTerms: - matchExpressions: - key: "node-type" operator: In values: ["automq-worker"] ``` ### Set up Auto-scaling #### Number of Controllers By default, the cluster deploys 3 Controller Pods, but users can customize the number of Controller replicas. > [!CAUTION] > > Note: Once the cluster is deployed, adjusting the number of Controller replicas is not supported to avoid unforeseen risks. ### Number of Brokers When `global.autoscaling.enabled=false`, `broker.replicas` controls the pure Broker count and defaults to 0. When autoscaling is enabled, the runtime autoscaler manages this count. ### Auto-scaling Configuration AutoMQ's built-in autoscaler runs in the active Controller. It tracks CPU and network utilization and updates the pure Broker StatefulSet replica count. It does not use Kubernetes HPA. Your node autoscaler must provide additional Kubernetes nodes when existing capacity is insufficient. #### Enable Chart integration Set the following in `values.yaml` and deploy the Chart: ```yaml theme={null} global: autoscaling: enabled: true ``` This grants access to `apps/statefulsets/scale` and stops Helm managing Broker replicas. Keep the generated Role/RoleBinding and ServiceAccount API access intact, and avoid other controllers overwriting the same replica count. > [!NOTE] > > The Chart switch does not enable runtime autoscaling. On a new cluster, `automq.autoscaling.enabled` defaults to `false`, and the policy and platform configuration are empty. With Chart autoscaling enabled, `broker.replicas` is omitted, so a new StatefulSet can initially default to one Broker. The runtime policy below brings it to at least three pure Brokers after activation; no initial manual scale command is required. #### Configure the runtime policy Find the pure Broker StatefulSet in the namespace used for your Helm release: ```bash theme={null} kubectl get statefulsets -n "" ``` Save the following as `autoscaling.properties`. Replace `` and `` with the actual deployment values. The Chart generates the StatefulSet name from the Helm release and naming overrides; use the Broker StatefulSet, not the Controller StatefulSet. ```properties theme={null} # Example capacity budget; adjust it to your workload and available nodes. # Capacity counts include 3 fixed combined Broker/Controller nodes. # minCount=6: at least 3 fixed nodes + 3 pure Brokers. # maxCount=30: at most 3 fixed nodes + 27 pure Brokers. # unit=3: align pure Broker capacity to groups of 3 for the three-AZ deployment. # targetTracking.cpu/network.enabled: use CPU/network metrics to calculate capacity. # targetRatio=1.0: target AutoMQ's 80% raw utilization safety watermark. # targetRatio must be explicit for each enabled signal; it has no default value. # The larger CPU/network capacity recommendation wins, subject to bounds and safety checks. # Omitted scalingBehavior fields use defaults, including a 30-minute scale-in stabilization window. automq.autoscaling.config={"capacity":{"minCount":6,"maxCount":30,"unit":3},"targetTracking":{"cpu":{"enabled":true,"targetRatio":1.0},"network":{"enabled":true,"targetRatio":1.0}}} # platform=k8s: scale the Broker StatefulSet through the Kubernetes API. # kubernetesNamespace: replace with the namespace used for your Helm release. # brokerStatefulSetName: replace with the actual pure Broker StatefulSet name. # Find it with: kubectl get statefulsets -n "" # The name is generated by the Chart from the Helm release and naming overrides; do not use the Controller StatefulSet. automq.autoscaling.platform.config={"platform":"k8s","kubernetesNamespace":"","brokerStatefulSetName":""} # Enable runtime autoscaling. Set false to stop it; existing replicas remain in place. # The Helm global.autoscaling.enabled switch must also be true to provide RBAC and hand over replicas. automq.autoscaling.enabled=true ``` The 6–30 node range is an example, not a default capacity policy or throughput guarantee. Edit `minCount`, `maxCount`, and `targetRatio` to fit your workload and node budget, then submit the file again. The active Controller uses the larger CPU/network capacity recommendation. Optional behavior settings have defaults, including a 30-minute scale-in stabilization window and a 10-minute scale-in cooldown. #### Apply or update the policy Use the AutoMQ Software CLI bundled with your server version. Prepare `admin.properties` with your cluster's authentication and TLS settings and an account authorized to alter broker-default configuration. Replace `` with a reachable Kafka bootstrap address including its port. ```bash theme={null} bin/kafka-configs.sh \ --bootstrap-server "" \ --command-config admin.properties \ --entity-type brokers --entity-default --alter \ --add-config-file autoscaling.properties ``` The policy takes effect without restarting Brokers. Saved broker-default dynamic configuration persists across subsequent Helm upgrades. #### Check configuration and capacity ```bash theme={null} bin/kafka-configs.sh \ --bootstrap-server "" \ --command-config admin.properties \ --entity-type brokers --entity-default --describe kubectl get statefulsets,pods -n "" -w ``` For decision details, inspect `AutoScaling decision` entries in the active Controller's `/data/logs/server.log`. Broker Pods can remain Pending if your node pool cannot supply capacity matching their scheduling constraints. #### Disable autoscaling Disable the runtime autoscaler first: ```bash theme={null} bin/kafka-configs.sh \ --bootstrap-server "" \ --command-config admin.properties \ --entity-type brokers --entity-default --alter \ --add-config automq.autoscaling.enabled=false ``` This leaves the current replica count in place. To return replica management to Helm, then set `global.autoscaling.enabled=false`, set `broker.replicas` to the desired fixed count, and run Helm upgrade. ### Identity Recognition Configuration AutoMQ allows overriding of protocol listeners and enabling secure authentication. By default, it uses the following ports: * Client to server access: 9092 (PLAINTEXT). * Internal communication between Controllers: 9093 (PLAINTEXT). * Internal communication between Brokers: 9094 (PLAINTEXT). AutoMQ also enables secure authentication by configuring listener overrides (e.g., enabling SASL authentication) for custom ports and protocols. Allowed values include 'PLAINTEXT', 'SASL\_PLAINTEXT', 'SASL\_SSL', and 'SSL'. ```yaml theme={null} listeners: client: - containerPort: 9092 protocol: SASL_PLAINTEXT name: BROKER_SASL controller: - containerPort: 9093 protocol: SASL_PLAINTEXT name: CONTROLLER_SASL interbroker: - containerPort: 9094 protocol: SASL_PLAINTEXT name: BROKER_SASL ``` > [!TIP] > > Additionally, you can set a password for it, which is randomly generated by default. ```yaml theme={null} sasl: controller: user: "user1" password: "PWDxxx" interbroker: user: "user2" password: "PWDxxx" client: user: "user3" password: "PWDxxx" ``` ### Configure Prometheus RemoteWrite Metrics Integration AutoMQ Server supports pushing cluster metrics directly to a user-defined Prometheus instance via the Prometheus RemoteWrite protocol. This approach eliminates the need to deploy additional Prometheus scraping components in the Kubernetes cluster, simplifying the monitoring architecture. Configure the `s3.telemetry.metrics.exporter.uri` parameter in `global.config` within your `values.yaml` to enable this feature. Choose the appropriate configuration format based on your Prometheus endpoint's authentication method: > [tab] No Auth > > For Prometheus endpoints that do not require authentication: > > ```yaml theme={null} > global: > config: | > s3.telemetry.metrics.exporter.uri=rw://?endpoint= > ``` > [tab] Basic Auth > > Using username and password for basic authentication: > > ```yaml theme={null} > global: > config: | > s3.telemetry.metrics.exporter.uri=rw://?endpoint=&auth=basic&username=&password= > ``` > [tab] Bearer Token > > Using Bearer Token for authentication: > > ```yaml theme={null} > global: > config: | > s3.telemetry.metrics.exporter.uri=rw://?endpoint=&auth=bearer&token= > ``` > [tab] AWS SigV4 > > Using AWS SigV4 signature authentication (suitable for Amazon Managed Prometheus and similar services): > > ```yaml theme={null} > global: > config: | > s3.telemetry.metrics.exporter.uri=rw://?endpoint=&auth=sigv4®ion= > ``` > [!TIP] > > Once RemoteWrite is enabled, AutoMQ will automatically push core metrics from Brokers and Controllers to the specified Prometheus endpoint. For detailed information on metrics monitoring and alerting configuration, refer to [Prometheus Monitoring & Alerting](/automq-cloud/monitoring-alert/monitoring-alert-via-prometheus). ### Configure Prometheus Pull metrics collection AutoMQ also supports pull-based metrics collection: a collector scrapes the Prometheus endpoint on each pod. To use this method with an annotation-based collector, apply the following settings in your `values.yaml`. If `global.config` already contains `s3.telemetry.metrics.exporter.uri`, replace its value with the `prometheus://` URI below. When switching from Remote Write to Pull, this replaces the existing `rw://` URI. Keep only one `s3.telemetry.metrics.exporter.uri` entry, and preserve all other configuration entries and existing pod annotations. ```yaml theme={null} global: config: | s3.telemetry.metrics.exporter.uri=prometheus://?host=0.0.0.0&port=9090 controller: annotations: prometheus.io/automq-scrape: "true" prometheus.io/automq-port: "9090" prometheus.io/automq-path: "/metrics" broker: annotations: prometheus.io/automq-scrape: "true" prometheus.io/automq-port: "9090" prometheus.io/automq-path: "/metrics" ``` The exporter URI starts the metrics listener at `http://:9090/metrics`. The annotations let a collector discover the endpoint on both controller and broker pods. Configure your collector's Kubernetes service discovery and relabeling rules to read these annotation keys; annotations alone do not start a listener or collect metrics. If you need a different metrics port, such as `9404`, change `port=9090` in the exporter URI and both `prometheus.io/automq-port` annotations to `9404`. Update any corresponding container or Service port declarations and NetworkPolicies used by your deployment. Changing only a Helm port declaration or annotation does not change the listener. Use a metrics port that is different from all Kafka listener ports, including client, controller, and inter-broker listeners. If Kubernetes NetworkPolicies restrict ingress to AutoMQ pods, allow traffic from your metrics collector to the configured metrics TCP port on both controller and broker pods (`9090` in this example). If the collector is subject to egress restrictions, allow the corresponding outbound traffic as well. Scope the rules to the collector and AutoMQ pod labels and namespaces used in your deployment. Scrape annotations do not grant network access. Apply the updated values with a Helm upgrade. From the collector's network, verify that `/metrics` returns Prometheus-format metrics on both controller and broker pods: ```bash theme={null} curl --fail http://:9090/metrics ``` Replace `` with a controller or broker pod IP and adjust the port if you changed it. You can use Grafana Alloy to scrape this endpoint and forward metrics to a Prometheus-compatible backend. To integrate with your monitoring system, see the corresponding guide: * [Prometheus monitoring and alerting](../monitoring-alert/monitoring-alert-via-prometheus) * [Datadog integration](../monitoring-alert/integrating-metrics-with-datadog) ## Security and Access Control AutoMQ supports multiple security configurations to protect your data in transit and control client access. This section covers the two primary security models for client authentication when deploying with the Helm chart: `SASL_SSL` and `SSL` (mutual TLS). These two paths are mutually exclusive. Choose the one that aligns with your organization's security policies. > [!TIP] > > Starting with the latest Helm chart, you only need to provide **one** TLS secret containing `ca.crt`, `tls.crt`, and `tls.key`. AutoMQ reuses this PEM bundle for **all** listeners and internal clients (AutoBalancer/admin) so there is no need to prepare separate certificates, and hostname verification for these built-in clients is automatically disabled when mTLS is enabled. > [!NOTE] > > The Helm values `tls.keystorePassword` and `tls.truststorePassword` are used only when loading JKS/PKCS12 keystores. For PEM-based deployments (the default when `tls.type=PEM` or certificates are auto-generated) the chart mounts the PEM files directly, so these passwords are typically left blank unless your private key itself is protected. *** ### Path 1: Configuring SASL\_SSL Authentication This is a common security model where clients authenticate using a username and password, and the communication channel is encrypted with TLS. #### Step 1: Configure `values.yaml` for SASL\_SSL You need to define a `SASL_SSL` listener, enable ACLs, and configure SASL users and their passwords. The server will present a TLS certificate to clients, but clients do not need their own certificate to authenticate. **Example `values.yaml` configuration:** ````yaml theme={null} # 1. Define a listener for SASL_SSL clients listeners: client: - containerPort: 9112 protocol: SASL_SSL name: CLIENT_SASL_SSL advertisedHostnames: enabled: true baseDomain: automq.private externalDns: privateZoneId: # 2. Reference the secret containing the server's TLS certificate tls: type: PEM existingSecret: automq-server-tls # Secret must contain server.crt, server.key, ca.crt # 3. Expose the SASL_SSL port externally externalAccess: controller: enabled: true service: type: LoadBalancer extraPorts: - name: "sasl-client" port: 9112 protocol: "TCP" targetPort: 9112 externalDns: enabled: true hostname: automq-bootstrap.automq.private privateZoneId: recordType: A ttl: 60 annotations: external-dns.alpha.kubernetes.io/evaluate-target-health: "false" # 4. Enable ACLs and define the SASL superuser acl: enabled: true superUsers: - "_automq" # 5. Define credentials for the superuser and regular client users sasl: controller: password: "\" user: _automq interbroker: password: "\" user: _automq client: users: - "my-user" # A regular application user passwords: - "" #### (Optional) Automate Route 53 binding with external-dns If you deploy on AWS and want Helm to publish the bootstrap DNS record automatically: 1. Install [external-dns](https://github.com/kubernetes-sigs/external-dns) in your cluster with `--source=service --provider=aws --policy=upsert-only --registry=txt`. Grant its IAM role `route53:ListHostedZones`, `route53:ListResourceRecordSets`, and `route53:ChangeResourceRecordSets`, and enable IRSA/credentials accordingly. 2. Ensure the base domain you configured under `listeners.client[].advertisedHostnames.baseDomain` exactly matches the Route 53 hosted zone (for example `automq.private`) and the `privateZoneId` fields reference the same zone ID. 3. Add/verify the following block: the controller Service keeps owning the bootstrap hostname, while the listener block tells Kafka which FQDNs to advertise. ```yaml listeners: client: - name: CLIENT_SASL_SSL containerPort: 9112 protocol: SASL_SSL advertisedHostnames: enabled: true baseDomain: automq.private externalDns: privateZoneId: externalAccess: controller: enabled: true service: type: LoadBalancer externalDns: enabled: true hostname: automq-bootstrap.automq.private privateZoneId: recordType: A ttl: 60 ```yaml Once the controller Service obtains an NLB and renders those annotations, external-dns will upsert `automq-bootstrap.automq.private` automatically. Set `externalAccess.controller.externalDns.enabled=false` if you prefer to copy the hostname and create the record manually. ```` #### Step 2: Post-Deployment ACL Management After deploying the cluster, you must use the superuser (`_automq`) to grant permissions to regular users like `my-user`. 1. **Configure an Admin Client (`superuser.properties`):** This file allows you to run admin tools by authenticating as `_automq`. ```properties theme={null} security.protocol=SASL_SSL sasl.mechanism=PLAIN sasl.jaas.config=org.apache.kafka.common.security.plain.PlainLoginModule required \ username="_automq" \ password="\"; # The client needs to trust the server's certificate ssl.truststore.certificates=/path/to/your/ca.crt ``` 2. **Grant Permissions:** Use `kafka-acls.sh` with the admin configuration to grant `WRITE` and `READ` permissions to `my-user`. ```bash theme={null} kafka-acls.sh --bootstrap-server :9112 \ --command-config superuser.properties \ --add --allow-principal User:my-user --operation WRITE --topic my-topic ``` #### Step 3: Client Configuration A regular application client (`my-user`) would use the following configuration. The client only needs to trust the server, which can be done by providing the CA certificate in a PEM file or a JKS truststore. **Example using PEM Truststore:** ```properties theme={null} # client.properties for 'my-user' security.protocol=SASL_SSL sasl.mechanism=PLAIN sasl.jaas.config=org.apache.kafka.common.security.plain.PlainLoginModule required \ username="my-user" \ password=""; # Path to the PEM file containing the CA certificate ssl.truststore.certificates=/path/to/your/ca.crt ``` **Example using JKS Truststore:** ```properties theme={null} # client.properties for 'my-user' security.protocol=SASL_SSL sasl.mechanism=PLAIN sasl.jaas.config=org.apache.kafka.common.security.plain.PlainLoginModule required \ username="my-user" \ password=""; ssl.truststore.location=/path/to/your/truststore.jks ssl.truststore.password=your_truststore_password ``` *** ### Path 2: Configuring SSL (mTLS) Authentication In this model, clients authenticate by presenting a TLS certificate that is trusted by the cluster. This is known as mutual TLS (mTLS). #### Step 1: Prepare Certificates You will need a hierarchy of certificates: * **Server Certificate:** For the AutoMQ brokers. * **Admin Client Certificate:** A certificate with a specific Common Name (e.g., `CN=automq-admin`) for an administrator who will be designated as a superuser. * **Application Client Certificate:** A unique certificate for each client application (e.g., `CN=my-app`). #### Step 2: Configure `values.yaml` for mTLS You need to define an `SSL` listener, require client authentication, and set the admin certificate's principal as the superuser. **Example `values.yaml` configuration:** ```yaml theme={null} # 1. Define a listener for mTLS clients and require client certs listeners: client: - containerPort: 9122 protocol: SSL name: CLIENT_MTLS # This enforces mTLS sslClientAuth: required advertisedHostnames: enabled: true baseDomain: automq.private externalDns: privateZoneId: # 2. Reference the secret containing the server's TLS certificate tls: type: PEM existingSecret: automq-server-tls # 3. Expose the SSL port externally externalAccess: controller: enabled: true service: type: LoadBalancer extraPorts: - name: "tls-client" port: 9122 protocol: "TCP" targetPort: 9122 externalDns: enabled: true hostname: automq-bootstrap.automq.private privateZoneId: recordType: A ttl: 60 # 4. Enable ACLs and define the certificate-based superuser acl: enabled: true # The principal is 'User:' + the full Subject of the admin certificate superUsers: - "User:CN=automq-admin" # 5. SASL is still used for internal communication sasl: # ... configuration for _automq ... ``` #### Step 3: Post-Deployment ACL Management After deployment, use the admin certificate to grant permissions to regular application principals. 1. **Configure an Admin Client (`admin.properties`):** This file uses the admin certificate (`CN=automq-admin`) to authenticate. **Example using PEM files (Recommended):** ```properties theme={null} security.protocol=SSL ssl.truststore.certificates=/path/to/your/ca.crt ssl.keystore.key=/path/to/your/admin.key ssl.keystore.certificate.chain=/path/to/your/admin.crt ``` **Example using JKS files:** ```properties theme={null} security.protocol=SSL ssl.truststore.location=/path/to/your/truststore.jks ssl.truststore.password=your_truststore_password ssl.keystore.location=/path/to/your/admin-keystore.jks ssl.keystore.password=your_keystore_password ``` 2. **Grant Permissions:** Use `kafka-acls.sh` to grant permissions to the application principal `User:CN=my-app`. ```bash theme={null} kafka-acls.sh --bootstrap-server :9122 \ --command-config admin.properties \ --add --allow-principal "User:CN=my-app" --operation WRITE --topic my-topic ``` #### Step 4: Client Configuration A regular application client would use its own unique certificate (`CN=my-app`) to connect. **Example using PEM files (Recommended):** ```properties theme={null} # client.properties for 'my-app' security.protocol=SSL ssl.truststore.certificates=/path/to/your/ca.crt ssl.keystore.key=/path/to/your/myapp.key ssl.keystore.certificate.chain=/path/to/your/myapp.crt ``` **Example using JKS files:** ```properties theme={null} # client.properties for 'my-app' security.protocol=SSL ssl.truststore.location=/path/to/your/truststore.jks ssl.truststore.password=your_truststore_password ssl.keystore.location=/path/to/your/myapp-keystore.jks ssl.keystore.password=your_keystore_password ``` ```bash theme={null} # Create a topic ./kafka-topics.sh --create --bootstrap-server \ --replication-factor 1 --partitions 3 --topic \ --command-config client-mtls.properties ``` ## Performance Tuning For more details on performance tuning, refer to the [AutoMQ Performance Tuning Guide](https://docs.automq.com/automq/deployment/performance-tuning-for-broker). # GCP BYOC Console Upgrade Guide to v8.x Source: https://docs.automq.com/automq-cloud/appendix/gcp-byoc-console-upgrade-to-8.x-guide ## Background AutoMQ Console 8.x is distributed and started as a Docker image. For an existing AutoMQ BYOC environment on Google Cloud, the upgrade keeps the existing environment data and instances while moving the console service to Docker image mode. This guide applies to GCP 7.x environments that need to upgrade to 8.x. For new environments, see [Install AutoMQ on Google Cloud](/automq-cloud/getting-started/install-byoc-environment/google-cloud/install-automq-on-gcp). ## Constraints * GCP BYOC environments currently support GKE Standard only. * GCP IaaS and GKE Autopilot are not supported. * Before the upgrade, confirm that existing GKE clusters, node pools, VPCs, subnets, Cloud DNS private managed zones, and related cloud resources still exist. * The upgrade requires AutoMQ technical personnel to generate environment metadata and Docker startup parameters. ## Pre-upgrade checks Confirm the following information: * You can SSH into the console VM. * The original console data directory still exists, such as `/home/admin/.cmp/data`. * The environment ID and deployment region match the current environment. * The Google Service Account bound to the current VM is still the control plane identity used by the AutoMQ console. During the GCP upgrade, the console reads some cloud resources during startup. We recommend checking that the console Google Service Account has these read permissions: | Check item | Recommended permission | | - | - | | Read the Cloud DNS private managed zone | At least `dns.managedZones.get`. `roles/dns.reader` or `roles/dns.admin` usually covers this. | | Read the GKE node pool | At least `container.nodePools.get`. `roles/container.viewer` or `roles/container.admin` usually covers this. | | Read Shared VPC network resources | In Shared VPC environments, grant network read permissions in the host project, such as `roles/compute.networkViewer`. | > [!TIP] > > If the console asks you to initialize permissions after the upgrade, follow the GCP permission instructions on the page and grant the required permissions to the console Google Service Account. > [!TIP] > > For GCP GKE clusters created by 7.x, the data plane usually still obtains cloud resource permissions through the VM Service Account bound to the node pool. As long as the node pool still uses instance metadata, and the original VM Service Account still has the required GCS, Cloud DNS, Compute, and related permissions, existing clusters usually continue to run normally. > > 8.x introduces a new Workload Identity permission model: AutoMQ Pods use a Kubernetes ServiceAccount to bind to an instance Google Service Account (GSA), and that GSA accesses GCP resources. This model mainly affects data plane permission configuration for clusters created or updated in the 8.x mode. > > Therefore, upgrading the console itself does not require you to immediately change the metadata mode of existing node pools, and it does not require you to immediately remove permissions from the node pool VM Service Account. For existing 7.x clusters, keep the original node pool authorization unchanged during the upgrade to avoid affecting the running data plane. ## Upgrade steps The overall process is: register an AutoMQ account, confirm deployment information, obtain the upgrade command, stop the old console, back up the database, install Docker, start the new console, and update the license. ### 1. Register an organization and account Go to the AutoMQ website and register an organization and account: [https://console.automq.cloud/](https://console.automq.cloud/). After registration, provide the organization ID to AutoMQ technical personnel. ### 2. Confirm deployment information Confirm the deployment information of your current BYOC console and send it to AutoMQ technical personnel. This information is used to migrate environment metadata and generate the installation command. Collect the following information: * Environment ID * Deployment region * Current console version * Installation ID * Console endpoint * Console Google Service Account We recommend logging in to the old AutoMQ console and checking the settings page. You can also confirm the information from the original startup script, systemd unit, or environment variable file. ### 3. Obtain the upgrade command AutoMQ technical personnel create or complete the environment record in AutoMQ Cloud based on the current environment information, and then generate the upgrade installation command. The command already contains the environment ID, cloud provider, region, authentication parameters, and Docker image address. Depending on the target version, the upgrade installation command may use explicit environment variables or a `CONFIG` parameter that carries the encoded environment configuration. Do not assemble these parameters manually. Before you run the command, confirm that the cloud provider, region, and image version match the current environment. If the image registry requires login, also confirm that you have the Docker registry credentials. ### 4. Stop the old console SSH into the console VM and stop the old console service. This prevents the old process from writing to the database while you back it up and prevents two console processes from occupying the same ports. ```bash theme={null} sudo systemctl stop cmp.service sudo systemctl status cmp.service --no-pager ``` If the old service is configured to restart automatically, disable it during the upgrade window: ```bash theme={null} sudo systemctl disable cmp.service ``` Confirm that the old process and ports have been released: ```bash theme={null} ps -ef | grep -E 'cmp|java' | grep -v grep ss -ltnp | grep -E ':8080|:8085' || true ``` ### 5. Back up the database Back up the local SQLite database after the old console stops. The wildcard also includes any WAL and SHM files. ```bash theme={null} ts=$(date -u +%Y%m%dT%H%M%SZ) backup_dir=/home/admin/cmp-migration-backup-$ts mkdir -p "$backup_dir" cp -a /home/admin/.cmp/data/sqlite.db* "$backup_dir"/ ``` Confirm that the backup files were created and record the backup directory for rollback: ```bash theme={null} ls -lh "$backup_dir" echo "$backup_dir" ``` ### 6. Install Docker Install Docker by following the official [Docker Engine installation instructions](https://docs.docker.com/engine/install/) for the VM's operating system. Then confirm that Docker is installed and running: ```bash theme={null} sudo systemctl start docker sudo systemctl enable docker sudo docker version ``` If the image registry requires authentication, log in first and confirm that you can pull the image. ```bash theme={null} sudo docker login sudo docker pull /automq/automq_byoc_console: ``` ### 7. Start the AutoMQ console Copy the upgrade installation command shown in Step 3 to start the new AutoMQ console. The following command is only a GCP Docker startup example. Use the command generated in Step 3 for the actual upgrade. The generated command contains credentials. Do not share it or save it in a shared shell history. ```bash theme={null} sudo docker run -d \ --name automq-cmp \ --network host \ -v /home/admin:/root \ -e CLOUD_PROVIDER=gcp \ -e REGION=us-central1 \ -e ENVIRONMENT_ID=env-xxxx \ -e OPS_BUCKET=automq-ops-xxxx \ -e CLIENT_ID=env-xxxx \ -e CLIENT_SECRET="" \ -e CONSOLE_INITIAL_USER="" \ -e CONSOLE_INITIAL_PASSWORD="" \ /automq/automq_byoc_console: ``` After you run the upgrade installation command, check the Docker container status and logs: ```bash theme={null} sudo docker ps sudo docker logs -f automq-cmp ``` After the Docker container runs correctly and port 8080 is reachable, you can access the AutoMQ console service in your browser. ### 8. Update the License Because 8.x changes the installation media and startup method, the installation ID may change. After you log in to the new console, if the page shows that the License is invalid, copy the installation ID displayed on the page and contact AutoMQ technical personnel to update the License information. > [!TIP] > > A License invalid prompt during the upgrade does not affect existing clusters. ## Roll back If Docker startup fails and you have not run any instance updates, you can roll back to the original systemd mode. ```bash theme={null} sudo docker rm -f automq-cmp backup_dir="" cp -a "$backup_dir"/sqlite.db* /home/admin/.cmp/data/ sudo systemctl enable cmp.service sudo systemctl start cmp.service sudo systemctl status cmp.service --no-pager ``` If you have already run instance updates, contact AutoMQ technical personnel to confirm the Helm release, Kubernetes resources, and cloud resource states before rolling back the database. Do not overwrite the database until you understand the current cloud resource state. ## Troubleshooting ### Docker container fails to start Check the following items: * Whether the Docker image can be pulled. * Whether the Docker registry token has expired. * Whether ports 8080 or 8085 are still occupied by the old process. * Whether `/home/admin` is mounted to `/root` in the container. * Whether the SQLite files can be read by the container process. ### Console reports insufficient permissions after startup Check the following items: * Whether the Google Service Account bound to the console VM is correct. * Whether the console Google Service Account can read GKE, Cloud DNS, VPC, subnet, and related resources. * In Shared VPC environments, whether the host project has granted network read permissions. * Whether you have completed the recommended permissions shown on the console system-init page. # Helm Chart Values Documentation Source: https://docs.automq.com/automq-cloud/appendix/helm-chart-values-readme Definitions and recommended settings for the AutoMQ Software Helm Chart 5.5.6. # automq-software-chart ![Version: 5.5.6](https://img.shields.io/badge/Version-5.5.6-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 5.5.6](https://img.shields.io/badge/AppVersion-5.5.6-informational?style=flat-square) A Helm chart for AutoMQ Enterprise ## Requirements | Repository | Name | Version | | - | - | - | | oci://registry-1.docker.io/bitnamicharts | common | 2.x.x | ## Values | Key | Type | Default | Description | | - | - | - | - | | acl.enabled | bool | `false` | @param acl.enabled Enable ACLs for AutoMQ # | | acl.superUsers | list | `[]` | @param acl.superUsers Comma-separated list of super users for AutoMQ ACLs # | | broker | object | `{"annotations":{},"env":[],"extraConfig":"","labels":{},"partition":0,"persistence":{"fallback":{"accessMode":"ReadWriteOnce","annotations":{},"enabled":false,"size":"20Gi","storageClass":""},"wal":{"accessMode":"ReadWriteOnce","annotations":{},"enabled":true,"size":"20Gi","storageClass":""}},"replicas":0,"resources":{},"topologySpreadConstraints":[]}` | @section Broker statefulset parameters # | | broker.annotations | object | `{}` | @param broker.annotations Extra annotations for AutoMQ broker pods # | | broker.env | list | `[]` | @param broker.env Extra env arrays for AutoMQ broker pods # Set KAFKA\_HEAP\_OPTS explicitly according to resources.limits.memory. As a recommended starting # point, set both -Xms and -Xmx to 75% of the Pod memory limit and adjust for the workload. # For example, use 12g for a 16Gi limit. # E.g. # env: # - name: "KAFKA\_HEAP\_OPTS" # value: "-Xms12g -Xmx12g -XX:MetaspaceSize=96m" # - name: "KAFKA\_OPTS" # value: "-XX:+ExitOnOutOfMemoryError -XX:+HeapDumpOnOutOfMemoryError" # | | broker.extraConfig | string | `""` | @param controller.extraConfig Extra configuration file for Kafka controller nodes, rendered as a template. Auto-generated based on chart values when not specified. # | | broker.labels | object | `{}` | @param broker.labels Extra labels for AutoMQ broker pods # | | broker.partition | int | `0` | @param broker.partition Partition rolling update strategy for AutoMQ controller nodes # | | broker.persistence | object | `{"fallback":{"accessMode":"ReadWriteOnce","annotations":{},"enabled":false,"size":"20Gi","storageClass":""},"wal":{"accessMode":"ReadWriteOnce","annotations":{},"enabled":true,"size":"20Gi","storageClass":""}}` | Enable persistence using Persistent Volume Claims # ref: [https://kubernetes.io/docs/concepts/storage/persistent-volumes/](https://kubernetes.io/docs/concepts/storage/persistent-volumes/) # | | broker.persistence.fallback | object | `{"accessMode":"ReadWriteOnce","annotations":{},"enabled":false,"size":"20Gi","storageClass":""}` | fallback volume for AutoMQ broker nodes | | broker.persistence.fallback.accessMode | string | `"ReadWriteOnce"` | @param broker.persistence.fallback.accessModes Persistent fallback Volume Access Modes # | | broker.persistence.fallback.annotations | object | `{}` | @param broker.persistence.fallback.annotations Annotations for the fallback PVC # | | broker.persistence.fallback.size | string | `"20Gi"` | @param broker.persistence.fallback.size PVC Storage Request for AutoMQ fallback volume # | | broker.persistence.fallback.storageClass | string | `""` | @param broker.persistence.fallback.storageClass PVC Storage Class for AutoMQ fallback volume # | | broker.persistence.wal | object | `{"accessMode":"ReadWriteOnce","annotations":{},"enabled":true,"size":"20Gi","storageClass":""}` | wal volume for AutoMQ broker nodes # | | broker.persistence.wal.accessMode | string | `"ReadWriteOnce"` | @param broker.persistence.wal.accessModes Persistent wal Volume Access Modes # | | broker.persistence.wal.annotations | object | `{}` | @param broker.persistence.wal.annotations Annotations for the PVC # | | broker.persistence.wal.size | string | `"20Gi"` | @param broker.persistence.wal.size PVC Storage Request for AutoMQ wal volume # | | broker.persistence.wal.storageClass | string | `""` | @param broker.persistence.wal.storageClass PVC Storage Class for the AutoMQ WAL volume. Set this during initial installation even when broker.replicas is zero because the StatefulSet volumeClaimTemplate is immutable # | | broker.replicas | int | `0` | @param broker.replicas Number of additional data-plane-only AutoMQ broker nodes # | | broker.resources | object | `{}` | @param broker.resources Set container requests and limits for different resources like CPU or memory (essential for production workloads) # E.g. # resources: # requests: # cpu: 2 # memory: 12Gi # limits: # cpu: 3 # memory: 16Gi # | | controller | object | `{"annotations":{},"args":[],"command":[],"env":[],"extraConfig":"","labels":{},"partition":0,"persistence":{"fallback":{"accessMode":"ReadWriteOnce","annotations":{},"enabled":false,"size":"20Gi","storageClass":""},"metadata":{"accessMode":"ReadWriteOnce","annotations":{},"size":"20Gi","storageClass":""},"wal":{"accessMode":"ReadWriteOnce","annotations":{},"enabled":true,"size":"20Gi","storageClass":""}},"replicas":3,"resources":{},"topologySpreadConstraints":[]}` | @section Controller statefulset parameters # | | controller.annotations | object | `{}` | @param controller.annotations Extra annotations for AutoMQ Controller pods # | | controller.env | list | `[]` | @param controller.env Extra env arrays for AutoMQ Controller pods # Set KAFKA\_HEAP\_OPTS explicitly according to resources.limits.memory. As a recommended starting # point, set both -Xms and -Xmx to 75% of the Pod memory limit and adjust for the workload. # For example, use 12g for a 16Gi limit. # E.g. # env: # - name: "KAFKA\_HEAP\_OPTS" # value: "-Xms12g -Xmx12g -XX:MetaspaceSize=96m" # - name: "KAFKA\_OPTS" # value: "-XX:+ExitOnOutOfMemoryError -XX:+HeapDumpOnOutOfMemoryError" # | | controller.extraConfig | string | `""` | @param controller.extraConfig Extra configuration file for Kafka controller nodes, rendered as a template. Auto-generated based on chart values when not specified. # | | controller.labels | object | `{}` | @param controller.labels Extra labels for AutoMQ Controller pods # | | controller.partition | int | `0` | @param controller.partition Partition rolling update strategy for AutoMQ controller nodes # | | controller.persistence | object | `{"fallback":{"accessMode":"ReadWriteOnce","annotations":{},"enabled":false,"size":"20Gi","storageClass":""},"metadata":{"accessMode":"ReadWriteOnce","annotations":{},"size":"20Gi","storageClass":""},"wal":{"accessMode":"ReadWriteOnce","annotations":{},"enabled":true,"size":"20Gi","storageClass":""}}` | Enable persistence using Persistent Volume Claims # ref: [https://kubernetes.io/docs/concepts/storage/persistent-volumes/](https://kubernetes.io/docs/concepts/storage/persistent-volumes/) # | | controller.persistence.fallback | object | `{"accessMode":"ReadWriteOnce","annotations":{},"enabled":false,"size":"20Gi","storageClass":""}` | fallback volume for AutoMQ controller nodes | | controller.persistence.fallback.accessMode | string | `"ReadWriteOnce"` | @param controller.persistence.fallback.accessModes Persistent fallback Volume Access Modes # | | controller.persistence.fallback.annotations | object | `{}` | @param controller.persistence.fallback.annotations Annotations for the fallback PVC # | | controller.persistence.fallback.size | string | `"20Gi"` | @param controller.persistence.fallback.size PVC Storage Request for AutoMQ fallback volume # | | controller.persistence.fallback.storageClass | string | `""` | @param controller.persistence.fallback.storageClass PVC Storage Class for AutoMQ fallback volume # | | controller.persistence.metadata | object | `{"accessMode":"ReadWriteOnce","annotations":{},"size":"20Gi","storageClass":""}` | kraft metadata volume for AutoMQ controller nodes # | | controller.persistence.metadata.accessMode | string | `"ReadWriteOnce"` | @param controller.persistence.metadata.accessMode Persistent metadata Volume Access Modes # | | controller.persistence.metadata.annotations | object | `{}` | @param controller.persistence.metadata.annotations Annotations for the PVC # | | controller.persistence.metadata.size | string | `"20Gi"` | @param controller.persistence.metadata.size PVC Storage Request for AutoMQ metadata volume # | | controller.persistence.metadata.storageClass | string | `""` | @param controller.persistence.metadata.storageClass PVC Storage Class for AutoMQ metadata volume # | | controller.persistence.wal | object | `{"accessMode":"ReadWriteOnce","annotations":{},"enabled":true,"size":"20Gi","storageClass":""}` | wal volume for AutoMQ controller nodes # | | controller.persistence.wal.accessMode | string | `"ReadWriteOnce"` | @param controller.persistence.wal.accessModes Persistent wal Volume Access Modes # | | controller.persistence.wal.annotations | object | `{}` | @param controller.persistence.wal.annotations Annotations for the PVC # | | controller.persistence.wal.size | string | `"20Gi"` | @param controller.persistence.wal.size PVC Storage Request for AutoMQ wal volume # | | controller.persistence.wal.storageClass | string | `""` | @param controller.persistence.wal.storageClass PVC Storage Class for AutoMQ wal volume # | | controller.replicas | int | `3` | @param controller.replicas Number of controller-eligible AutoMQ nodes. Use three replicas for production high availability; these nodes also serve Kafka traffic # | | controller.resources | object | `{}` | @param controller.resources Set container requests and limits for different resources like CPU or memory (essential for production workloads) # E.g. # resources: # requests: # cpu: 2 # memory: 12Gi # limits: # cpu: 3 # memory: 16Gi # | | externalAccess.broker.enabled | bool | `false` | | | externalAccess.broker.externalDns.annotations | object | `{}` | | | externalAccess.broker.externalDns.enabled | bool | `false` | | | externalAccess.broker.externalDns.hostname | string | `""` | | | externalAccess.broker.externalDns.privateZoneId | string | `""` | | | externalAccess.broker.externalDns.recordType | string | `"A"` | | | externalAccess.broker.externalDns.ttl | int | `60` | | | externalAccess.broker.externalDns.zoneId | string | `""` | | | externalAccess.broker.service.annotations | object | `{}` | | | externalAccess.broker.service.extraPorts | list | `[]` | | | externalAccess.broker.service.labels | object | `{}` | | | externalAccess.broker.service.loadBalancerAnnotations | object | `{}` | | | externalAccess.broker.service.type | string | `"LoadBalancer"` | | | externalAccess.controller.enabled | bool | `false` | | | externalAccess.controller.externalDns.annotations | object | `{}` | | | externalAccess.controller.externalDns.enabled | bool | `false` | | | externalAccess.controller.externalDns.hostname | string | `""` | | | externalAccess.controller.externalDns.privateZoneId | string | `""` | | | externalAccess.controller.externalDns.recordType | string | `"A"` | | | externalAccess.controller.externalDns.ttl | int | `60` | | | externalAccess.controller.externalDns.zoneId | string | `""` | | | externalAccess.controller.forceExpose | bool | `false` | | | externalAccess.controller.service.annotations | object | `{}` | | | externalAccess.controller.service.extraPorts | list | `[]` | | | externalAccess.controller.service.labels | object | `{}` | | | externalAccess.controller.service.loadBalancerAnnotations | object | `{}` | | | externalAccess.controller.service.type | string | `"LoadBalancer"` | | | extraVolumeMounts | list | `[]` | | | extraVolumes | list | `[]` | | | global.automqInstanceId | string | `""` | @param global.automqInstanceId AutoMQ instance ID used for instance-scoped integrations such as managed DNS | | global.autoscaling | object | `{"enabled":false}` | @section Experimental: Controller-driven Broker AutoScaling configuration | | global.autoscaling.enabled | bool | `false` | @param global.autoscaling.enabled Allow the AutoMQ Controller to own the Broker replica count. When enabled, the chart omits Broker StatefulSet spec.replicas and grants permission to update the statefulsets/scale subresource. This value does not enable the AutoMQ runtime autoscaler or configure its policy. After deploying the chart with this value enabled, configure automq.autoscaling.config and automq.autoscaling.platform.config through Kafka broker-default dynamic configuration, then set automq.autoscaling.enabled=true. To disable autoscaling, reverse the order: disable the runtime autoscaler first, then let the chart manage broker.replicas again. # | | global.cloudProvider.credentials | string | `""` | @param global.cloudProvider.credentials Credential URI used by AutoMQ. Use `instance://` for a VM identity, `pod://` for a Kubernetes workload identity, or `static://` for explicit credentials. Prefer an identity-based mode over static credentials in production E.g. instance://?role=\ or static://?accessKey=\\&secretKey=\ # | | global.cloudProvider.dnsCrossAccountRoleArn | string | `""` | @param global.cloudProvider.dnsCrossAccountRoleArn IAM role ARN assumed for AutoMQ-managed Route 53 records Only needed when `listeners.*.advertisedHostnames` targets a public or private hosted zone in another AWS account. This role is not used by the separately deployed external-dns controller Value is a plain ARN string, e.g. arn:aws:iam::123456789012:role/automq-dns-env-abc # | | global.cloudProvider.name | string | `""` | @param global.cloudProvider.name Cloud provider where AutoMQ is running E.g. aws, azure, gcp, etc. # | | global.clusterId | string | `""` | @param global.clusterId Existing AutoMQ cluster ID. Leave empty to let the chart generate one | | global.commonAnnotations | object | `{}` | @param global.commonAnnotations Annotations to add to all deployed objects # | | global.commonLabels | object | `{}` | @param global.commonLabels Labels to add to all deployed objects # | | global.config | string | `"# Data storage (required)\ns3.data.buckets=0@s3://xxx_bucket?region=us-east-1\n\n# Operations storage (required)\ns3.ops.buckets=1@s3://xxx_bucket?region=us-east-1\n\n# WAL (required)\n# For block WAL, use block:///dev/wal and set controller.persistence.wal.enabled=true.\n# Also set broker.persistence.wal.enabled=true when broker.replicas is greater than zero.\n# For object-storage WAL, use an object-storage URI and disable the corresponding WAL PVCs.\ns3.wal.path=0@block:///dev/wal\n\n# Performance tuning\n# Recommended settings for a 3GiB heap:\n# s3.wal.cache.size=524288000\n# s3.block.cache.size=104857600\n# s3.wal.upload.threshold=62914560\n\n# Recommended settings for a 6GiB heap:\n# s3.wal.cache.size=2147483648\n# s3.block.cache.size=536870912\n# s3.wal.upload.threshold=357913941\n\n# Recommended settings for a 12GiB heap:\n# s3.wal.cache.size=4294967296\n# s3.block.cache.size=1073741824\n# s3.wal.upload.threshold=536870912\n\n# Recommended settings for a 24GiB heap:\n# s3.wal.cache.size=8589934592\n# s3.block.cache.size=2147483648\n# s3.wal.upload.threshold=1073741824\n\n# Set the broker's baseline network bandwidth in bytes/s, not its burst bandwidth.\n# s3.network.baseline.bandwidth=\n"` | @param global.config Shared AutoMQ properties applied to Controller and Broker nodes # | | global.existingSecretConfig | string | `""` | NOTE: This will override secretConfig value # | | global.image.pullPolicy | string | `"Always"` | | | global.image.pullSecrets | list | `[]` | | | global.image.registry | string | `"automq-docker-registry-registry.cn-hangzhou.cr.aliyuncs.com"` | @param global.image.registry Global Docker image registry | | global.image.repository | string | `"automq/automq-enterprise"` | | | global.image.schemaRegistry | object | `{"repository":"automq/karapace","tag":"6.2.0"}` | @param global.image.schemaRegistry Global Docker image schema registry | | global.image.tag | string | `"5.5.6"` | | | global.livenessProbe | object | `{"failureThreshold":4,"initialDelaySeconds":60,"periodSeconds":15,"probePort":9092,"successThreshold":1,"timeoutSeconds":1}` | Configure extra options for Kafka containers' liveness probes # | | global.livenessProbe.failureThreshold | int | `4` | @param global.livenessProbe.failureThreshold Failure threshold for livenessProbe # | | global.livenessProbe.initialDelaySeconds | int | `60` | @param global.livenessProbe.initialDelaySeconds Initial delay seconds for livenessProbe # | | global.livenessProbe.periodSeconds | int | `15` | @param global.livenessProbe.periodSeconds Period seconds for livenessProbe # | | global.livenessProbe.probePort | int | `9092` | @param global.probePort tcp socket port for livenessProbe and readinessProbe check # | | global.livenessProbe.successThreshold | int | `1` | @param global.livenessProbe.successThreshold Success threshold for livenessProbe # | | global.livenessProbe.timeoutSeconds | int | `1` | @param global.livenessProbe.timeoutSeconds Timeout seconds for livenessProbe # | | global.nodeAffinities | list | `[{"key":"kubernetes.io/arch","values":["amd64"]}]` | @param global.nodeAffinities Affinity for node assignment # | | global.nodeTuning | object | `{"enabled":false}` | Optional privileged node tuning. Enables BBR and sets vm.max\_map\_count=524288, which supports ZGC heaps up to 128 GiB. | | global.nodeTuning.enabled | bool | `false` | @param global.nodeTuning.enabled Create the privileged node-tuning DaemonSet | | global.readinessProbe | object | `{"failureThreshold":8,"initialDelaySeconds":10,"periodSeconds":10,"probePort":9092,"successThreshold":1,"timeoutSeconds":1}` | Configure extra options for Kafka containers' readiness probes # | | global.readinessProbe.failureThreshold | int | `8` | @param global.readinessProbe.failureThreshold Failure threshold for readinessProbe # | | global.readinessProbe.initialDelaySeconds | int | `10` | @param global.readinessProbe.initialDelaySeconds Initial delay seconds for readinessProbe # | | global.readinessProbe.periodSeconds | int | `10` | @param global.readinessProbe.periodSeconds Period seconds for readinessProbe # | | global.readinessProbe.probePort | int | `9092` | @param global.probePort tcp socket port for livenessProbe and readinessProbe check # | | global.readinessProbe.successThreshold | int | `1` | @param global.readinessProbe.successThreshold Success threshold for readinessProbe # | | global.readinessProbe.timeoutSeconds | int | `1` | @param global.readinessProbe.timeoutSeconds Timeout seconds for readinessProbe # | | global.serviceAccount.annotations | object | `{}` | @param global.serviceAccount.annotations Annotations for the AutoMQ ServiceAccount AWS IRSA example: annotations: eks.amazonaws.com/role-arn: arn:aws:iam::\:role/\ When using IRSA, also set global.cloudProvider.name=aws and global.cloudProvider.credentials=pod://?. The IAM role must trust this ServiceAccount and grant access to the configured S3 buckets and any EBS operations required by the selected WAL mode. # | | global.serviceAccount.create | bool | `true` | @param global.serviceAccount.create Create a ServiceAccount for AutoMQ | | global.serviceAccount.name | string | `""` | If not set and create is true, a name is generated using "automq-sa" # | | global.tolerations | list | `[{"effect":"NoSchedule","key":"dedicated","operator":"Equal","value":"automq"}]` | Ref: [https://kubernetes.io/docs/concepts/configuration/taint-and-toleration/](https://kubernetes.io/docs/concepts/configuration/taint-and-toleration/) # | | global.topologySpreadWhenUnsatisfiable | string | `"DoNotSchedule"` | @param global.topologySpreadWhenUnsatisfiable Topology spread when unsatisfiable schedule policy # | | global.zoneSpreadConstraints | bool | `false` | @param global.zoneSpreadConstraints Availability Zone Balancing Constraint of AutoMQ nodes # | | listeners.client\[0].advertisedHostnames.baseDomain | string | `""` | @param listeners.client.advertisedHostnames.baseDomain Expected Route53/Private DNS base domain for validation and advertised listener overrides | | listeners.client\[0].advertisedHostnames.enabled | bool | `false` | @param listeners.client.advertisedHostnames.enabled Enable AutoMQ-managed DNS records for this listener | | listeners.client\[0].advertisedHostnames.externalDns.privateZoneId | string | `""` | @param listeners.client.advertisedHostnames.externalDns.privateZoneId Deprecated alias for zoneId; despite its name, it accepts public or private hosted zone IDs | | listeners.client\[0].advertisedHostnames.externalDns.zoneId | string | `""` | @param listeners.client.advertisedHostnames.externalDns.zoneId Route 53 hosted zone ID | | listeners.client\[0].advertisedHostnames.externalDns.zoneType | string | `""` | @param listeners.client.advertisedHostnames.externalDns.zoneType Route 53 hosted zone type. Allowed values are `PUBLIC` and `PRIVATE` | | listeners.client\[0].advertisedHostnames.hostnamePattern | string | `""` | @param listeners.client.advertisedHostnames.hostnamePattern Optional template for DNS record names. Defaults to kernel fallback when empty | | listeners.client\[0].advertisedHostnames.ttl | string | `nil` | @param listeners.client.advertisedHostnames.ttl TTL override (seconds) for Route53 records created by the kernel. Leave null to use the default | | listeners.client\[0].containerPort | int | `9092` | @param listeners.client.containerPort Port for the Kafka client listener # | | listeners.client\[0].name | string | `"PLAINTEXT"` | listeners.client.name Name for the Kafka client listener | | listeners.client\[0].protocol | string | `"PLAINTEXT"` | @param listeners.client.protocol Security protocol for the Kafka client listener. Allowed values are 'PLAINTEXT', 'SASL\_PLAINTEXT', 'SASL\_SSL' and 'SSL' # | | listeners.client\[0].sslClientAuth | string | `""` | @param listeners.client.sslClientAuth Optional. If SASL\_SSL is enabled, configure mTLS TLS authentication type. If SSL protocol is enabled, overrides tls.authType for this listener. Allowed values are 'none', 'requested' and 'required' # | | listeners.controller\[0].advertisedHostnames.baseDomain | string | `""` | @param listeners.controller.advertisedHostnames.baseDomain Expected Route 53 or private DNS base domain for validation and advertised listener overrides | | listeners.controller\[0].advertisedHostnames.enabled | bool | `false` | @param listeners.controller.advertisedHostnames.enabled Enable AutoMQ-managed DNS records for this listener | | listeners.controller\[0].advertisedHostnames.externalDns.privateZoneId | string | `""` | @param listeners.controller.advertisedHostnames.externalDns.privateZoneId Deprecated alias for zoneId; despite its name, it accepts public or private hosted zone IDs | | listeners.controller\[0].advertisedHostnames.externalDns.zoneId | string | `""` | @param listeners.controller.advertisedHostnames.externalDns.zoneId Route 53 hosted zone ID | | listeners.controller\[0].advertisedHostnames.externalDns.zoneType | string | `""` | @param listeners.controller.advertisedHostnames.externalDns.zoneType Route 53 hosted zone type. Allowed values are `PUBLIC` and `PRIVATE` | | listeners.controller\[0].advertisedHostnames.hostnamePattern | string | `""` | @param listeners.controller.advertisedHostnames.hostnamePattern Optional template for DNS record names. Defaults to kernel fallback when empty | | listeners.controller\[0].advertisedHostnames.ttl | string | `nil` | @param listeners.controller.advertisedHostnames.ttl TTL override in seconds for Route 53 records created by AutoMQ. Leave null to use the default | | listeners.controller\[0].containerPort | int | `9093` | @param listeners.controller.containerPort Port for the Kafka controller listener # | | listeners.controller\[0].name | string | `"CONTROLLER"` | @param listeners.controller.name Name for the Kafka controller listener # | | listeners.controller\[0].protocol | string | `"PLAINTEXT"` | @param listeners.controller.protocol Security protocol for the Kafka controller listener. Allowed values are 'PLAINTEXT', 'SASL\_PLAINTEXT', 'SASL\_SSL' and 'SSL' # | | listeners.controller\[0].sslClientAuth | string | `""` | @param listeners.controller.sslClientAuth Optional. If SASL\_SSL is enabled, configure mTLS TLS authentication type. If SSL protocol is enabled, overrides tls.authType for this listener. Allowed values are 'none', 'requested' and 'required' # | | listeners.interbroker\[0].advertisedHostnames.baseDomain | string | `""` | @param listeners.interbroker.advertisedHostnames.baseDomain Expected Route 53 or private DNS base domain for validation and advertised listener overrides | | listeners.interbroker\[0].advertisedHostnames.enabled | bool | `false` | @param listeners.interbroker.advertisedHostnames.enabled Enable AutoMQ-managed DNS records for this listener | | listeners.interbroker\[0].advertisedHostnames.externalDns.privateZoneId | string | `""` | @param listeners.interbroker.advertisedHostnames.externalDns.privateZoneId Deprecated alias for zoneId; despite its name, it accepts public or private hosted zone IDs | | listeners.interbroker\[0].advertisedHostnames.externalDns.zoneId | string | `""` | @param listeners.interbroker.advertisedHostnames.externalDns.zoneId Route 53 hosted zone ID | | listeners.interbroker\[0].advertisedHostnames.externalDns.zoneType | string | `""` | @param listeners.interbroker.advertisedHostnames.externalDns.zoneType Route 53 hosted zone type. Allowed values are `PUBLIC` and `PRIVATE` | | listeners.interbroker\[0].advertisedHostnames.hostnamePattern | string | `""` | @param listeners.interbroker.advertisedHostnames.hostnamePattern Optional template for DNS record names. Defaults to kernel fallback when empty | | listeners.interbroker\[0].advertisedHostnames.ttl | string | `nil` | @param listeners.interbroker.advertisedHostnames.ttl TTL override in seconds for Route 53 records created by AutoMQ. Leave null to use the default | | listeners.interbroker\[0].containerPort | int | `9094` | @param listeners.interbroker.containerPort Port for the Kafka inter-broker listener # | | listeners.interbroker\[0].name | string | `"BROKER"` | @param listeners.interbroker.name Name for the Kafka inter-broker listener # | | listeners.interbroker\[0].protocol | string | `"PLAINTEXT"` | @param listeners.interbroker.protocol Security protocol for the Kafka inter-broker listener. Allowed values are 'PLAINTEXT', 'SASL\_PLAINTEXT', 'SASL\_SSL' and 'SSL' # | | listeners.interbroker\[0].sslClientAuth | string | `""` | @param listeners.interbroker.sslClientAuth Optional. If SASL\_SSL is enabled, configure mTLS TLS authentication type. If SSL protocol is enabled, overrides tls.authType for this listener. Allowed values are 'none', 'requested' and 'required' # | | networkPolicy.enabled | bool | `false` | | | networkPolicy.ingressRules | list | `[]` | @param ingressRules Add ingress rules to the AutoMQ pod(s) # e.g: # ingressRules: # - ports: target-ports # - 9102 # ipBlocks: ip block settings # - cidr: 0.0.0.0/0 | | sasl.client | object | `{"passwords":null,"users":["user1"]}` | Credentials for client communications. # | | sasl.client.passwords | string | `nil` | @param sasl.client.passwords Comma-separated list of passwords for client communications when SASL is enabled, must match the number of client.users # | | sasl.client.users | list | `["user1"]` | @param sasl.client.users Comma-separated list of usernames for client communications when SASL is enabled # | | sasl.controller | object | `{"password":null,"user":"controller_user"}` | Credentials for controller communications. # | | sasl.controller.password | string | `nil` | @param sasl.controller.password Password for controller communications when SASL is enabled. If not set and SASL is enabled for the inter-broker listener, a random password will be generated. # | | sasl.controller.user | string | `"controller_user"` | @param sasl.controller.user Username for controller communications when SASL is enabled # | | sasl.controllerMechanism | string | `"PLAIN"` | @param sasl.controllerMechanism SASL mechanism for controller communications. # | | sasl.enabledMechanisms | string | `"PLAIN,SCRAM-SHA-256,SCRAM-SHA-512"` | NOTE: At the moment, Kafka Raft mode does not support SCRAM, that is why only PLAIN is configured. # | | sasl.existingSecret | string | `""` | | | sasl.interBrokerMechanism | string | `"PLAIN"` | @param sasl.interBrokerMechanism SASL mechanism for inter broker communication. # | | sasl.interbroker | object | `{"password":null,"user":"inter_broker_user"}` | Credentials for inter-broker communications. # | | sasl.interbroker.password | string | `nil` | @param sasl.interbroker.password Password for inter-broker communications when SASL is enabled. If not set and SASL is enabled for the controller listener, a random password will be generated. # | | sasl.interbroker.user | string | `"inter_broker_user"` | @param sasl.interbroker.user Username for inter-broker communications when SASL is enabled # | | schemaRegistry | object | `{"create":false,"env":[]}` | SchemaRegistry configuration # | | schemaRegistry.create | bool | `false` | @param schemaRegistry.create Deploy the built-in Karapace Schema Registry sidecar on controller pods | | schemaRegistry.env | list | `[]` | Karapace client configuration [https://github.com/Aiven-Open/karapace](https://github.com/Aiven-Open/karapace) # - KARAPACE\_BOOTSTRAP\_URI # - KARAPACE\_SECURITY\_PROTOCOL # - KARAPACE\_SASL\_MECHANISM # - KARAPACE\_SASL\_PLAIN\_USERNAME # - KARAPACE\_SASL\_PLAIN\_PASSWORD | | service | object | `{"headless":{"annotations":{},"labels":{}}}` | Service for AutoMQ, service type: ClusterIP # | | service.headless | object | `{"annotations":{},"labels":{}}` | Headless service properties # | | service.headless.annotations | object | `{}` | @param service.headless.annotations Annotations for the cluster headless service. # | | service.headless.labels | object | `{}` | @param service.headless.labels Labels for the cluster headless service. # | | tls | object | `{"autoGenerated":false,"customAltNames":[],"endpointIdentificationAlgorithm":"https","existingSecret":"","jksKeystoreKey":"","jksTruststoreKey":"","jksTruststoreSecret":"","keyPassword":"","keystorePassword":"","passwordsSecret":"","passwordsSecretKeystoreKey":"keystore-password","passwordsSecretPemPasswordKey":"","passwordsSecretTruststoreKey":"truststore-password","pemChainIncluded":false,"selfConfigure":false,"sslClientAuth":"required","truststorePassword":"","type":"JKS"}` | Kafka TLS settings, required if SSL or SASL\_SSL listeners are configured # | | tls.autoGenerated | bool | `false` | @param tls.autoGenerated Generate automatically self-signed TLS certificates for Kafka brokers. Currently only supported if `tls.type` is `PEM` # Note: ignored when using 'jks' format or `tls.existingSecret` is not empty # | | tls.customAltNames | list | `[]` | @param tls.customAltNames Optionally specify extra list of additional subject alternative names (SANs) for the automatically generated TLS certificates. # | | tls.endpointIdentificationAlgorithm | string | `"https"` | @param tls.endpointIdentificationAlgorithm The endpoint identification algorithm to validate server hostname using server certificate # Disable server host name verification by setting it to an empty string. # ref: [https://docs.confluent.io/current/kafka/authentication\_ssl.html#optional-settings](https://docs.confluent.io/current/kafka/authentication_ssl.html#optional-settings) # | | tls.existingSecret | string | `""` | @param tls.existingSecret Name of the existing secret containing the TLS certificates for the Kafka nodes. # - For `tls.type=PEM`, the secret must contain a shared CA (`kafka-ca.crt`) plus a single certificate/key pair (`kafka.crt` + `kafka.key` or `tls.crt` + `tls.key`). The chart converts this bundle into the JKS keystore/truststore files automatically. # - For `tls.type=JKS`, the secret must contain `kafka.keystore.jks` and `kafka.truststore.jks` (also shared by all nodes). Per-role or per-pod keystores are no longer required. # The shared certificate must have SANs covering every advertised hostname. | | tls.jksKeystoreKey | string | `""` | @param tls.jksKeystoreKey The secret key from the `tls.existingSecret` containing the keystore # Note: ignored when using 'pem' format for certificates. # | | tls.jksTruststoreKey | string | `""` | @param tls.jksTruststoreKey The secret key from the `tls.existingSecret` or `tls.jksTruststoreSecret` containing the truststore # Note: ignored when using 'pem' format for certificates. # | | tls.jksTruststoreSecret | string | `""` | @param tls.jksTruststoreSecret Name of the existing secret containing your truststore if truststore not existing or different from the one in the `tls.existingSecret` # Note: ignored when using 'pem' format for certificates. # | | tls.keyPassword | string | `""` | @param tls.keyPassword Password to access the PEM key when it is password-protected. # Note: ignored when using 'tls.passwordsSecret' # | | tls.keystorePassword | string | `""` | @param tls.keystorePassword Password to access the JKS keystore when it is password-protected. Ignored when 'tls.passwordsSecret' is provided. # When using tls.type=PEM, the generated keystore will use this password or randomly generate one. # | | tls.passwordsSecret | string | `""` | @param tls.passwordsSecret Name of the secret containing the password to access the JKS files or PEM key when they are password-protected. (`key`: `password`) # | | tls.passwordsSecretKeystoreKey | string | `"keystore-password"` | @param tls.passwordsSecretKeystoreKey The secret key from the tls.passwordsSecret containing the password for the Keystore. # | | tls.passwordsSecretPemPasswordKey | string | `""` | @param tls.passwordsSecretPemPasswordKey The secret key from the tls.passwordsSecret containing the password for the PEM key inside 'tls.passwordsSecret'. # | | tls.passwordsSecretTruststoreKey | string | `"truststore-password"` | @param tls.passwordsSecretTruststoreKey The secret key from the tls.passwordsSecret containing the password for the Truststore. # | | tls.pemChainIncluded | bool | `false` | @param tls.pemChainIncluded Flag to denote that the Certificate Authority (CA) certificates are bundled with the endpoint cert. # Certificates must be in proper order, where the top certificate is the leaf and the bottom certificate is the top-most intermediate CA. # | | tls.selfConfigure | bool | `false` | @param tls.selfConfigure Enable self-configured TLS certificates for AutoMQ # | | tls.sslClientAuth | string | `"required"` | @param tls.sslClientAuth Sets the default value for the ssl.client.auth Kafka setting. # ref: [https://docs.confluent.io/current/kafka/authentication\_ssl.html#optional-settings](https://docs.confluent.io/current/kafka/authentication_ssl.html#optional-settings) # | | tls.truststorePassword | string | `""` | @param tls.truststorePassword Password to access the JKS truststore when it is password-protected. Ignored when 'tls.passwordsSecret' is provided. # When using tls.type=PEM, the generated keystore will use this password or randomly generate one. # | | tls.type | string | `"JKS"` | @param tls.type Format to use for TLS certificates. Allowed types: `JKS` and `PEM` # | # Performance Benchmark Source: https://docs.automq.com/automq-cloud/appendix/performance-benchmark AutoMQ delivers cloud-native Kafka with 100% API compatibility, seconds-level scaling, and significant efficiency improvements over Apache Kafka across partition reassignment, elasticity, and catch-up read scenarios. This document is based on tests conducted using the AutoMQ BYOC kernel, comparing it to Apache Kafka in scenarios like elasticity efficiency, send/receive latency, and cold reads. To replicate and verify the performance test data, please refer to the [Overview▸](/automq-cloud/getting-started/overview) document for installing AutoMQ BYOC. > [!TIP] > > In this report, AutoMQ BYOC uses EBS as WAL storage to achieve low-latency message sending and receiving. ## Comparison Conclusion * **300x Efficiency Improvement in Partition Reassignment Compared to Apache Kafka:** The partition reassignment speed of AutoMQ is approximately 300 times faster than that of Apache Kafka. AutoMQ transforms Kafka's high-risk routine maintenance actions into automated, nearly imperceptible low-risk operational tasks. * **4min to 1GiB/s Ultimate Elasticity:** AutoMQ's cluster can boost its emergency elasticity from 0 MiB/s to 1 GiB/s in just 4 minutes. This rapid scalability allows the system to accommodate sudden traffic spikes efficiently. * **200x Cold Read Efficiency over Apache Kafka:** AutoMQ optimizes performance by separating reads and writes, achieving a 200-fold reduction in send latency compared to Apache Kafka and a fivefold increase in throughput. AutoMQ handles peak shaving and filling for online messaging and offline batch processing scenarios. ## Test Preparation ### Configuration Parameters AutoMQ is set to flush data to disk by default before responding, using the following settings: ```properties theme={null} acks=all flush.message=1 ``` > [!NOTE] > > AutoMQ BYOC ensures high data reliability through the EBS multi-replica mechanism, so you don't need to configure multiple replicas on the Kafka side. Apache Kafka is using version 3.6.0. Following Confluent's guidance, it doesn't set flush.messages = 1. Instead, it relies on a three-replica in-memory asynchronous flush to ensure data reliability (power outages in data centers can lead to data loss), configured as follows: ```properties theme={null} acks=all replicationFactor=3 min.insync.replicas=2 ``` ### Machine Specifications When considering cost-effectiveness, small instance types combined with EBS are more advantageous than larger machines equipped with SSDs. For example, small instance r6in.large + EBS versus large instance i3en.2xlarge + SSD: * i3en.2xlarge, 8 cores, 64 GB memory, network baseline bandwidth 8.4 Gbps, with two 2.5 TB NVMe SSDs, maximum disk throughput of 600 MB/s; price \$0.9040/h. * r6in.large \* 5 + 5 TB EBS, 10 cores, 80 GB memory, network baseline bandwidth 15.625 Gbps, EBS baseline bandwidth 625 MB/s; price (compute) 0.1743 \* 5 + (storage) 0.08 \* 5 \* 1024 / 24 / 60 = \$1.156/h. At first glance, the price and performance of the two are almost the same. Considering that in actual production, data is expected to be retained for longer periods, using i3en.2xlarge would require horizontal scaling of compute nodes to increase cluster storage space, which wastes computing resources. With r6in.large + EBS, only the capacity of EBS needs adjustment. Thus, considering both cost and performance, AutoMQ and Apache Kafka compute both choose r6in.large as the minimum elastic unit for brokers, with storage using GP3 type EBS and Standard S3. * r6in.large: 2 cores, 16 GB memory, network baseline bandwidth 3.125 Gbps, EBS baseline bandwidth 156.25 MB/s; price \$0.1743/h. * GP3 EBS: The free tier includes 3000 IOPS and 125 MB/s bandwidth. Pricing for storage is $0.08 per GB per month, with additional bandwidth costing $0.040 per MB/s per month and extra IOPS priced at \$0.005 per month. AutoMQ and Apache Kafka have different methods of utilizing EBS: * AutoMQ uses EBS as a write buffer, requiring only 3 GB of storage, and leverages the free tier for IOPS and bandwidth. * Apache Kafka stores all its data on EBS, with the required space determined by traffic and retention times in specific test scenarios. Additional EBS bandwidth of 31 MB/s is purchased, which further increases Apache Kafka's unit cost per throughput. ## Second-level Partition Reassignment In a production environment, a Kafka cluster often serves multiple businesses. Fluctuations in business traffic and partition distribution may lead to insufficient cluster capacity or machine hotspots. Kafka operators need to scale the cluster and reassign hotspot partitions to idle nodes to ensure the cluster remains available. The time taken for partition reassignment determines the efficiency of emergency responses and operations: * The shorter the partition reassignment time, the quicker the cluster can scale to meet capacity demands, thus reducing the duration of any service impairment. * Faster partition reassignment shortens the observation period for operators, allowing for quicker feedback and informed subsequent operational decisions. > [!NOTE] > > 300x improvement in efficiency: AutoMQ reduces the time required for reassigning a 30 GiB partition compared to Apache Kafka from 12 minutes to just 2.2 seconds. #### Test This test assesses the reassignment time and the effects of moving a partition containing 30 GiB of data to a node without a replica of that partition, under typical send-consume traffic scenarios using AutoMQ and Apache Kafka. The specific test setup is as follows: 1. Two r6in.large brokers are used to create: * One single-partition, single-replica Topic A, with continuous read and write operations at a throughput of 40 MiB/s. * A topic B with 4 partitions and a single replica was used, with a continuous read and write throughput of 10 MiB/s serving as background traffic. After 13 minutes, the only partition of Topic A was reassigned to another node, with reassignment throughput limited to 100 MiB/s. > [!NOTE] > > Each Apache Kafka broker was additionally mounted with a 320GB 156MiB/s gp3 EBS for data storage. | Comparison Item | AutoMQ | Apache Kafka | | - | - | - | | Reassignment Duration | 2.2s | 12min | | Reassignment Impact | Maximum send latency of 2.2s | Continuous send latency within 12min fluctuating from 1ms to 90ms | *** ![Partition reassignment duration comparison between AutoMQ and Apache Kafka](https://mintcdn.com/automq/RSO0m4U-wu384vv0/automq-cloud/appendix/performance-benchmark/1.webp?fit=max\&auto=format\&n=RSO0m4U-wu384vv0\&q=85\&s=af54d5c167d4cf757e8b72f46fbe5622) #### Analysis The reassignment of AutoMQ partitions involves only uploading the buffered data from EBS to S3 to securely open on a new node, typically uploading 500 MiB within 2 seconds. The duration of AutoMQ partition reassignment is independent of the partition's data volume, averaging around 1.5 seconds. During reassignment, AutoMQ partitions return a *NOT\_LEADER\_OR\_FOLLOWER* error code to the client. Upon completion, the client updates to the new Topic routing table, internally retrying to send to the new node, temporarily increasing the partition's send latency until it returns to normal levels after reassignment. Apache Kafka partition reassignment requires copying the partition's replicas to a new node, catching up with new writes while copying historical data. The reassignment duration equals the partition's data volume divided by (the reassignment throughput limit minus the partition's write throughput). In real-world production environments, partition reassignment often takes hours; in this test, the reassignment of a 30 GiB partition took 12 minutes. Besides the lengthy reassignment, Apache Kafka needs to read cold data from the hard disk, and even with throttling, page cache contention can cause fluctuations in send latency, affecting service quality, depicted in the graph as the green curve's jittery portions. ## 0 -> 1 GiB/s Ultimate Elasticity Kafka administrators typically plan Kafka cluster capacity based on historical experience, yet unexpected surges in traffic due to hot events and activities continually arise. In such cases, rapid cluster expansion and partition rebalancing become necessary to handle sudden spikes in traffic. > [!NOTE] > > With ultimate elasticity, the AutoMQ cluster can boost its emergency elasticity from 0 MiB/s to 1 GiB/s in just 4 minutes. #### Test The purpose of this test is to measure the emergency elasticity capability of AutoMQ, specifically the speed of expansion from 0 MiB/s to 1 GiB/s. The specific test scenario is as follows: 1. Initially, the cluster consists of only 1 Broker, with emergency elastic capacity set at 1 GiB/s, and a Topic with 1000 partitions is created. 2. OpenMessaging is started to directly set the sending traffic to 1 GiB/s. > [!TIP] > > For AutoMQ BYOC, it is necessary to deploy at least 3 Brokers in the cluster. To test elasticity, you can directly scale AKU via the console UI and observe the scaling speed. | Analysis Item | Monitoring Alert | Batch Expansion | Auto Balancing | Total | | - | - | - | - | - | | 0 -> 1 GiB/s Elastic Time | 70s | 80s | 90s | 4min | *** ![AutoMQ cluster scaling from 0 to 1 GiB/s in 4 minutes](https://mintcdn.com/automq/RSO0m4U-wu384vv0/automq-cloud/appendix/performance-benchmark/2.webp?fit=max\&auto=format\&n=RSO0m4U-wu384vv0\&q=85\&s=02795ad17bdd4b2cd09b29bd4db6c087) ## Catch-up Read Catch-up read is a common scenario in messaging and streaming systems: * In messaging, messages are typically used to decouple business processes and even out peaks and troughs. Smoothing peaks requires that the message queue holds the data sent upstream, allowing it to be consumed gradually downstream. In this scenario, the downstream systems read "catch-up" data that are cold and not in memory. * In streams, periodic batch processing tasks may need to start scanning and computing data from several hours or even a day ago. * There are additional fault scenarios: the consumer goes offline for several hours due to a failure and then comes back online; consumer logic issues are fixed, followed by a rewind to consume historical data. Catch-up reads focus mainly on two aspects: * The speed of catch-up reads: The faster the catch-up reads, the more quickly the consumer can recover from the failure, and the faster batch processing tasks can produce analytical results. * Isolation of reads and writes: Catch-up reads should aim to minimally impact the production rate and latency. > [!NOTE] > > With a 200x efficiency improvement, AutoMQ's read-write separation compared to Apache Kafka in catch-up read scenarios reduced sending time from 800ms to 3ms and shortened catch-up time from 215 minutes to 42 minutes. #### Test This test evaluates the catch-up read performance of AutoMQ and Apache Kafka using an identical cluster size. The test scenarios are outlined as follows: 1. Deploy a cluster with 20 Brokers and create a Topic with 1000 partitions. 2. Continuously send data at a throughput of 800 MiB/s. 3. After sending 4 TiB of data, initiate the consumer to consume from the earliest offset. > [!NOTE] > > Each Apache Kafka broker is equipped with a separate 1000GB 156MiB/s gp3 EBS for data storage. | Comparison Item | Send Latency During Catch-up Read | Impact on Send Throughput During Catch-up Read | Peak Throughput During Catch-up Read | | - | - | - | - | | AutoMQ | Less than 3ms | Read-write isolation, maintains 800 MiB/s | 2500 \~ 2700 MiB/s | | Apache Kafka | Approximately 800ms | Interference, drops to 150 MiB/s | 2600 \~ 3000 MiB/s (at the expense of writes) | *** ![Catch-up read throughput comparison between AutoMQ and Apache Kafka](https://mintcdn.com/automq/RSO0m4U-wu384vv0/automq-cloud/appendix/performance-benchmark/3.webp?fit=max\&auto=format\&n=RSO0m4U-wu384vv0\&q=85\&s=66c41e562b3669e6ae7d4e88404354bc) *** ![Catch-up read send latency comparison between AutoMQ and Apache Kafka](https://mintcdn.com/automq/RSO0m4U-wu384vv0/automq-cloud/appendix/performance-benchmark/4.webp?fit=max\&auto=format\&n=RSO0m4U-wu384vv0\&q=85\&s=98775d405c7d0a86a68ef4eaa3171dc8) #### Analysis * In an equivalent cluster size scenario, during catch-up reads, AutoMQ's sending throughput remains stable, whereas Apache Kafka's sending throughput drops by 80%. This is because Apache Kafka performs disk reads during catch-up without IO isolation, consuming the read-write bandwidth of AWS EBS. This reduces the bandwidth available for writing to disk, thereby lowering sending throughput. In contrast, AutoMQ separates reads and writes by utilizing object storage for catch-up reads instead of the disk, which doesn't consume disk read-write bandwidth and thus doesn't affect sending throughput. * For the same cluster size, during catch-up reads, the average send latency for AutoMQ rises by about 0.4 ms compared to just sending, while Apache Kafka's latency surges to around 800 ms. This spike in send latency for Apache Kafka can be attributed to two factors: first, as noted earlier, catch-up reads consume AWS EBS read-write bandwidth, leading to decreased write throughput and increased latency; second, during catch-up reads, retrieving cold data from the disk contaminates the page cache, similarly resulting in higher write latency. * It's important to note that when catching up to read 4 TiB of data, AutoMQ took 42 minutes, whereas Apache Kafka took just 29 minutes. The shorter time for Apache Kafka can be attributed to two reasons: * During catch-up reads, Apache Kafka's sending traffic was reduced by 80%, which decreased the amount of data it needed to handle while catching up. * Apache Kafka does not implement I/O isolation, prioritizing reading speed over maintaining the sending rate. If we assume Apache Kafka implements I/O isolation, meaning it reads while maintaining the sending rate as much as possible, the calculation would proceed as follows: * Assume that during catch-up reads, Apache Kafka maintains a sending rate of 700 MiB/s. Considering triple-replica writes that occupy EBS bandwidth, it would be 700 MiB/s \* 3 = 2100 MiB/s. * The total EBS bandwidth in the cluster is 156.25 MiB/s \* 20 = 3125 MiB/s. * The bandwidth available for reading is 3125 MiB/s - 2100 MiB/s = 1025 MiB/s. * In a catch-up read scenario where data is simultaneously sent and read, reading 4 TiB of data would take 4 TiB \* 1024 GiB/TiB \* 1024 MiB/GiB / (1025 MiB/s - 700 MiB/s) / 60 s/min = 215 min. Apache Kafka requires 215 minutes to catch up on reading 4 TiB of data without significantly impacting the sending process, which is 5 times longer than with AutoMQ. ## Summary This benchmark illustrates that AutoMQ, after redesigning Kafka for the cloud, offers substantial improvements in both efficiency and cost savings compared to Apache Kafka: 1. In partition reassignment scenarios, AutoMQ reduces the partition reassignment time of a 30GB partition from Apache Kafka's 12 minutes down to 2.2 seconds, achieving a 300x efficiency improvement. 2. With extreme elasticity, AutoMQ can scale out from 0 to 1 GiB/s in just 4 minutes to reach the desired capacity. 3. In scenarios involving historical data catch-up reads, AutoMQ's read-write separation not only improves average send latency by 200-fold, reducing it from 800ms to 3ms, but also achieves catch-up read throughput that is five times that of Apache Kafka. ## Additional Notes * AutoMQ supports AWS Graviton instances, and this performance comparison is equally applicable to instances supported by Graviton. * When comparing cloud resource costs in an AWS environment, Apache Kafka incurs cross-availability zone traffic fees. AutoMQ can eliminate these fees through its cross-availability zone routing component. For details, refer to [Save cross-AZ traffic costs with AutoMQ▸](/automq-cloud/best-practice/save-cross-az-traffic-costs-with-automq) # Kafka Client Config Tuning Source: https://docs.automq.com/automq-cloud/best-practice/kafka-client-config-tuning AutoMQ offers cloud-native scalability, Kafka compatibility, and zero partition fees, enhancing performance and cost efficiency. Learn to optimize Kafka client configs for better throughput and reliability. ## Resource Allocation Management ### Recommendation 1: Set the Topic partition count appropriately to avoid throughput bottlenecks and wastage The number of Kafka Topic partitions affects the production and consumption throughput a Topic can support. To ensure message order, messages with the same partition key are sent to the same partition, and each Kafka partition can only be processed by one consumer. AutoMQ is built on object storage, which, compared to Apache Kafka's local file architecture, can support several times the partition performance under the same cluster scale. Additionally, AutoMQ does not charge for partitions. When allocating partitions using AutoMQ, there's no need to consider costs. You only need to evaluate the appropriate number of partitions based on the estimated partition throughput performance (AutoMQ's single partition write throughput limit is 4MB/s) to avoid having to expand partitions later when business volume increases. The number of partitions does not need to be a multiple of the number of nodes, as AutoMQ will automatically balance the partitions. > [!TIP] > > **Example:** > > An application estimates that the Topic data write throughput will be about 100MB/s within the next year, while the downstream consumers can each handle a maximum of 2MB of data per second. > > When allocating partitions, you need to consider: > > Based on the producer's perspective, 100MB/s ÷ 4MB/s = 25 partitions are required. > > Based on the consumer's perspective, 100MB/s ÷ 2MB/s = 50 consumers are needed, and 50 consumers require at least 50 partitions. > > Therefore, at least 50 partitions need to be allocated to meet the application's requirements. ### Recommendation 2: For platform-based application scenarios, enable ACL to achieve strict upstream and downstream access control In platform-based scenarios, such as real-time computing platforms, it is recommended to enable ACL when using Kafka to achieve fine-grained resource control. Once resource control is enabled, Kafka clients must authenticate to access specific Topics and Groups. The benefits of this approach are as follows: * It prevents business parties from arbitrarily creating new Topics and other resources, which can lead to resource abuse and governance issues. * It helps avoid subscription chaos and impacts on load balancing caused by different business parties sharing Consumer Groups. * By identifying Topics and Consumer Groups, it becomes easier to identify related subscribers and upstream and downstream business groups, facilitating business governance. ## Producer Application ### Recommendation 1: For Kafka Producer clients version 2.1 or lower, set the retry count Producer applications need to check the SDK version. If the current version is less than 2.1, it is necessary to manually set the retry count to ensure automatic retries in case of message send failures. This helps avoid failures caused by server maintenance, self-balancing, etc. Retry parameter settings can be referenced as follows: ```properties theme={null} // Maximum retry count retries=Integer.MAX_VALUE // Initial backoff delay time retry.backoff.ms=100 // Maximum backoff delay time retry.backoff.max.ms=1000 // RPC timeout for each send request request.timeout.ms =30000 // The total timeout for the entire send call. If this time is exceeded, no further retries will be made, and an exception will be returned to the caller. delivery.timeout.ms=120000 ``` ### Recommendation 2: Optimize the batch parameters of the Producer to avoid excessive QPS consumption by fragmented requests Kafka is a stream storage system designed for high throughput scenarios. The most typical use case for Kafka is to improve the efficiency and throughput of data transmission through batching. In the process of sending messages by the Producer, it is necessary to set the batching parameters reasonably to avoid the following situations: * **Avoid sending only one message per request:** If the Producer sends only one message per request, it will generate a large number of Produce requests, consuming server-side CPU and degrading cluster performance. * **Avoid setting excessively long batching wait times:** When setting batch parameters, the Producer needs to set a reasonable wait time to avoid delays in sending messages due to incomplete batching in low-traffic scenarios. Specific batch parameter settings are as follows: ```properties theme={null} // Batch size, up to 128KB of data can be accumulated at a time. batch.size=131072 // Batch linger time, for the Producer, if the batch limit is not reached within the specified time, sending will also be triggered. This time represents the maximum delay for sending. linger.ms=10 ``` ### Recommendation 3: Set ack=all to ensure message durability before responding Producers can adjust the ack parameter to balance between data durability and sending latency: * ack=all (default value): The server responds to the client only after the data has been persisted to cloud storage. In the event of a server crash, successfully acknowledged messages will not be lost. * ack=1: In alignment with Apache Kafka®, the AutoMQ server responds to the client immediately after the message is received in memory. If the server crashes, messages that haven't been persisted will be lost. It is recommended for producers to maintain the default configuration of ack=all to ensure data reliability. > [!TIP] > > AutoMQ achieves message durability and reliable storage using object storage, and the server does not produce ISR replica copies. Setting ACK=ALL handles traffic as if writing a single piece of data (synchronous persistence). ## Consumer Application ### Recommendation 1: For consumers using the Assign mode, upgrade to version 3.2 or above to ensure offset commit success When a Kafka Consumer application consumes messages using the Assign mode, i.e., self-assigning partition load balancing mode, it is necessary to ensure that the SDK version is upgraded to version 3.2 or above. This is because earlier versions have a defect in the Assign mode where committed consumer offsets are not updated promptly, resulting in consumers failing to commit and update offsets in a timely manner. For detailed defect records, refer to [Kafka Issue KAFKA-13563](https://issues.apache.org/jira/browse/KAFKA-13563). ### Recommendation 2: Control the Consumer heartbeat timeout and messages polled per poll to avoid frequent rebalancing Kafka Consumers are grouped and load-balanced through the same Group Id. If a single consumer experiences a heartbeat timeout, it will be expelled from the consumer group, and the remaining consumers will undergo self-balancing to reassign partitions. In production scenarios, program parameter errors that lead to unexpected heartbeat timeouts and self-balancing should be avoided; otherwise, it will cause the consumer group to keep changing and fail to consume messages. **Causes of unexpected self-balancing:** * Client versions before v0.10.2: Consumers did not have an independent thread to maintain the heartbeat. Instead, heartbeat maintenance was coupled with the poll interface. As a result, if the user's consumption is delayed, it leads to a Consumer heartbeat timeout, triggering self-balancing. * Client versions v0.10.2 and later: If the consumption time is too slow and exceeds a certain period (set by max.poll.interval.ms, default is 5 minutes) without polling for messages, the client will voluntarily leave the queue, triggering self-balancing. > [!TIP] > > **Optimization Recommendations:** > > Upgrade the client to version 0.10.2 or above. > > Adjust the parameter values according to the following instructions: > > Increase the client's consumption speed as much as possible to avoid lag. > > Try to avoid having a single Consumer Group subscribe to a large number of Topics. Aim for a dedicated Consumer Group to subscribe to a dedicated Topic. ### Recommendation 3: In production scenarios, commit the Consumer offset, but avoid committing offsets too frequently When consuming messages using Kafka, whether you use the standard Kafka Consumer SDK or frameworks like Flink Connector, it is advisable to commit consumer offsets. This allows you to monitor consumption lag and mitigate risks. There are two ways to commit consumer offsets: automatic and manual. The controlling parameter is: * **enable.auto.commit**: Whether to use the automatic offset commit mechanism. The default value is true, indicating that the automatic commit mechanism is used by default. * **auto.commit.interval.ms**: The interval for auto-committing offsets. The default value is 1000, which is 1 second. The combination of these two parameters means that before each poll, the client will check the time since the last offset commit. If the elapsed time exceeds the value set by **auto.commit.interval.ms**, the client will initiate an offset commit action. Therefore, if **enable.auto.commit** is set to true, you need to ensure that the data polled in the previous poll is fully consumed before polling new data. Otherwise, this might lead to offset jumping. If you prefer to control offset commits manually, set **enable.auto.commit** to false and use the commit(offsets) function to handle offset commits. > [!TIP] > > In production scenarios, it is advisable to commit offsets, but avoid committing them too frequently. Frequent commits can cause request hotspots in the Compact Topic partitions handling the offset data. > > For production scenarios, it is generally recommended to commit offsets every 5-10 seconds or manually as needed, rather than committing after every message consumption. ### Recommendation 4: Avoid consumption blocking and accumulation in production scenarios Kafka consumers process messages in the order of partitions. If a message causes a consumption block due to business logic, it will affect the consumption of subsequent messages in the current partition. Therefore, in production environments, ensure that the consumption logic does not lead to permanent blocking. If unexpected blocking occurs, it is recommended to follow the steps below: * **Determine if it can be skipped:** If the abnormal message can be skipped, stop the consumer first, then go to the AutoMQ Console to reset the consumption offset to the next message to achieve a skip. * **Determine if it cannot be skipped:** Fix the consumption logic to handle the abnormal message. ## Flink Task ### Recommendation 1: Upgrade the Flink Connector version to 1.17.2 or above to ensure offset commit success When using Flink Connector to consume Kafka messages, pay attention to the Flink Connector version. It is recommended to upgrade to version 1.17.2 or above. Earlier versions of Flink Connector rely on older versions of the Kafka SDK, which cannot retry upon failure when submitting consumption offsets. This can result in the inability to accurately observe the backlog metrics of the Consumer Group in Kafka. For detailed defect records, refer to [Kafka Issue KAFKA-13563](https://issues.apache.org/jira/browse/KAFKA-13563). # Broker Configuration Source: https://docs.automq.com/automq-cloud/eliminate-inter-zone-traffics/broker-configuration AutoMQ optimizes Kafka operations with cloud-native scalability and cross-AZ routing for cost efficiency, reducing inter-zone traffic and ensuring data locality. In cloud environments like AWS and GCP, cross-AZ traffic incurs data transfer fees. AutoMQ can help avoid the traffic generated by Kafka's production, consumption, and server-side replica replication. To configure AutoMQ to save on cross-AZ data transfer costs, the following conditions must be met: 1. **Cloud Provider Environment Constraints**: It is only recommended to configure AutoMQ's multi-AZ write feature when deploying in a **multi-AZ setup** on **AWS or GCP**. If your application architecture is single-AZ or you are using other cloud providers (where cross-AZ traffic may be free or lower-cost depending on the cloud provider, region, and pricing policy), this configuration is not recommended. 2. **Multi-AZ Deployment Constraints**: To use AutoMQ's multi-AZ write architecture to save on cross-AZ traffic, both the application and AutoMQ must be deployed in a multi-AZ setup. 1. **AZ Quantity Constraint**: Currently, only three-AZ deployments for Producers, Consumers, and AutoMQ are supported. If Producers and Consumers are in more than three AZs, some cross-AZ traffic will still be generated. ## Create an AutoMQ Instance To use AutoMQ to save on cross-AZ data transfer costs, you first need to ensure that you create a compliant AutoMQ instance. The specific steps are as follows: 1. Log in to the AutoMQ BYOC environment. 2. Create an instance, selecting three availability zones in the network configuration. Choose **S3 WAL or NFS WAL** as the WAL type. > [!TIP] > > Select the same AZs as your Kafka producers and consumers. For example, if your clients run in AZs A, B, and C, select those three AZs for the AutoMQ instance. > > Clients do not need to be evenly distributed across AZs. If client traffic is concentrated in one AZ, you may need to scale out the AutoMQ cluster so that the AZ has enough brokers to handle that traffic. ## Configure Mapping Rules to Identify Client's Source CIDR Rack Due to the limitations of the Kafka protocol, the server cannot perceive the Rack to which the Client belongs. To perceive the Client's Rack and avoid cross-AZ production and consumption, AutoMQ provides two Rack configuration methods: [client-side configuration▸](/automq-cloud/eliminate-inter-zone-traffics/client-configuration) and server-side dynamic configuration. This chapter introduces the server-side dynamic configuration method using `automq.zone.cidr.blocks`. > [!TIP] > > In a cloud environment, Rack is usually set to [ZoneId](https://docs.aws.amazon.com/ram/latest/userguide/working-with-az-ids.html). The concepts of Rack and Zone mentioned later can be used interchangeably. ### Parameter format The format for `automq.zone.cidr.blocks` is as follows: ```text theme={null} # ex. use1-az1@10.0.0.0/19,10.0.32.0/19<>use1-az2@10.0.64.0/19<>use1-az3@10.0.96.0/19 $zone1@$CIDRBlock1,$CIDRBlock2<>$zone2@$CIDRBlock3<>$zone3@$CIDRBlock4,$CIDRBlock5 ``` * Configurations for different Zones are separated by `<>`. * Each Zone's configuration starts with the Zone name, followed by `@`, and then a list of CIDRs for that Zone. CIDRs in the list are separated by `,`. AutoMQ will match the Client's connecting IP with the CIDRs sequentially to determine the Client's Zone. The server-side configuration `automq.zone.cidr.blocks` is suitable for the following scenarios: * There are clear CIDR segments between the Zones where the Clients are located. * It is inconvenient to set different Client configurations based on the load's Zone for computing engines like Flink, Spark, or Presto. If both server-side and client-side configurations are set, the priority is as follows: `client.id` > `automq.zone.cidr.blocks` > Consumer `client.rack`. ### Configuration procedure After the AutoMQ instance is created successfully, configure the CIDR mapping in the AutoMQ Console: 1. Sign in to the AutoMQ Console and open the target AutoMQ instance. 2. On the instance details page, choose the **Configuration** tab and find `automq.zone.cidr.blocks`. 3. Edit the parameter using the format above, submit the change, and wait for the configuration update to complete. > [!TIP] > > You can update `automq.zone.cidr.blocks` in real time. The new CIDR mapping takes effect immediately after the update succeeds. # Client Configuration Source: https://docs.automq.com/automq-cloud/eliminate-inter-zone-traffics/client-configuration Configure AutoMQ clients with zone identifiers and Follower Fetching to eliminate cross-availability-zone data transfer costs. ## Set Zone Identifier In addition to configuring client Zone identification rules on the server-side ([Server-side Configuration▸](/automq-cloud/eliminate-inter-zone-traffics/broker-configuration)), AutoMQ also supports clients specifying Zone information. This is done by appending `automq_az=$zoneId` to the `client.id` to identify the client's Zone. The `client.id` format is as follows: ```text theme={null} client.id=automq_az=$zoneId&existing-client-id ``` > [!TIP] > > On AWS, it is recommended to use the [zoneId](https://docs.aws.amazon.com/ram/latest/userguide/working-with-az-ids.html) instead of the zoneName, as the zoneId is consistent across all accounts. ## Follower Fetching Besides setting the Zone identifier via `client.id`, clients with a version greater than 2.4.0 can also use the [KIP-392: Allow consumers to fetch from closest replica](https://cwiki.apache.org/confluence/display/KAFKA/KIP-392%3A+Allow+consumers+to+fetch+from+closest+replica) feature to configure consumption Zone affinity. The configuration is as follows: ```text theme={null} client.rack=$zoneId ``` # Monitor Cross-AZ Traffic Source: https://docs.automq.com/automq-cloud/eliminate-inter-zone-traffics/monitor-inter-zone-traffic Monitor cross-AZ traffic with AutoMQ's Kafka-compatible service for cloud-native data flow optimization. Gain insights into network performance efficiently. After completing the configuration for cross-AZ traffic optimization, users can monitor their local network traffic and match it with the accessed brokers to identify the actual situation of cross-AZ data transfer. ## Monitoring Cross-AZ Traffic with Command-Line Tools 1. **Monitor network traffic**: On Linux, you can use `iftop` to view the incoming and outgoing traffic between the local machine and other IPs. The command is as follows: ```bash theme={null} iftop -t -s 60 -L 100 -n ``` 2. **Identify node availability zones**: Query the cluster nodes of AutoMQ and the zones to which the nodes belong. The command is as follows: ```bash theme={null} ./bin/kafka-broker-api-versions.sh --bootstrap-server $bootstrap_server | grep id ``` By matching the output of these two commands, you can observe whether cross-AZ traffic is being generated. ## Other Methods If your application is deployed on AWS, you can also use the [Network Flow Monitor](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch-NetworkFlowMonitor.html) feature of CloudWatch to monitor cross-Zone traffic. # Overview Source: https://docs.automq.com/automq-cloud/eliminate-inter-zone-traffics/overview AutoMQ eliminates cross-zone data transfer costs using S3 storage architecture, offering cloud-native scalability and 100% Kafka compatibility. AutoMQ's shared storage architecture, based on S3, can prevent cross-AZ replica replication between brokers and cross-AZ data read/write traffic from clients. This document describes how to use AutoMQ to save on cross-AZ transfer traffic. > [!NOTE] > > The AZ mentioned in this article stands for Available Zone, specifically referring to the availability zones provided by cloud vendors in public cloud environments. Each independent AZ may have its own separate data center facilities. ## Background ### Apache Kafka Cross-AZ Traffic Analysis When users deploy Apache Kafka across multiple AZs in cloud environments like AWS and GCP, they can achieve multi-AZ service disaster recovery. However, this also incurs cross-AZ data transfer costs, which can account for **60-70%** of the total cost in large-scale clusters. * **Cross-AZ Production Traffic**: Assuming the Producer has not set a ShardingKey and partitions are evenly distributed among cluster nodes, at least 2/3 of the Producer traffic will be sent across AZs. For example, 1/3 of the traffic from a Producer in AZ1 will be sent to AZ2 and AZ3 respectively. * **Server-side Cross-AZ Replication Traffic**: After a Kafka Broker receives a message, to ensure high data reliability, it replicates the data to Brokers in other AZs, generating twice the amount of Produce cross-AZ traffic. * **Cross-AZ Consumption Traffic**: Consumers can avoid generating cross-AZ traffic by setting `client.rack` to consume from partitions/replicas in the same AZ. ![Diagram showing Apache Kafka cross-AZ traffic patterns including producer, replication, and consumer traffic across availability zones](https://mintcdn.com/automq/zNOSgZlhMF-DHnm6/automq-cloud/eliminate-inter-zone-traffics/overview/1.webp?fit=max\&auto=format\&n=zNOSgZlhMF-DHnm6\&q=85\&s=49040ef2f4df99c582636aabb952cf46) ### AutoMQ Eliminates Cross-AZ Data Transfer AutoMQ uses S3 to implement a storage-compute separation architecture. Based on S3, AutoMQ achieves zero cross-AZ traffic costs: * **Production Traffic**: AutoMQ's built-in Proxy layer intercepts and identifies cross-AZ Produce requests. It builds a cross-AZ proxy channel based on S3 to forward Produce requests to the true partition Leader. Producers only need to communicate with Broker nodes in the same AZ, resulting in no cross-AZ traffic costs. * **Replication Traffic**: AutoMQ uses S3 as a shared storage layer. S3 uses erasure coding to generate multiple replicas across multiple AZs. There is no replication traffic between AutoMQ Broker nodes as in Apache Kafka. * **Consumption Traffic**: In addition to the Leader partition, AutoMQ generates a read-only partition in each of the other AZs. The read-only partition reads data written by the Leader partition directly from S3 on demand. Consumers only need to communicate with the Leader partition or the read-only partition in the same AZ, resulting in no cross-AZ traffic costs. ![Diagram showing AutoMQ's S3-based shared storage architecture eliminating cross-AZ production, replication, and consumption traffic](https://mintcdn.com/automq/zNOSgZlhMF-DHnm6/automq-cloud/eliminate-inter-zone-traffics/overview/2.webp?fit=max\&auto=format\&n=zNOSgZlhMF-DHnm6\&q=85\&s=05f062f4ca7e7661598e1dd824a520a1) ## Configuration Documents To use AutoMQ's cross-AZ data routing feature to eliminate cross-AZ data transfer, you need to enable configurations on both the server and client sides. The relevant configuration documents are as follows: * [Server-side Configuration▸](/automq-cloud/eliminate-inter-zone-traffics/broker-configuration) * [Client-side Configuration▸](/automq-cloud/eliminate-inter-zone-traffics/client-configuration) After completing the configuration, you can perform data sending and receiving tests and refer to the [Monitor Cross-AZ Traffic▸](/automq-cloud/eliminate-inter-zone-traffics/monitor-inter-zone-traffic) document to observe the actual cross-AZ traffic generated. # Manage Connectors Source: https://docs.automq.com/automq-cloud/kafka-connect/manage-connectors Create a Connect Cluster, create Connectors on it, and manage Connector lifecycle operations. AutoMQ Connect uses two resource types. A **Connect Cluster** provides the Kafka Connect worker runtime and compute capacity. A **Connector** defines a source or sink data integration workload that runs on a Connect Cluster. Before creating a Connect Cluster, review [Manage Plugins](./manage-plugins) and identify the Managed or custom plugin version and Connector class that the workload requires. The selected plugin is installed on the Connect Cluster and is then available when you create a Connector. ## Prerequisites Before you begin, prepare the following resources: * A running AutoMQ instance. * Kafka credentials with permissions for the topics and consumer groups that the Connector will use. For more information, see [Manage Kafka ACLs](/automq-cloud/manage-security/manage-kafka-acls). * The source or sink system and its access credentials. * A Kubernetes cluster, namespace, and ServiceAccount for the Connect Cluster workers. On AWS, bind the ServiceAccount to an IAM role that grants access to the Ops Bucket and any external AWS resources required by the plugin. For EKS preparation instructions, see [Deploy to Amazon EKS](/automq-cloud/deploy-automq-on-kubernetes/deploy-to-aws-eks). > [!TIP] > > Grant only the permissions required by the workload. A Sink Connector requires read permission for its Kafka topics and consumer group. A Source Connector requires write permission for its destination topics. ## Create a Connect Cluster 1. Sign in to the AutoMQ Console. 2. In the navigation pane, choose **Kafka Connect**, choose the **Connect Clusters** tab, and then choose **Create Connect Cluster**. 3. Configure the Connect Cluster parameters. | Parameter | Description | | - | - | | Name | A name that is unique within the current environment. | | Description | An optional description of the worker cluster. | | Version | The Kafka Connect runtime version. | | Plugins | The Managed or custom plugin versions and connector classes to install on the worker cluster. | | AutoMQ Instance | The AutoMQ instance used by the Connect Cluster. | | Number of Workers | The number of Kafka Connect workers. Valid values are 1 through 200. | | Worker Tier | The CPU and memory allocated to each worker: 0.5 vCPU and 1 GiB, 1 vCPU and 2 GiB, 2 vCPU and 4 GiB, or 4 vCPU and 8 GiB. | | Kubernetes Cluster | The Kubernetes cluster where the workers run. | | Namespace | The Kubernetes namespace for the workers. | | ServiceAccount | The Kubernetes ServiceAccount used by the worker Pods. | | Cloud Identity | The cloud identity associated with the ServiceAccount, such as an AWS IAM role. It must grant access to the cloud resources required by the plugins. | | SchedulingSpec | Optional Kubernetes scheduling settings, including node selectors, affinity and anti-affinity rules, and tolerations. | | Worker Configuration | Optional Kafka Connect worker properties. | | Prometheus Remote Write | Optional endpoint and authentication settings for pushing Connect Cluster metrics to Prometheus-compatible storage. | 4. Review the settings and choose **Create**. Wait until the Connect Cluster status is **Running** before creating a Connector. > [!TIP] > > Ensure that the selected Kubernetes node pool has enough allocatable CPU and memory for the worker count and Worker Tier that you select. ## Create a Connector 1. In **Kafka Connect**, choose the **Connectors** tab and then choose **Create Connector**. 2. Configure the Connector parameters. | Parameter | Description | | - | - | | Connect Cluster | The running Connect Cluster on which the Connector runs. | | Name | A name that is unique within the selected Connect Cluster. | | Description | An optional description of the data integration workload. | | Plugin | A plugin installed on the selected Connect Cluster. | | Connector Type | Source or Sink. The available type depends on the selected plugin. | | Connector Class | The connector implementation class provided by the plugin. | | Task Count | The maximum number of Connector tasks that can run in parallel. | | Kafka Authentication | The Kafka security protocol and credentials used to connect to the AutoMQ instance. | | Sink Topics | For a Sink Connector, the topics to consume and, when applicable, the consumer group. | | Source Offsets | For a Source Connector, the offset topic and initial offset settings when supported by the plugin. | | Plugin Configuration | Connection information and connector-specific properties for the external system. | 3. Enter the plugin configuration. Use the structured form when it is available, or enter key-value properties in custom mode. 4. Review all parameters and choose **Create**. ## Manage a Connector Open a Connector details page to view its status, tasks, metrics, and logs. You can update supported plugin properties and the task count, and you can perform the following lifecycle operations: * **Pause:** Stops data processing without deleting the Connector. * **Resume:** Resumes a paused Connector. * **Restart:** Restarts the Connector and its tasks to recover from an error or apply supported runtime changes. Worker count, Worker Tier, Kubernetes placement, installed plugins, and Prometheus Remote Write settings belong to the Connect Cluster. Update those settings on the Connect Cluster rather than on an individual Connector. ## Delete a Connector On the **Connectors** tab, locate the Connector, choose **Delete**, and confirm the operation. > [!WARNING] > > Deleting a Connector cannot be undone. Verify the Connector name before you confirm the operation. # Manage Plugins Source: https://docs.automq.com/automq-cloud/kafka-connect/manage-plugins View AutoMQ managed Kafka Connect plugins and manage custom plugins. Kafka Connect plugins contain the connectors, transforms, and converters that transfer or process data between Kafka and external systems. AutoMQ Connect supports two plugin types: * **Managed plugins:** AutoMQ maintains, validates, and makes these plugins available for Connect Clusters. * **Custom plugins:** You upload and manage these plugins when the Managed plugin catalog does not meet your requirements. ## View the plugin list 1. Sign in to the AutoMQ Console. 2. In the navigation pane, choose **Kafka Connect**. 3. Choose the **Plugins** tab. The plugin catalog in the AutoMQ Console is the source of truth for the versions currently available in your environment. The documentation index in the appendix lists the Managed plugin guides included in this release. > [!TIP] > > **Tip** > > If the Managed plugin catalog does not include the plugin that you require, submit a support ticket to request an update, or create a custom plugin as a temporary solution. ## Create a custom plugin 1. Upload the plugin package to a location that the AutoMQ environment can download, and obtain its download URL. 2. On the **Plugins** tab, choose **Create Custom Plugin**. 3. Enter the plugin name, version, description, main class, and other required metadata. 4. Confirm the configuration. AutoMQ validates the package before creating the plugin version. ## Delete a custom plugin On the **Plugins** tab, locate the custom plugin version and choose **Delete**. Managed plugins cannot be deleted. A custom plugin version that is referenced by a Connect Cluster cannot be deleted; remove the reference before deleting the plugin. ## Update a custom plugin To update a custom plugin, create another version by following the custom plugin creation procedure. Multiple versions of a custom plugin can coexist, and existing Connect Clusters continue to use their configured version until you update them. ## Appendix: Managed plugin documentation The following Managed plugin guides are available in this release. Select a guide for prerequisites, configuration, monitoring, and troubleshooting details. The plugin version available to you is shown in the AutoMQ Console. ### Source Connectors | Connector | Documentation | | - | - | | Azure IoT Hub Source Connector | [Guide](./source-connectors/azure-iot-hub-source-connector) | | Camunda Zeebe Source Connector | [Guide](./source-connectors/camunda-zeebe-source-connector) | | Couchbase Source Connector | [Guide](./source-connectors/couchbase-kafka-connect-couchbase-source-connector) | | Debezium MongoDB CDC Source Connector | [Guide](./source-connectors/debezium-mongodb-source-connector) | | Debezium MySQL Source Connector | [Guide](./source-connectors/debezium-mysql-source-connector) | | Debezium PostgreSQL Source Connector | [Guide](./source-connectors/debezium-postgresql-source-connector) | | Debezium SQL Server Source Connector | [Guide](./source-connectors/debezium-sqlserver-source-connector) | | Diffusion Source Connector | [Guide](./source-connectors/diffusion-source-connector) | | Elasticsearch Source Connector | [Guide](./source-connectors/elasticsearch-source-connector) | | IRC Source Connector | [Guide](./source-connectors/irc-source-connector) | | MongoDB Source Connector | [Guide](./source-connectors/mongodb-source-connector) | | Neo4j Source Connector | [Guide](./source-connectors/neo4j-source-connector) | | Redis Stream Source Connector | [Guide](./source-connectors/redis-source-connector) | | RSS Source Connector | [Guide](./source-connectors/rss-source-connector) | | Scylla CDC Source Connector | [Guide](./source-connectors/scylla-cdc-source-connector) | | Server Sent Events Source Connector | [Guide](./source-connectors/server-sent-events-source-connector) | | Shell Source Connector | [Guide](./source-connectors/shell-source-connector) | | Twitter Source Connector | [Guide](./source-connectors/twitter-source-connector) | | YugabyteDB Source Connector | [Guide](./source-connectors/yugabytedb-source-connector) | ### Sink Connectors | Connector | Documentation | | - | - | | Ably Sink Connector | [Guide](./sink-connectors/ably-kafka-sink-connector) | | Adobe Experience Platform Sink Connector | [Guide](./sink-connectors/adobe-experience-platform-sink-connector) | | Amazon EventBridge Sink Connector | [Guide](./sink-connectors/amazon-eventbridge-sink-connector) | | Apache Iceberg Sink Connector | [Guide](./sink-connectors/apache-iceberg-sink-connector) | | ArangoDB Sink Connector | [Guide](./sink-connectors/arangodb-sink-connector) | | Azure IoT Hub Sink Connector | [Guide](./sink-connectors/azure-iot-hub-sink-connector) | | Camunda Zeebe Sink Connector | [Guide](./sink-connectors/camunda-platform-8-zeebe-sink-connector) | | ClickHouse Sink Connector | [Guide](./sink-connectors/clickhouse-sink-connector) | | Couchbase Sink Connector | [Guide](./sink-connectors/couchbase-kafka-connect-couchbase-sink-connector) | | Datadog Logs Sink Connector | [Guide](./sink-connectors/datadog-logs-sink-connector) | | Diffusion Sink Connector | [Guide](./sink-connectors/diffusion-sink-connector) | | Google BigQuery Sink Connector | [Guide](./sink-connectors/wepay-kafka-connect-bigquery-sink-connector) | | Lightstreamer Sink Connector | [Guide](./sink-connectors/lightstreamer-sink-connector) | | Milvus Sink Connector | [Guide](./sink-connectors/milvus-sink-connector) | | MongoDB Sink Connector | [Guide](./sink-connectors/mongodb-sink-connector) | | Neo4j Sink Connector | [Guide](./sink-connectors/neo4j-sink-connector) | | New Relic Sink Connector | [Guide](./sink-connectors/new-relic-sink-connector) | | Redis Sink Connector | [Guide](./sink-connectors/redis-sink-connector) | | ScyllaDB Sink Connector | [Guide](./sink-connectors/scylladb-sink-connector) | | Shell Sink Connector | [Guide](./sink-connectors/shell-sink-connector) | | SingleStore Sink Connector | [Guide](./sink-connectors/singlestore-sink-connector) | | Snowflake Sink Connector | [Guide](./sink-connectors/snowflake-kafka-sink-connector) | | Splunk Sink Connector | [Guide](./sink-connectors/splunk-kafka-sink-connector) | | Timeplus Sink Connector | [Guide](./sink-connectors/timeplus-sink-connector) | | Vectara Sink Connector | [Guide](./sink-connectors/vectara-sink-connector) | | Weaviate Sink Connector | [Guide](./sink-connectors/weaviate-kafka-sink-connector) | # Overview Source: https://docs.automq.com/automq-cloud/kafka-connect/overview Introduces the basic concepts of Kafka Connect, the core value and deployment principles of AutoMQ managed Kafka Connect, and provides theoretical support for users to subsequently use AutoMQ Connect. Kafka Connect is a data integration framework provided by the Apache Kafka community for streaming data between Apache Kafka and other data systems. AutoMQ BYOC provides a fully managed Kafka Connect service, so you can run these integrations without deploying and operating the Connect framework yourself. AutoMQ is compatible with the Apache Kafka protocol and Kafka Connect's standard worker, plugin, and Connector model. Existing Kafka clients, Connector implementations, and operating practices can generally be reused without application or Connector rewrites. Check each plugin's prerequisites and compatibility notes before deployment because external systems and plugin dependencies still apply. You create Connect Cluster and Connector resources in the AutoMQ Console or with Terraform. AutoMQ then provisions the Connect Workers and Connector tasks for you. The workers run as replaceable Pods in an EKS cluster inside your specified VPC, keeping integration traffic in your network while allowing worker compute capacity to be managed independently from Kafka data storage. The underlying AutoMQ data plane uses a cloud-native Shared Storage architecture with stateless brokers. Durable Kafka data remains in shared storage while broker compute can be replaced or scaled independently; Connect Workers follow the same cloud-native operating model as replaceable Kubernetes Pods. * **Network placement**: AutoMQ Connect runs on an EKS (Amazon Elastic Kubernetes Service) cluster inside your VPC. A Connect Worker Pod can access other resources in the same VPC, such as RDS and Redis, without an additional public network path. * **Cloud-native worker architecture**: Worker compute is replaceable and independently scalable. Configure worker count, worker tier, and Kubernetes placement on the Connect Cluster; plugin-specific resource or isolation requirements should be validated before production use. ## Recommended workflow 1. [Manage plugins](./manage-plugins) and choose the Managed or custom plugin versions for your Connect Cluster. 2. [Manage Connectors](./manage-connectors) by creating a Connect Cluster and then a Connector. 3. If you are deploying the workers on AWS, prepare the Kubernetes resources with the [AutoMQ on EKS deployment guide](../deploy-automq-on-kubernetes/deploy-to-aws-eks). # Ably Sink Connector Source: https://docs.automq.com/automq-cloud/kafka-connect/sink-connectors/ably-kafka-sink-connector Configure and operate the Ably Sink Connector in AutoMQ Connect, including prerequisites, configuration, monitoring, and troubleshooting. ## Overview The Ably Sink Connector publishes events from Kafka topics to Ably channels, connecting backend event streams to real-time subscribers. It supports use cases such as status updates, business event notifications, and live dashboards. Each Kafka record maps to one Ably message. The destination channel can be fixed or selected dynamically from the topic, partition, or record fields; message names can distinguish event types. Message content depends on the output of the Kafka Connect converter. Schema-backed Struct values are converted to JSON without the schema definition; strings and bytes follow their respective message conversion paths. Schemaless Map or List values are not automatically converted to structured JSON. To publish JSON content, provide a JSON string or a schema-backed Struct. Consumption resumes from offsets committed by Kafka Connect. Duplicates can occur if a failure happens after publishing succeeds but before offsets are committed, or if a request is retried after its response is lost. Do not treat this connector as an exactly-once or unconditional at-least-once delivery solution. For business events that must not be lost or processed twice, include a business event ID in the payload and implement downstream deduplication, reconciliation, and redelivery. ## Prerequisites * The Ably API key must have `publish` permission for every static or dynamic destination channel. * Nested field templates require a converter that provides the corresponding Connect Schema and Struct. ## License Licensed under Apache License 2.0. ## Quick Start Prepare a Connect cluster, Kafka topics, an Ably account, and destination channels, and verify network connectivity and access permissions. For cluster preparation and connector management, see [Manage Connectors](../manage-connectors). The following example consumes UTF-8 string messages and publishes them to a fixed channel. ```properties theme={null} connector.class=com.ably.kafka.connect.ChannelSinkConnector topics= channel= client.key= client.id= value.converter=org.apache.kafka.connect.storage.StringConverter ``` Replace the topic, channel, API key, and client identity, then apply the example as the connector configuration. `client.id` is a nonempty Ably client identity, not a Kafka consumer client identifier. The example does not use record keys, so it inherits the worker's key converter. To use key templates, also verify how keys are decoded. Inject credentials through your deployment environment's secure configuration mechanism; do not store them in version control or shared logs. ## Configuration The following reference lists all public plugin settings and six Kafka Connect framework settings that directly affect subscriptions, parallelism, and message decoding. A default of None means there is no default value; required settings must be supplied explicitly. `null` means unspecified, and `[]` means an empty list; neither is equivalent to an empty string. Configuration names are case-sensitive. ### Connector and Subscriptions #### `connector.class` Specifies the sink connector implementation class. * **Type**: `STRING` * **Default**: None * **Required**: Yes * **Importance**: High * **Valid Values / Notes**: Use `com.ably.kafka.connect.ChannelSinkConnector`. Every worker running a task must be able to load the plugin. #### `topics` Specifies the Kafka topics to consume. * **Type**: `LIST` * **Default**: `[]` * **Importance**: High * **Valid Values / Notes**: Separate multiple names with commas. Configure exactly one of `topics` and `topics.regex`. When a DLQ is enabled, do not subscribe to the DLQ topic. #### `topics.regex` Selects Kafka topics to consume using a regular expression. * **Type**: `STRING` * **Default**: `""` * **Importance**: High * **Valid Values / Notes**: Uses Java regular expression syntax. Mutually exclusive with `topics`; when a DLQ is enabled, the expression must not match the DLQ topic. #### `tasks.max` Sets the maximum number of tasks. * **Type**: `INT` * **Default**: `1` * **Importance**: High * **Valid Values / Notes**: Must be at least `1`. Actual consumption parallelism is limited by the number of subscribed partitions. A partition is not assigned simultaneously to multiple tasks in the same consumer group. This setting controls a different dimension of parallelism from the batch execution thread count within each task. ### Authentication and Logging #### `client.key` Sets the Ably API key used to publish messages. * **Type**: `PASSWORD` * **Default**: None * **Required**: Yes * **Importance**: High * **Valid Values / Notes**: Use a valid API key with permissions covering all destination channels. Do not expose the actual value in configuration examples, version control, or logs. #### `client.id` Sets the Ably client identity. * **Type**: `STRING` * **Default**: None * **Required**: Yes * **Importance**: High * **Valid Values / Notes**: A nonempty string; this is not the Kafka consumer's `client.id`. #### `client.loglevel` Sets the Ably SDK logging level. * **Type**: `INT` * **Default**: `2` * **Importance**: Low * **Valid Values / Notes**: Defined levels are `2` (VERBOSE), `3` (DEBUG), `4` (INFO), `5` (WARN), `6` (ERROR), and `99` (NONE). In production, choose a level appropriate for troubleshooting and avoid excessive debug output over extended periods. ### Message Decoding and Mapping #### `key.converter` Sets the converter for Kafka record keys. * **Type**: `CLASS` * **Default**: `null` * **Importance**: Low * **Valid Values / Notes**: Inherits the worker setting when unspecified. When using `#{key}` or `#{key.}`, choose a converter that matches the actual encoding. Nested paths require Schema/Struct. #### `value.converter` Sets the converter for Kafka record values. * **Type**: `CLASS` * **Default**: `null` * **Importance**: Low * **Valid Values / Notes**: Inherits the worker setting when unspecified. Strings can use `org.apache.kafka.connect.storage.StringConverter`. `#{value.}` requires Schema/Struct, not just JSON text or a schemaless Map. Configure converter-specific options according to the selected converter. #### `channel` Sets a static name or template for the destination Ably channel. * **Type**: `STRING` * **Default**: None * **Required**: Yes * **Importance**: High * **Valid Values / Notes**: A nonempty string whose first character is not a colon, comma, whitespace, or `[`. The name must not contain a newline. Templates support `#{topic}`, `#{topic.name}`, `#{topic.partition}`, `#{key}`, `#{key.}`, and `#{value.}`. Nested paths traverse Struct fields; array indexing and Map paths are not supported. Mapping errors such as missing fields are controlled by `onFailedRecordMapping`. Template output must also satisfy Ably channel naming and permission requirements. #### `message.name` Sets the Ably message name to identify the event type. * **Type**: `STRING` * **Default**: `null` * **Importance**: Medium * **Valid Values / Notes**: Accepts static text or the same templates as `channel`. No name is set when unspecified or empty. There is no direct `#{value}` placeholder. #### `messagePayloadSizeMax` A public setting related to message payload size. * **Type**: `INT` * **Default**: `65536` * **Importance**: Medium * **Valid Values / Notes**: This setting does not enforce a payload size limit. Do not rely on it to validate, truncate, or split messages. Control actual message and request sizes upstream and comply with Ably service limits. ### Batching and Concurrency #### `batchExecutionThreadPoolSize` Sets the number of batch publishing threads per task. * **Type**: `INT` * **Default**: `10` * **Importance**: Medium * **Valid Values / Notes**: Must be greater than `0`. Set to `1` to execute batch publishing serially within the task. Multiple threads allow batches to complete concurrently, without guaranteeing completion order across batches or global ordering across tasks. #### `batchExecutionMaxBufferSize` Sets the maximum number of Kafka records buffered before submitting a batch. * **Type**: `INT` * **Default**: `100` * **Importance**: Medium * **Valid Values / Notes**: Use a value greater than `0`. A batch is submitted when the record count reaches this threshold. This is neither a byte-size limit nor a limit on the total backlog of data awaiting publication. #### `batchExecutionMaxBufferSizeMs` Sets the wait time in milliseconds for timed publishing of a partially filled buffer. * **Type**: `INT` * **Default**: `100` * **Importance**: Medium * **Valid Values / Notes**: Use a nonnegative value; `0` can trigger timed publishing immediately. Full batches can be published earlier. This is neither a minimum per-record delay nor an upper bound on end-to-end latency. #### `client.async.http.threadpool.size` Sets the Ably SDK asynchronous HTTP thread pool size. * **Type**: `INT` * **Default**: `64` * **Importance**: Medium * **Valid Values / Notes**: This controls SDK asynchronous requests, not this connector's batch publishing concurrency. Adjust batch publishing concurrency with `batchExecutionThreadPoolSize`. ### Connections and Fallback Endpoints #### `client.tls` Controls whether connections to Ably use TLS. * **Type**: `BOOLEAN` * **Default**: `true` * **Importance**: Medium * **Valid Values / Notes**: `true` or `false`. Keep enabled in production to avoid transmitting credentials and messages in plaintext. #### `client.rest.host` Sets a custom REST host. * **Type**: `STRING` * **Default**: `null` * **Importance**: Low * **Valid Values / Notes**: The SDK selects the REST host when unspecified. Set only when a custom endpoint is needed, and verify that authentication, networking, and fallback endpoint settings are consistent. When using a nondefault REST host, do not also set `client.environment`. #### `client.port` Sets the port for non-TLS connections. * **Type**: `INT` * **Default**: `0` * **Importance**: Low * **Valid Values / Notes**: `0` uses the SDK's default non-TLS port, `80`. Used only when `client.tls=false`. An explicit value must be a valid service port. #### `client.tls.port` Sets the port for TLS connections. * **Type**: `INT` * **Default**: `0` * **Importance**: Low * **Valid Values / Notes**: `0` uses the SDK's default TLS port, `443`. Used only when `client.tls=true`. An explicit value must be a valid service port. #### `client.environment` Sets a nondefault Ably service environment. * **Type**: `STRING` * **Default**: `null` * **Importance**: Low * **Valid Values / Notes**: Configure only when required by the Ably service deployment; endpoint selection is handled by the SDK. It cannot be combined with a nondefault `client.rest.host`. This is not a Kafka Connect or managed platform environment identifier. #### `client.http.open.timeout` Sets the timeout in milliseconds for establishing an HTTP connection. * **Type**: `INT` * **Default**: `4000` * **Importance**: Medium * **Valid Values / Notes**: Set a reasonable nonnegative timeout for your network conditions. Do not treat it as a timeout for the entire message processing workflow. #### `client.http.request.timeout` Sets the timeout in milliseconds for a single HTTP request and response. * **Type**: `INT` * **Default**: `10000` * **Importance**: Medium * **Valid Values / Notes**: Set a reasonable nonnegative timeout for network conditions and request size. It does not include the entire Kafka Connect error retry window. #### `client.http.max.retry.count` Sets the number of SDK HTTP retries against fallback hosts. * **Type**: `INT` * **Default**: `3` * **Importance**: Medium * **Valid Values / Notes**: A nonnegative value is recommended. Retries require available fallback hosts and an error that meets the SDK's host-failure criteria. This setting does not retry every HTTP error and is not a Kafka consumption retry policy. #### `client.fallback.hosts` Sets the list of fallback hosts available for HTTP requests. * **Type**: `LIST` * **Default**: `[]` * **Importance**: Medium * **Valid Values / Notes**: Separate multiple hosts with commas; they must match the actual Ably environment. An empty list provides no fallback candidates and does not automatically enable the SDK's built-in fallback hosts. Increasing the retry count alone does not enable fallback-host retries. ### Proxy #### `client.proxy` Controls whether an HTTP proxy is enabled. * **Type**: `BOOLEAN` * **Default**: `false` * **Importance**: Medium * **Valid Values / Notes**: When enabled, a proxy host and actual port are required. Proxy parameter types and enum values must remain valid even when the proxy is disabled. #### `client.proxy.host` Sets the HTTP proxy host. * **Type**: `STRING` * **Default**: `null` * **Importance**: Medium * **Valid Values / Notes**: When `client.proxy=true`, specify a nonempty, reachable proxy host. #### `client.proxy.port` Sets the HTTP proxy port. * **Type**: `INT` * **Default**: `0` * **Importance**: Medium * **Valid Values / Notes**: When the proxy is enabled, specify an actual valid port. The default `0` does not automatically select `80` or `443`. #### `client.proxy.username` Sets the proxy authentication username. * **Type**: `STRING` * **Default**: `null` * **Importance**: Medium * **Valid Values / Notes**: This is not an Ably identity. When the proxy is enabled and a username is set, `client.proxy.password` must also be set. #### `client.proxy.password` Sets the proxy authentication password. * **Type**: `PASSWORD` * **Default**: `null` * **Importance**: Medium * **Valid Values / Notes**: Configure together with the proxy username. Inject through a secure configuration mechanism and do not log the actual value. #### `client.proxy.pref.auth.type` Sets the preferred proxy authentication type. * **Type**: `STRING` * **Default**: `BASIC` * **Importance**: Medium * **Valid Values / Notes**: Only `BASIC`, `DIGEST`, and `X_ABLY_TOKEN` are allowed; values are case-sensitive. Choose a type supported by the proxy. #### `client.proxy.non.proxy.hosts` Sets the list of hosts that bypass the proxy. * **Type**: `LIST` * **Default**: `null` * **Importance**: Medium * **Valid Values / Notes**: Separate multiple hosts with commas. The SDK's proxy configuration handles this list; do not assume arbitrary wildcard syntax is supported. ### Error Handling and Push Options #### `onFailedRecordMapping` Sets the handling policy for channel or message name mapping failures. * **Type**: `STRING` * **Default**: `stop` * **Importance**: Medium * **Valid Values / Notes**: Only `stop`, `skip`, and `dlq` are allowed; values are case-sensitive. `stop` stops batch processing, while `skip` discards records that fail mapping. `dlq` requires an available Kafka Connect error record reporting mechanism, a configured `errors.deadletterqueue.topic.name`, and `errors.tolerance=all` to allow continued processing. DLQ-mode processing cannot continue without the reporting mechanism. This setting does not cover all converter, content conversion, or HTTP publishing errors. #### `client.push.full.wait` Sets the wait option passed to the Ably SDK for Push REST operations. * **Type**: `BOOLEAN` * **Default**: `false` * **Importance**: Medium * **Valid Values / Notes**: This sink does not perform device Push management operations. The setting does not control batch publishing completion or guarantee delivery of device notifications. Notification use cases also require separate Ably Push configuration and device registration. ## Best Practices ### Reduce Batch Interleaving for Status Events **Applicable Scenario**: Order or device status events are already partitioned by business entity, and you want to reduce interleaving caused by concurrently published batches within the same task, rather than achieve global ordering across entities. **Configuration Example**: Add the following setting to the Quick Start configuration to override the default batch execution thread count. ```properties theme={null} batchExecutionThreadPoolSize=1 ``` **Key Considerations**: This setting makes batch publishing serial within one task, but multiple tasks and partitions can still publish concurrently to the same channel. It does not guarantee strict end-to-end ordering or duplicate-free delivery. Write events for the same entity to the same Kafka partition, include an entity version or business sequence number in the payload, and let subscribers identify duplicates and stale states. Also evaluate the throughput impact of serial publishing. Do not rely solely on increasing the buffered record count to address a persistent backlog; use consumer lag, request duration, and worker memory to guide adjustments to the production rate and publishing parallelism. ## Monitoring ### What to Monitor Monitor Kafka Connect cluster and worker health, connector and task status, throughput, consumption and processing latency, offset commits and commit failures, errors, and retries. Use worker JVM heap usage, GC, and thread activity to assess backlogs. A running task or a committed offset alone does not prove that business clients have received every message; also reconcile business events. Monitor DLQ activity only when the corresponding error handling is enabled. ### Import the Grafana Dashboard Download the [Kafka Connect Grafana Dashboard](https://automq-download-center.oss-cn-hangzhou.aliyuncs.com/connect-dashboard/automq-connect-cluster-dashboard.json). Ensure that a Prometheus-compatible data source collects Kafka Connect metrics and that labels such as cluster and worker match the dashboard queries, then import the JSON into Grafana and select the corresponding data source. ## Limitations * Exactly-once delivery from Kafka to Ably is not guaranteed. Do not rely on automatic idempotent publishing to eliminate duplicates. * Global ordering across partitions, tasks, or channels is not provided. * Schema-backed values support only top-level Struct, String, and Bytes, not top-level numeric, Boolean, Array, or Map values. * Nested templates require Schema/Struct and do not support parsing JSON strings, schemaless Maps, array indexing, or Map paths. * Template leaf values support strings, Integer, Long, Boolean, and byte arrays containing valid UTF-8, but not Float, Double, Byte, Short, or ByteBuffer. * Struct-to-JSON conversion does not support direct raw byte-array fields. Do not assume that arbitrary logical types or timestamp precision are preserved unchanged. * Without a value schema, Kafka keys, headers, and Push Extras are not exported. Even with a schema, the topic, partition, offset, and Kafka timestamp are not automatically exported. * A null value does not delete Ably data, and Kafka tombstones are not automatically skipped. * The buffered record count does not limit the total pending backlog; persistently slow requests can cause memory pressure. * `messagePayloadSizeMax` does not limit actual payload size. Message sizes, batch request sizes, and rates remain subject to Ably service limits. ## FAQ ### Why Are There No Messages in the Destination Channel While the Task Is Running? Check whether the topic has new records, whether the consumer group is already at the end, whether the subscription matches, and whether the channel produced by the template matches the subscriber's channel. Verify that the API key has publish permission for that channel, then check REST errors, connection timeouts, and worker memory. At low traffic levels, also account for the timed publishing wait for partially filled batches. A running status alone does not indicate successful publishing. ### Why Does a Field Template Fail Even Though the Field Exists in the JSON? JSON strings and schemaless Maps cannot supply data for nested templates. Check whether the converter outputs a schema-backed Struct, whether the field path exists, and whether the leaf value has a supported type. Adjust the converter or upstream event structure to match the actual Kafka encoding. Field renames and removals also affect templates, so check referenced fields before deploying schema changes. ### Why Is the Message Not the Expected JSON Object, or Why Are Keys and Headers Missing? Schemaless Map/List values are not automatically published as structured JSON, and Key and Headers Extras are not generated without a value schema. For JSON content, use a JSON string or a schema-backed Struct. For Extras, use a supported schema-backed value and check how keys and headers are decoded. String keys remain strings, byte-array keys use Base64, and other key types are not automatically exported. ### Why Is Publishing Not Retried After a Failure Even Though I Increased the Retry Count? Check whether `client.fallback.hosts` specifies available fallback hosts matching the environment. The default empty list provides no fallback candidates. The SDK retries against fallback hosts only for errors that meet its host-failure criteria; do not expect permission errors, rate limiting, or all server errors to be retried automatically. Address credentials, permissions, or rate issues first. Increasing the retry count is not a substitute for these fixes. ### Why Are Records Not Sent to the DLQ After Mapping Fails? Verify that `onFailedRecordMapping=dlq` and check the Kafka Connect DLQ topic, write permissions, error tolerance settings, and availability of the error record reporting mechanism. Setting the plugin policy alone does not enable complete DLQ handling. Also distinguish mapping failures from converter, content format, and HTTP publishing errors; this policy does not cover every error type. Do not use `skip` to hide business events that must be retained. Configure alerting, remediation, and replay procedures for the DLQ. ### Why Do I Receive Duplicate Events After a Restart? Publishing and offset commits are not a single atomic operation. Records published before their offsets are committed may be consumed again, and retries after a lost request response can also produce duplicates. Deduplicate using stable business event IDs and retain an event source that supports reconciliation. Do not interpret a single successful recovery or serial publishing configuration as an unconditional guarantee against loss and duplicates. # Adobe Experience Platform Sink Connector Source: https://docs.automq.com/automq-cloud/kafka-connect/sink-connectors/adobe-experience-platform-sink-connector Configure and operate the Adobe Experience Platform Sink Connector in AutoMQ Connect, including prerequisites, configuration, monitoring, and troubleshooting. ## Overview Adobe Experience Platform Sink Connector consumes JSON messages from Kafka Topics and sends them in batches to Adobe Experience Platform (AEP) through an HTTP streaming ingestion inlet. It sits between event producers and AEP dataflows, bringing data such as customer activities and application events into configured XDM Schemas and Datasets for subsequent analytics or customer profile processing. Each Kafka message value corresponds to one AEP message. The Connector groups these messages into a `messages` array for delivery. Target resources and field mappings depend on the AEP dataflow configuration and message content. The Connector does not automatically create Datasets, generate mappings, or add AEP message headers, nor does it automatically include Kafka message keys, partitions, Offsets, or Headers in business data. ## Prerequisites * Prepare the target XDM Schema and Dataset, along with the HTTP API Source base connection, source connection, target connection, and Dataflow, in an AEP project, organization, and Sandbox for which you have permission. Obtain the `inletUrl` returned by the base connection and the corresponding `flowId`. If RAW data requires transformation, configure a Data Prep Mapping in AEP and associate it with the Dataflow; XDM data that already conforms to the target Schema can use a path without transformation. * Check the `authenticationRequired` policy of the AEP base connection. An inlet that requires authentication must have a valid, authorized Adobe identity integration. Use an authenticated inlet for data containing personally identifiable information. The Bearer Token, API Key, IMS organization, and Sandbox request headers for resource management APIs are used to manage AEP resources; do not copy them directly as a set of Connector settings. * Upstream messages must have the AEP message structure and field types required by the selected inlet and dataflow. Wait approximately five minutes after creating a Dataflow before sending data, and account for brief ingestion pauses when creating or updating a dataflow. ## License Licensed under Apache License 2.0. ## Quick Start Prepare a Connect Cluster, Kafka, and the AEP resources described above, and confirm network connectivity and access permissions. For creation and management operations, see [Manage Connectors](../manage-connectors). The following minimal configuration applies to a pre-created inlet with `authenticationRequired=false` and a Topic whose message keys are UTF-8 strings or null and whose message values are plain JSON objects. It does not apply to inlets that require authentication or to data containing personally identifiable information. ```properties theme={null} name=adobe-experience-platform-sink connector.class=com.adobe.platform.streaming.sink.impl.AEPSinkConnector topics= key.converter=org.apache.kafka.connect.storage.StringConverter value.converter=org.apache.kafka.connect.json.JsonConverter value.converter.schemas.enable=false aep.endpoint= ``` Replace the Topic and inlet address with your actual resources. Set `aep.endpoint` to the HTTPS `inletUrl` returned by AEP, with a path of `/collection/`. Do not use an address that already contains `/collection/batch/`; the Connector converts it to the batch inlet itself. There is no need to explicitly set the default single Task, batch thresholds, or disabled authentication settings. `value.converter.schemas.enable=false` removes the need for the Connect `schema` / `payload` envelope, but does not remove the AEP message structure requirements. The following is a single message value written to Kafka by an upstream producer, illustrating the XDM message structure for HTTP API Source. It is not Connector configuration or the outer `messages` array of the final HTTP request. Replace the Schema, Dataflow, Dataset, and business fields before use; `xdmEntity` must conform to the actual target Schema. ```json theme={null} { "header": { "schemaRef": { "id": "", "contentType": "application/vnd.adobe.xed-full-notext+json; version=1.0" }, "flowId": "", "datasetId": "" }, "body": { "xdmMeta": { "schemaRef": { "id": "", "contentType": "application/vnd.adobe.xed-full-notext+json; version=1.0" } }, "xdmEntity": { "_id": "customer-event-001", "person": { "name": { "firstName": "Example", "lastName": "Customer" } } } } } ``` Here, `header` is a JSON message header, not HTTP Headers; `flowId`, `datasetId`, `schemaRef`, and `body` are not Connector parameters. The Connector does not populate these fields. Do not wrap each Kafka message in an additional `messages` layer beforehand. Other AEP ingestion paths may require different message metadata, such as `imsOrgId` in batch messages. Follow the requirements of the actual inlet rather than mixing examples from different paths. After applying the configuration, send a small amount of Schema-compliant data first. Check Connect runtime status, ingestion responses, AEP validation results, and Dataset ingestion results separately. A successful HTTP response indicates only acceptance at the ingestion layer; it does not prove successful ingestion into the final Dataset. **Security warning**: The Connector and Tasks output raw configuration in INFO logs at startup, including any Client Secret, authorization code, proxy password, or custom Authorization request header that may be present. Disabling DEBUG alone or keeping `errors.log.include.messages=false` does not resolve this risk. Do not assume that Config Provider substitution automatically redacts values. Before supplying production credentials, implement startup log redaction or suppression and log access controls. Do not enable DEBUG for sensitive data or include credentials and message content in support tickets or shared logs. ## Configuration ### Instance and Input Subscription #### `name` The Connector instance name. * **Type**: `string` * **Default**: None * **Importance**: High * **Valid Values / Notes**: Required; must be non-empty and contain no ISO control characters. Use a unique name. #### `connector.class` Selects the AEP Sink Connector. * **Type**: `string` * **Default**: None * **Importance**: High * **Valid Values / Notes**: Required; use `com.adobe.platform.streaming.sink.impl.AEPSinkConnector`. #### `topics` Specifies the Kafka Topics to consume. * **Type**: `list` * **Default**: Empty list * **Importance**: High * **Valid Values / Notes**: Comma-separated Topic names. Exactly one of `topics` and `topics.regex` must be non-empty. Must not include the DLQ Topic. #### `topics.regex` Subscribes to Kafka Topics using a regular expression. * **Type**: `string` * **Default**: Empty string * **Importance**: High * **Valid Values / Notes**: A valid Java regular expression; mutually exclusive with non-empty `topics`. Must not match the DLQ Topic. #### `tasks.max` The maximum number of Tasks that may be created. * **Type**: `int` * **Default**: `1` * **Importance**: High * **Valid Values / Notes**: At least `1`. Actual parallelism is limited by input partition assignment. All Tasks use the same inlet, with no global ordering across Tasks. ### Message Conversion #### `key.converter` Deserializes Kafka message keys. * **Type**: `class` * **Default**: `null` * **Importance**: Low * **Valid Values / Notes**: Uses the Worker Converter when omitted. Must match the upstream key encoding. The Quick Start uses `org.apache.kafka.connect.storage.StringConverter` for UTF-8 string keys; message keys are not sent to AEP. #### `value.converter` Deserializes Kafka message values. * **Type**: `class` * **Default**: `null` * **Importance**: Low * **Valid Values / Notes**: Uses the Worker Converter when omitted. The Quick Start explicitly uses `org.apache.kafka.connect.json.JsonConverter`; this is not the default class. Input must meet AEP message requirements, not merely be syntactically valid JSON. #### `value.converter.schemas.enable` Controls whether JsonConverter uses the Connect Schema envelope. * **Type**: `boolean` * **Default**: `true` * **Importance**: High * **Valid Values / Notes**: Applies only to JsonConverter. Use `false` for plain JSON objects; `true` requires the Connect `schema` / `payload` format. This setting does not control AEP XDM Schema validation. ### Target Inlet #### `aep.endpoint` Specifies the AEP streaming ingestion inlet. * **Type**: `string` (type read at runtime) * **Default**: No ConfigDef default * **Importance**: Not declared * **Valid Values / Notes**: Required, with no runtime fallback; must not be empty. Specify the full HTTPS inlet URL using the original `/collection/` path. This path is replaced with `/collection/batch/`; an already converted address will be rewritten again. #### `aep.connection.endpoint.headers` Adds HTTP Headers to ingestion requests. * **Type**: `string` (type read at runtime) * **Default**: No ConfigDef default * **Importance**: Not declared * **Valid Values / Notes**: JSON object text mapping header names to string values. Uses an empty map at runtime when missing or an empty string; these headers are not added if JSON parsing fails. This differs from `header` in message values. Authorization information in this setting is at risk of disclosure through raw configuration logs. ### Batch Delivery #### `aep.flush.interval.seconds` The elapsed-time threshold for triggering delivery within one consumption batch, in seconds. * **Type**: `int` (type read at runtime) * **Default**: No ConfigDef default * **Importance**: Not declared * **Valid Values / Notes**: Uses `1` at runtime when missing or blank, multiplied by `1000` using Java `int` arithmetic. If the multiplication result is less than `1`, it falls back to `1000` ms. Malformed integer text or text outside the `int` range throws `NumberFormatException` rather than falling back. There is no ConfigDef range validation; a positive integer is recommended, with multiplication overflow avoided. This is not a background timer. Remaining messages are still sent at the end of a consumption batch; they are not held across consumption batches to fill a batch. #### `aep.flush.bytes.kb` The accumulated-message-size threshold for triggering delivery within one consumption batch, in KB. * **Type**: `int` (type read at runtime) * **Default**: No ConfigDef default * **Importance**: Not declared * **Valid Values / Notes**: Uses `4` at runtime when missing or blank, multiplied by `1024` using Java `int` arithmetic. If the multiplication result is less than `1`, it falls back to `4096`. Malformed integer text or text outside the `int` range throws `NumberFormatException` rather than falling back. There is no ConfigDef range validation; a positive integer is recommended, with multiplication overflow avoided. The accumulated size is actually Java string length, not UTF-8 byte count, and excludes the final request envelope overhead. The threshold is checked only after a record is added; it cannot ensure compliance with Adobe's 1 MB request size limit. ### HTTP Connections and Retries #### `aep.connection.timeout` The connection timeout for ingestion HTTP requests, in milliseconds. * **Type**: `int` (type read at runtime) * **Default**: No ConfigDef default * **Importance**: Not declared * **Valid Values / Notes**: Uses `5000` at runtime when missing or blank; use a positive integer. Controls only ingestion connections, not Token request timeouts. #### `aep.connection.readTimeout` The read timeout for ingestion HTTP requests, in milliseconds. * **Type**: `int` (type read at runtime) * **Default**: No ConfigDef default * **Importance**: Not declared * **Valid Values / Notes**: Uses `60000` at runtime when missing or blank; use a positive integer and preserve the parameter name's capitalization. Does not apply to Token requests. #### `aep.connection.maxRetries` Limits the total number of attempts for one ingestion HTTP call. * **Type**: `int` (type read at runtime) * **Default**: No ConfigDef default * **Importance**: Not declared * **Valid Values / Notes**: Uses `3` at runtime when missing or blank, meaning at most three total attempts, not an initial request plus three retries. There is no parameter range validation. Use a positive value to send requests; do not set zero or a negative value. Resends the same request body at fixed intervals for 5xx responses and I/O exceptions. Other non-2xx responses, such as 429, do not take this retry path, nor do response content parsing failures. Resending may cause duplicates. #### `aep.connection.retryBackoff` The fixed wait after a failed ingestion HTTP attempt, in milliseconds. * **Type**: `int` (type read at runtime) * **Default**: No ConfigDef default * **Importance**: Not declared * **Valid Values / Notes**: Uses `300` at runtime when missing or blank; use a non-negative integer. A wait may also occur after the final 5xx or I/O failure. Waiting blocks the Task; this is not an authentication retry or adaptive rate limiting setting. ### Authentication #### `aep.connection.auth.enabled` Enables the Connector's Bearer Token acquisition and attachment functionality. * **Type**: `string` (type read at runtime) * **Default**: No ConfigDef default * **Importance**: Not declared * **Valid Values / Notes**: Uses the string `false` at runtime when missing. Only the exact lowercase value `true` enables authentication; `TRUE` or values containing whitespace do not. This setting cannot change the AEP inlet's authentication policy. #### `aep.connection.auth.token.type` Selects the Adobe Token acquisition method. * **Type**: `string` (type read at runtime) * **Default**: No ConfigDef default * **Importance**: Not declared * **Valid Values / Notes**: Uses `jwt_token` at runtime when authentication is enabled and this setting is absent. Supports the exact values `access_token`, `jwt_token`, and `oauth2_access_token`; empty or unknown values fail. The JWT authentication path is deprecated. When migrating, explicitly select OAuth2 according to Adobe identity integration requirements and confirm authorization and scope compatibility. The presence of an option does not mean that the server still supports legacy JWT. #### `aep.connection.auth.client.id` Specifies the Client ID of the Adobe identity integration. * **Type**: `string` (type read at runtime) * **Default**: No ConfigDef default * **Importance**: Not declared * **Valid Values / Notes**: No runtime fallback; required for all three authentication methods when enabled. It is not an Access Token. #### `aep.connection.auth.client.secret` Specifies the Client Secret of the Adobe identity integration. * **Type**: `string` (type read at runtime) * **Default**: No ConfigDef default * **Importance**: Not declared * **Valid Values / Notes**: No runtime fallback; required for all three authentication methods when enabled. This setting has no automatic PASSWORD-type redaction protection. Resolve the risk of disclosure through raw configuration logs before supplying it. #### `aep.connection.auth.endpoint` Specifies the Adobe IMS base URL. * **Type**: `string` (type read at runtime) * **Default**: No ConfigDef default * **Importance**: Not declared * **Valid Values / Notes**: No runtime fallback; required when authentication is enabled. Do not omit it in reliance on environment variables. The three methods append `/ims/token/v1`, `/ims/exchange/jwt/`, and `/ims/token/v3`, respectively. Do not append these paths beforehand. #### `aep.connection.auth.client.code` Specifies the authorization code required for IMS authorization code exchange. * **Type**: `string` (type read at runtime) * **Default**: No ConfigDef default * **Importance**: Not declared * **Valid Values / Notes**: No runtime fallback; required only for the `access_token` method and unused by the other methods. It is not a pre-issued Bearer Token. It is a sensitive credential that may appear in raw configuration logs. ### Legacy JWT Authentication #### `aep.connection.auth.imsOrg` Specifies the IMS organization ID for JWT authentication. * **Type**: `string` (type read at runtime) * **Default**: No ConfigDef default * **Importance**: Not declared * **Valid Values / Notes**: No runtime fallback; required only for the legacy `jwt_token` method and unused by other authentication methods. This authentication path is deprecated; the replacement is `oauth2_access_token` configured according to Adobe identity integration requirements. #### `aep.connection.auth.accountKey` Specifies the technical account identifier for JWT authentication. * **Type**: `string` (type read at runtime) * **Default**: No ConfigDef default * **Importance**: Not declared * **Valid Values / Notes**: No runtime fallback; required only for the legacy `jwt_token` method. It is not an RSA private key. This authentication path is deprecated. Other methods do not use this setting; migrate to the corresponding OAuth2 Client settings. #### `aep.connection.auth.filePath` Specifies the path to the RSA private key file used for JWT authentication. * **Type**: `string` (type read at runtime) * **Default**: No ConfigDef default * **Importance**: Not declared * **Valid Values / Notes**: No runtime fallback; required only for the legacy `jwt_token` method. Every Worker running a Task must be able to read this local file. Use a PEM-encoded PKCS#8 private key, with a file size no greater than 1 MiB. Do not put the private key content in configuration. This authentication path is deprecated; OAuth2 does not use this setting. ### HTTP Proxy #### `aep.connection.proxy.host` Specifies the proxy host for ingestion requests and authentication providers. * **Type**: `string` (type read at runtime) * **Default**: No ConfigDef default * **Importance**: Not declared * **Valid Values / Notes**: Uses `null` at runtime when missing or blank, leaving the proxy host unspecified. Proxy behavior is handled by the HTTP connection. #### `aep.connection.proxy.port` Specifies the proxy port. * **Type**: `int` (type read at runtime) * **Default**: No ConfigDef default * **Importance**: Not declared * **Valid Values / Notes**: Uses `443` at runtime when missing or blank. Specify a valid TCP port when configuring a proxy host. There is no Connector-level range validation. #### `aep.connection.proxy.user` Specifies the username for a proxy that requires authentication. * **Type**: `string` (type read at runtime) * **Default**: No ConfigDef default * **Importance**: Not declared * **Valid Values / Notes**: Uses `null` at runtime when missing or blank. Use it with the password as required by the proxy. Proxy authentication uses the JVM-global default Authenticator; consider the impact on other connections in the same Worker. #### `aep.connection.proxy.password` Specifies the proxy authentication password. * **Type**: `string` (type read at runtime) * **Default**: No ConfigDef default * **Importance**: Not declared * **Valid Values / Notes**: Uses `null` at runtime when missing or blank. There is no automatic PASSWORD redaction protection. Both raw configuration logs at startup and proxy DEBUG logs pose a risk of credential exposure. ### Error Handling #### `errors.tolerance` Controls the tolerance policy for record errors that the framework can handle. * **Type**: `string` * **Default**: `none` * **Importance**: Medium * **Valid Values / Notes**: `none` or `all`. `all` does not mean all remote HTTP errors are recoverable, nor can it prevent unreported record drops inside the Connector. 401/403 may still cause Task failure. #### `errors.deadletterqueue.topic.name` Specifies the DLQ Topic for Sink error records. * **Type**: `string` * **Default**: Empty string * **Importance**: Medium * **Valid Values / Notes**: An empty value disables the DLQ. A non-empty DLQ Topic must be excluded from the input subscription. Only records entering the framework's error reporting path may be written to it; do not treat it as a backup of all failed AEP records. #### `errors.deadletterqueue.topic.replication.factor` Sets the replication factor when automatically creating a DLQ Topic. * **Type**: `short` * **Default**: `3` * **Importance**: Medium * **Valid Values / Notes**: For a DLQ Topic that does not yet exist, match the number of replicas supported by the Kafka deployment. Does not change the replication factor of an existing Topic. #### `errors.deadletterqueue.context.headers.enable` Adds error context headers to DLQ records. * **Type**: `boolean` * **Default**: `false` * **Importance**: Medium * **Valid Values / Notes**: Adds Headers with the `__connect.errors.` prefix when enabled. Assess the risk of exposing context information. These Headers are not part of the message headers sent to AEP. #### `errors.log.enable` Controls framework error logging. * **Type**: `boolean` * **Default**: `false` * **Importance**: Medium * **Valid Values / Notes**: Independent of the Connector log level. Disabling it does not prevent Connector startup logs from outputting raw configuration. #### `errors.log.include.messages` Controls whether framework error logs include message details. * **Type**: `boolean` * **Default**: `false` * **Importance**: Medium * **Valid Values / Notes**: Keep disabled for sensitive input. This is not a redaction mechanism for Adobe configuration or proxy credentials. ## Best Practices ### Increase Consumption Parallelism When Backlog Grows **Applicable Scenario**: Integration is complete and data has been confirmed to reach the Dataset, but a single Task's consumption backlog keeps growing during ongoing operation. You want to send in parallel using multiple input Topic partitions while keeping the message format and target inlet unchanged. **Configuration Example**: Add the following setting to the Quick Start configuration. Here, `2` is an example starting point for scaling, not a universally optimal value. The input Topic should have enough assignable partitions. ```properties theme={null} tasks.max=2 ``` **Key Points**: First check whether AEP rate limiting, request failures, or ingestion validation errors are causing the backlog; blindly adding Tasks is not a solution to these conditions. Each Task sends independently to the same inlet. Adding Tasks increases concurrent HTTP requests but does not provide global ordering across partitions. After changing the setting, compare consumption backlog, request latency, and AEP ingestion and Dataset results. Reduce parallelism if target-side pressure or errors increase. Raising the limit will not provide corresponding parallelism if there are too few input partitions. ## Monitoring ### What to Monitor Monitor Kafka Connect cluster health, Connector / Task status, consumption throughput and backlog, end-to-end latency, Offset commits, errors and retries, and Worker JVM memory, GC, and thread signals. Monitor DLQ activity only when the relevant error handling is configured. RUNNING, HTTP 2xx, and committed Offsets do not indicate successful Dataset ingestion. Independently observe AEP Dataflows, Dataset batch status, and streaming validation results, checking ingestion-layer acceptance counts separately from final Dataset ingestion results. ### Import the Grafana Dashboard Download the shared [Kafka Connect Grafana Dashboard](https://automq-download-center.oss-cn-hangzhou.aliyuncs.com/connect-dashboard/automq-connect-cluster-dashboard.json). Confirm that Connect / Worker metrics are collected and that a compatible data source and the cluster, Connector, Task, and other labels required by the dashboard are configured. Then import the JSON into Grafana and select the corresponding data source. ## Limitations * The Connector does not automatically create AEP resources, perform Data Prep mappings, or populate the XDM message structure. It also does not provide routing to different target inlets by Topic. * It does not provide CDC deletes, update merging, or Schema evolution management. Kafka null values and tombstones do not represent AEP delete operations and may trigger data conversion exceptions. * Raw JSON strings that fail to parse may be excluded directly without entering the error reporting path. Some target-side errors may also be logged while Offsets continue to advance. Do not interpret Offset advancement as complete delivery. * It does not provide transactional writes, idempotency keys, or automatic deduplication. HTTP retries, restarts before Offset commits, and rebalances may produce duplicates. It guarantees neither unconditional at-least-once delivery to AEP nor exactly-once delivery. * Batch thresholds do not equal the final HTTP request size in bytes and cannot automatically ensure compliance with Adobe's 1 MB request limit. A single large message may also exceed the threshold. * It does not guarantee global event ordering or final AEP ingestion ordering. Tasks and partitions may be processed in parallel. ## FAQ ### Why Is There Still No Data in the Dataset When the Task Shows RUNNING? Startup status is not an inlet connectivity check, and HTTP acceptance does not mean Dataset ingestion. Verify that the inlet address, Dataflow status, and the message's `flowId` and `datasetId` correspond to each other. Then check the target Schema, XDM field types, AEP streaming validation, and Dataset batch errors. Wait approximately five minutes after creating a Dataflow before sending data. Do not judge success solely by Offset advancement; use identifiable business events to verify final Dataset ingestion results. ### Why Does the Task Not Recover Automatically After a 401 or 403? Check whether the AEP inlet requires authentication, whether the Token is valid, and whether the identity integration has the required permissions. To enable Connector authentication, use the exact lowercase value `true` and supply the parameters required by the selected method. Do not rely on implicit selection of legacy JWT. OAuth2 caches and refreshes Tokens according to their expiration time, but a 401 does not automatically clear the cache, obtain a new Token, and resend the request. Resolve authorization issues before resuming the Task. First ensure that logs will not expose credentials during troubleshooting. ### Why Can Some Messages Still Fail When HTTP Returns Success? The 207 response to a batch request can contain per-message results; do not check only the HTTP status code. The Connector identifies an entry as failed when the `status` field exists and its value is not `null`, without requiring a non-empty string, and obtains the record index from the content after the last hyphen in `xactionId`. Adobe's public examples instead use `statusCode`, may separate success identifiers with colons, and may omit `xactionId` for failed items. This is a static contract difference between the examples and the plugin's parsing rules, not confirmation of an actual cloud failure. Before going live, verify the responses from the actual inlet. In particular, do not rely on the plugin to identify failed items containing only `statusCode`; it also does not automatically retry individual failed messages. Check results against AEP validation and Dataset status. If necessary, contact the maintainers to confirm response compatibility, and avoid exposing business data when obtaining responses. ### Why Does the DLQ Not Contain All Failed Messages? The DLQ covers only records passed to the framework's error reporting path, not all internal parsing drops or all remote response problems. Enabling error tolerance also does not resolve validation failures after AEP ingestion. Check the error tolerance policy and whether the input subscription excludes the DLQ. Confirm that the DLQ Topic exists, or that the permissions and replication factor requirements for automatic creation are met. Correlate Task logs with AEP results. Do not treat the absence of DLQ records as proof that all messages succeeded, or equate record reporting with completed synchronous persistence. ### Why Do Duplicates Appear After Recovery or Restart? AEP may already have accepted a request when the connection is interrupted or before the Kafka Offset is committed. Subsequent HTTP retries or resumed consumption can resend it. The Connector does not deduplicate automatically. Identify duplicates using business event identifiers, and separately design and confirm deduplication rules in the target data processing pipeline. Do not assume that the XDM `_id` field alone gives this Connector exactly-once semantics. # Amazon EventBridge Sink Connector Source: https://docs.automq.com/automq-cloud/kafka-connect/sink-connectors/amazon-eventbridge-sink-connector Configure and operate the Amazon EventBridge Sink Connector in AutoMQ Connect, including event mapping, AWS permissions, S3 offloading, monitoring, and troubleshooting. ## Overview The Amazon EventBridge Sink Connector sends records from one or more Kafka topics to a specified Amazon EventBridge event bus. Each Kafka record is converted into an EventBridge event. The Kafka topic, partition, offset, timestamp, header, key, and value are stored in the event's `detail`, and the event's `source` is generated from the Connector identifier. It is suitable for connecting business events, CDC records, or application messages in Kafka to EventBridge, where EventBridge rules can route them to downstream AWS services or other targets. By default, the event `detail-type` is generated from the Topic, and the event time is set by EventBridge when the event is received. You can customize `detail-type` by Topic or message content, and you can also offload a specified part of the event Value to S3 while retaining reference information in the EventBridge event. ## Prerequisites * The target EventBridge event bus has been created, and the AWS identity used by the Connector has `events:PutEvents` permission for that event bus. If you enable an IAM role, profile, or custom credentials provider, also prepare the corresponding trust relationship and credential source. * If S3 offloading is enabled, the target S3 Bucket has been created, and the AWS identity used by the Connector has `s3:PutObject` permission for that Bucket. * If you use Avro, Protobuf, AWS Glue Schema Registry, or a custom Converter, place the related Converter classes and dependencies in a plugin path loadable by the Kafka Connect Worker, and prepare the permissions required to read the Schema. * If you configure a custom detail-type, time, or credentials provider class, place the related classes and dependencies in the Kafka Connect Worker's plugin path, and satisfy the corresponding interface and no-argument constructor requirements. ## License Uses Apache License 2.0. ## Quick Start Prepare the Connect cluster, Kafka, input topic, and target EventBridge event bus in advance, and confirm network connectivity and access permissions. For creation and management operations, see [Manage Connectors](../manage-connectors). The following configuration uses a schema-free JSON value to send records to the specified event bus. ```properties theme={null} connector.class=software.amazon.event.kafkaconnector.EventBridgeSinkConnector topics= aws.eventbridge.connector.id=eventbridge-sink aws.eventbridge.eventbus.arn=arn:aws:events:us-east-1::event-bus/ aws.eventbridge.region=us-east-1 key.converter=org.apache.kafka.connect.storage.StringConverter value.converter=org.apache.kafka.connect.json.JsonConverter value.converter.schemas.enable=false ``` Replace the topic, AWS account, event bus name, and AWS identity settings before applying the configuration. The event `detail-type` defaults to `kafka-connect-`, and `detail` contains Kafka record metadata and the decoded key and value. `value.converter.schemas.enable=false` applies to JSON values without a schema envelope. For other message formats, use the corresponding converter and its dependencies. ## Configuration ### Input and Tasks #### `topics` Specifies the list of Kafka topics consumed by the Sink Connector. * **Type**: `list` * **Default**: Empty list `[]` * **Importance**: High * **Valid values / notes**: Use comma-separated Topic names. Configure exactly one of `topics` and `topics.regex`; at least one must be non-empty. #### `topics.regex` Uses a regular expression to select the Kafka topics consumed by the Sink Connector. * **Type**: `string` * **Default**: Empty string `""` * **Importance**: High * **Valid values / notes**: Use a Java regular expression. This setting is mutually exclusive with `topics`; they cannot be configured together. #### `tasks.max` Requests the maximum number of Tasks to create for this Connector. * **Type**: `int` * **Default**: `1` * **Importance**: High * **Valid values / notes**: Must be at least `1`. Actual parallelism is also limited by Kafka partitions, Worker resources, and EventBridge throughput. No global ordering guarantee is provided across Tasks, Topics, or partitions. ### EventBridge Connection and Target #### `aws.eventbridge.connector.id` The unique identifier of the Connector, used to generate the EventBridge event `source` and as the IAM role session name. * **Type**: `string` * **Default**: No fixed default, required * **Importance**: High * **Valid values / notes**: Must not be empty or contain only spaces. There are no additional character or length restrictions. The event `source` has the form `kafka-connect.`. #### `aws.eventbridge.region` The AWS Region where the target EventBridge event bus is located. * **Type**: `string` * **Default**: No fixed default, required * **Importance**: High * **Valid values / notes**: Use a Region name supported by the AWS SDK, such as `us-east-1`. #### `aws.eventbridge.eventbus.arn` The ARN of the target EventBridge event bus. * **Type**: `string` * **Default**: No fixed default, required * **Importance**: High * **Valid values / notes**: Use the full ARN of the target event bus, such as `arn:aws:events:us-east-1:123456789012:event-bus/orders`. #### `aws.eventbridge.endpoint.uri` Overrides the EventBridge service endpoint used by the default AWS SDK. * **Type**: `string` * **Default**: Empty string `""` * **Importance**: Medium * **Valid values / notes**: Leave empty to use the default AWS SDK endpoint. A non-empty value must be a parseable URI; an invalid URI may cause the Task to fail to start. #### `aws.eventbridge.eventbus.global.endpoint.id` Specifies the EventBridge global endpoint ID. * **Type**: `string` * **Default**: Empty string `""` * **Importance**: Medium * **Valid values / notes**: Leave empty to omit the global endpoint ID. A non-empty value uses a two-part format, such as `abcde.veo`. ### AWS Authentication #### `aws.eventbridge.auth.credentials_provider.class` Specifies a custom AWS credentials provider class. * **Type**: `string` * **Default**: Empty string `""` * **Importance**: Medium * **Valid values / notes**: Leave empty to use the default credentials provider. A non-empty class must implement `AwsCredentialsProvider` and have a no-argument constructor. If it implements `Configurable`, the Connector's original configuration is passed to the class. #### `aws.eventbridge.iam.role.arn` Specifies the IAM role ARN assumed through STS by the Connector. * **Type**: `string` * **Default**: Empty string `""` * **Importance**: Medium * **Valid values / notes**: Leave empty to disable this role. A non-empty value must use the IAM role ARN format, such as `arn:aws:iam::123456789012:role/EventBridgePutEventsRole`. When no custom credentials provider is configured, the Connector assumes this role through STS. #### `aws.eventbridge.iam.external.id` Provides an External ID for IAM role-based authentication. * **Type**: `string` * **Default**: Empty string `""` * **Importance**: Medium * **Valid values / notes**: Takes effect only when `aws.eventbridge.iam.role.arn` is used. The External ID is sensitive configuration; do not write it to logs, examples, or public repositories. #### `aws.eventbridge.iam.profile.name` Specifies the credentials Profile in the AWS shared configuration file. * **Type**: `string` * **Default**: Empty string `""` * **Importance**: Medium * **Valid values / notes**: Applies only to the default credentials provider path. When using this setting, do not also set `AWS_PROFILE`, `AWS_ACCESS_KEY_ID`, `AWS_SECRET_ACCESS_KEY`, or `AWS_SESSION_TOKEN`, as they can conflict with profile selection. ### Event Mapping #### `aws.eventbridge.detail.types` Sets the `detail-type` for EventBridge events, either by topic mapping or with one expression for all topics. * **Type**: `list` * **Default**: `[kafka-connect-${topic}]` * **Importance**: Medium * **Valid values / notes**: You can use a single expression, such as `orders-${topic}`, or a static value, such as `business-event`. For multiple values, use `topic:detail-type`, such as `orders:order-created,customers:customer-updated`. Topics without a match fall back to `kafka-connect-`. This setting no longer takes effect after a custom detail-type mapper is configured. #### `aws.eventbridge.detail.types.mapper.class` Specifies the class that calculates `detail-type` from the Topic or record content. * **Type**: `string` * **Default**: `software.amazon.event.kafkaconnector.mapping.DefaultDetailTypeMapper` * **Importance**: Medium * **Valid values / notes**: The class must implement `DetailTypeMapper` and have a no-argument constructor. When using the built-in `JsonPathDetailTypeMapper`, you must also configure `aws.eventbridge.detail.types.jsonpathmapper.fieldref`. After this class is configured, `aws.eventbridge.detail.types` is ignored. #### `aws.eventbridge.detail.types.jsonpathmapper.fieldref` Specifies the JSONPath from which `JsonPathDetailTypeMapper` extracts `detail-type` from the Kafka record Value. * **Type**: `string` * **Default**: Empty string `""` * **Importance**: Medium * **Valid values / notes**: Use a parseable and definite JSONPath, such as `$.metadata.event-type`. The extracted result must be a non-empty string. If the path does not exist, the result is empty or `null`, or the result is not a string, the mapper falls back to the record Topic. This setting is required only when using `JsonPathDetailTypeMapper`. #### `aws.eventbridge.time.mapper.class` Specifies the class that calculates the EventBridge `time` field for each event. * **Type**: `string` * **Default**: `software.amazon.event.kafkaconnector.mapping.DefaultTimeMapper` * **Importance**: Medium * **Valid values / notes**: The class must be loadable, implement `TimeMapper`, and have a no-argument constructor. The default value does not provide a custom time; EventBridge sets the time when the `PutEvents` call is made. #### `aws.eventbridge.eventbus.resources` Adds a `resources` list to each EventBridge event. * **Type**: `list` * **Default**: Empty list `[]` * **Importance**: Medium * **Valid values / notes**: Use comma-separated resource values. EventBridge validates the resource format. ### S3 Payload Offloading #### `aws.eventbridge.offloading.default.s3.bucket` Specifies the S3 Bucket used to offload event payloads. * **Type**: `string` * **Default**: Empty string `""` * **Importance**: Medium * **Valid values / notes**: Leave empty to disable offloading. A non-empty value enables claim-check processing, and the Bucket must already exist and allow the current AWS identity to write objects. #### `aws.eventbridge.offloading.default.fieldref` Specifies the JSONPath that selects the part of the event `detail` to offload to S3. * **Type**: `string` * **Default**: `$.detail.value` * **Importance**: Medium * **Valid values / notes**: Takes effect only when an S3 Bucket is configured. The path must be a definite JSONPath beginning with `$.detail.value`; array or wildcard paths are not supported. If no value matches or the value is `null`, the original event is passed through. Empty objects and empty arrays are offloaded. #### `aws.eventbridge.offloading.default.s3.endpoint.uri` Overrides the service endpoint used for S3 offloading. * **Type**: `string` * **Default**: Empty string `""` * **Importance**: Medium * **Valid values / notes**: Used only when S3 offloading is enabled. Leave empty to use the default AWS SDK S3 endpoint. A non-empty value must be a parseable URI. ### Delivery and Error Handling #### `aws.eventbridge.retries.max` Sets the maximum number of Connector-level retries when EventBridge delivery fails. * **Type**: `int` * **Default**: `2` * **Importance**: Medium * **Valid values / notes**: The range is `0` to `10`; `0` means no Connector-level retries. This value is also used by the AWS SDK client, so the actual number of requests may be higher than the Connector-level setting. #### `aws.eventbridge.retries.delay` Sets the wait time between two Connector retries, in milliseconds. * **Type**: `int` * **Default**: `200` * **Importance**: Medium * **Valid values / notes**: The Connector does not reject negative values. Use a non-negative integer because a negative value does not produce an effective wait. This setting does not change whether an error is retryable. #### `errors.tolerance` Sets Kafka Connect's tolerance mode for conversion, converter, and task errors. * **Type**: `string` * **Default**: `none` * **Importance**: Medium * **Valid values / notes**: Valid values are `none` and `all`. `all` should generally be used together with DLQ configuration. It is different from the EventBridge delivery retries controlled by `aws.eventbridge.retries.max`. #### `errors.deadletterqueue.topic.name` Specifies the DLQ Topic that receives failed records handled by the Kafka Connect error reporter. * **Type**: `string` * **Default**: Empty string `""` * **Importance**: Medium * **Valid values / notes**: Leave empty to omit DLQ configuration. After it is configured, the Connector can report record-level non-retryable failures to this Topic. Topic creation and permissions are managed by Kafka Connect and the Kafka cluster. #### `errors.deadletterqueue.topic.replication.factor` Sets the replication factor used when Kafka Connect creates the DLQ Topic. * **Type**: `short` * **Default**: `3` * **Importance**: Medium * **Valid values / notes**: Takes effect only when `errors.deadletterqueue.topic.name` is configured. The value must match the number of Brokers available in the Kafka cluster and the Topic creation policy. ### Message Conversion #### `key.converter` Specifies the Converter that decodes the Kafka message Key into a Kafka Connect value. * **Type**: `class` * **Default**: `null` * **Importance**: Low * **Valid values / notes**: If unset, the Worker's Converter configuration is used. When explicitly set, it must be an instantiable Converter class. The decoded Key is written to `detail.key` in the EventBridge event. #### `value.converter` Specifies the Converter that decodes the Kafka message Value into a Kafka Connect value. * **Type**: `class` * **Default**: `null` * **Importance**: Low * **Valid values / notes**: If unset, the Worker's Converter configuration is used. When explicitly set, it must be an instantiable Converter class. Avro, Protobuf, and Schema Registry dependencies are provided by the Worker environment. Records that fail to decode are not included in an EventBridge send batch. ## Best Practices ### Map Multiple Topics to Routable Event Types **Applicable scenario**: Multiple business Topics need to enter the same EventBridge event bus, and stable `detail-type` values are needed to distinguish order, customer, and other event types so that rules do not have to rely only on Topic names. **Configuration example**: Add the following settings to the Quick Start configuration while retaining the existing event bus and identity settings. ```properties theme={null} topics=orders,customers aws.eventbridge.detail.types=orders:order-created,customers:customer-updated ``` **Key points**: Each Topic uses its corresponding `detail-type`, and a Topic without a match falls back to the default value. Multiple mappings must use the `topic:detail-type` format. If you switch to a custom mapper, remove or ignore `aws.eventbridge.detail.types` to avoid assuming that the two mapping methods are combined. ### Offload Large Payloads to S3 **Applicable scenario**: Kafka records contain relatively large business Values, while EventBridge events need to retain filterable metadata and downstream consumers need to read the complete payload on demand. **Configuration example**: Add the following settings to the Quick Start configuration, using an existing S3 resource that permits writes for the Bucket. ```properties theme={null} aws.eventbridge.offloading.default.s3.bucket= aws.eventbridge.offloading.default.fieldref=$.detail.value ``` **Key points**: The matched value is written to S3. Its original location is removed from the EventBridge event, which receives `dataref` and `datarefJsonPath` reference information. The target AWS identity must have permission to call `s3:PutObject`. The path can only begin with `$.detail.value`; a missing match or a `null` value is not offloaded. S3 offloading does not replace downstream management of object lifecycle, access permissions, and cleanup policies. ### Configure Delivery Retries and Send Unrecoverable Records to a DLQ **Applicable scenario**: Temporary EventBridge or network failures need automatic retries, while conversion failures or non-retryable records must not block subsequent messages and should be retained for investigation and compensation. **Configuration example**: Add the following settings to the Quick Start configuration, and configure separate consumption and retention policies for the DLQ Topic. ```properties theme={null} aws.eventbridge.retries.max=3 aws.eventbridge.retries.delay=1000 errors.tolerance=all errors.deadletterqueue.topic.name= errors.deadletterqueue.topic.replication.factor=3 ``` **Key points**: `aws.eventbridge.retries.max` controls Connector-level delivery retries, while the DLQ is handled by the Kafka Connect error reporter. They address different problems. The AWS SDK also uses this retry value, so the actual number of calls may exceed the direct estimate from the Connector-level setting. Before going live, establish alerting, retention, and replay procedures for the DLQ. Do not treat `errors.tolerance=all` as a guarantee of successful delivery. ## Monitoring ### What to Monitor Monitor whether the Kafka Connect worker, Connector, and task are in the expected state, as well as task record throughput, processing latency, consumer lag, offset commits, failed records, retry counts, and error logs. Also monitor worker JVM heap memory, GC, threads, and CPU. After enabling `errors.tolerance=all` and a DLQ, monitor writes to and backlog in the DLQ topic, and correlate DLQ growth with EventBridge, converter, or permission errors. ### Import the Grafana Dashboard Download the [Kafka Connect Grafana dashboard](https://automq-download-center.oss-cn-hangzhou.aliyuncs.com/connect-dashboard/automq-connect-cluster-dashboard.json), import the JSON into Grafana, and select the data source that collects Kafka Connect metrics. After importing, confirm that the data source name and labels match the metric collection configuration of the current Connect cluster. ## Limitations * A single EventBridge `PutEvents` request can contain at most 10 events, and the event size limit is 256 KiB. A single event that exceeds the limit is not resolved by the Connector-level retry mechanism; S3 offloading or a DLQ should generally be used. * The Connector provides at-least-once delivery semantics for valid Kafka records. If a failure occurs after EventBridge succeeds but before Kafka Connect commits the Offset, the record may be sent again. This cannot be used to claim exactly-once delivery or idempotency on the target side. * S3 offloading supports only definite JSONPath under `$.detail.value`. It does not support the Key, Header, or top-level EventBridge fields, nor array or wildcard paths. * After `aws.eventbridge.detail.types.mapper.class` is configured, `aws.eventbridge.detail.types` does not participate in mapping. The two settings do not take effect in combination. ## FAQ ### The Task reports that the event bus ARN, Region, or Connector identifier is invalid at startup Check whether `aws.eventbridge.connector.id` is empty, whether `aws.eventbridge.region` is an AWS SDK-supported Region name, and whether `aws.eventbridge.eventbus.arn` is a complete event bus ARN. After correcting the values, validate the Connector configuration again and confirm that the Region represented by the ARN matches `aws.eventbridge.region`. ### EventBridge returns a permission error and the record is not delivered Confirm the AWS identity source actually used by the Connector. When using an IAM role, check the trust relationship, role ARN, and External ID. When using a profile, confirm that the worker can read the corresponding AWS configuration file, and remove AWS credential environment variables that override profile selection. The target identity must be allowed to call `events:PutEvents` on the target event bus. ### `detail-type` does not use the event type in the message With the default mapping, `detail-type` comes from the Topic or `aws.eventbridge.detail.types`; it does not automatically read a field from the Value. To extract the event type from a JSON Value, set `aws.eventbridge.detail.types.mapper.class` to `software.amazon.event.kafkaconnector.mapping.JsonPathDetailTypeMapper` and configure a definite `aws.eventbridge.detail.types.jsonpathmapper.fieldref`. The extracted result must be a non-empty string; otherwise, the mapper falls back to the Topic. ### Large messages still cannot be sent to EventBridge Confirm that `aws.eventbridge.offloading.default.s3.bucket` is non-empty, that `aws.eventbridge.offloading.default.fieldref` begins with `$.detail.value` and actually matches a field in the Value, and that the AWS identity has S3 `PutObject` permission. If the event has no matching value or the value is `null`, the Connector passes through the original event and does not generate an S3 reference. ### Failed records do not appear in the DLQ Confirm that both `errors.tolerance=all` and `errors.deadletterqueue.topic.name` are configured, and check DLQ Topic creation, write permissions, and replication factor. EventBridge-retryable errors are retried first according to `aws.eventbridge.retries.max`. Not every error is classified as a reportable record-level failure; use Task logs to determine whether the cause is exhausted retries, a conversion failure, or a Task-level error. # Apache Iceberg Sink Connector Source: https://docs.automq.com/automq-cloud/kafka-connect/sink-connectors/apache-iceberg-sink-connector Configure and operate the Apache Iceberg Sink Connector in AutoMQ Connect, including table routing, catalogs, schema evolution, commit coordination, and recovery. ## Overview Apache Iceberg Sink Connector continuously writes business records from Kafka topics to Iceberg tables, connecting real-time event streams with historical queries, offline analytics, and audit workflows in a data lake. Record values map to table fields, and written data files become visible to queries after they are committed through table snapshots; Kafka record keys do not automatically become table columns. A connector can write to one table, multiple fixed tables, or target tables selected by a record field. Without a routing field, each record is written to all fixed target tables; with routing configured, different categories of business events can be stored separately. It also supports automatic table creation and supported schema evolution, making it suitable for continuously appended order events, activity logs, and change histories. The built-in write path uses append semantics and does not automatically merge current state by business primary key. The connector uses Kafka transactions, a control topic, and Iceberg snapshot checkpoints to coordinate writes and recovery, providing exactly-once recovery semantics subject to prerequisites. These semantics require a compatible transaction protocol and Connect runtime, alignment with the actual data consumer group, a catalog that supports atomic snapshot commits, and retention of the control events, consumer group offsets, data files, and snapshot history needed for recovery. They do not imply business-key deduplication or provide atomic commits across multiple tables. ## Prerequisites * Prepare an available Iceberg catalog, along with the client dependencies, authentication, and storage permissions required by the selected catalog and FileIO. * Automatic table creation is disabled by default. Pre-create the target tables that will receive records, and ensure that record fields are compatible with the target table schemas; a missing target actually selected by static routing causes the task to fail, whereas dynamic routing skips writes to missing tables. * When automatic table creation is enabled, the catalog must permit table creation, the target namespace must be available or its creation permitted, and the first record must allow a nonempty table schema to be inferred. * Prepare the control topic or allow broker-side automatic creation; internal clients must have the permissions required for control topic reads and writes, transactional IDs, and related consumer group operations. * Internal Kafka clients must connect to the Kafka cluster hosting the data consumer group so that control events and input offsets can be committed in the same Kafka transaction. * Kafka must support the transaction protocol that includes consumer group metadata, and the Connect runtime must be compatible with the way the connector obtains the underlying consumer. ## License Uses Apache License 2.0. ## Quick Start Prepare a Connect cluster, Kafka, an Iceberg REST catalog, and a target table in advance. Confirm network connectivity and access permissions for the catalog, storage, and control topic. For cluster and connector management, see [Manage Connectors](../manage-connectors). The following configuration appends JSON objects without schema envelopes to an existing table. ```properties theme={null} connector.class=org.apache.iceberg.connect.IcebergSinkConnector topics= value.converter=org.apache.kafka.connect.json.JsonConverter value.converter.schemas.enable=false iceberg.tables= iceberg.catalog.type=rest iceberg.catalog.uri= iceberg.kafka.bootstrap.servers= ``` Replace the input topic, fully qualified table name, REST catalog URI, and Kafka addresses. This example uses the default control topic `control-iceberg`, which must be available beforehand. Add REST catalog and storage access settings under `iceberg.catalog.*` as required by your deployment, and add the security properties required by internal Kafka clients under `iceberg.kafka.*`. Do not expose long-lived credentials in the configuration. Input values must be JSON objects compatible with the existing table fields; this example is not suitable for directly reading Debezium envelopes to maintain current state. By default, a table commit is initiated every 5 minutes. Consumer offsets may advance before table snapshots do, so a decrease in consumer lag does not mean that all data is already visible to queries. ## Configuration The following settings apply to append writes. Registered configuration defaults and runtime fallbacks are described separately. Dynamic properties do not have individually registered, uniform defaults or importance levels; validation is performed by the reading logic or the corresponding component. In per-table properties, `` is the fully qualified target table name, including its namespace. For prefixed properties, N/A in the default and importance fields means these are not individually defined; it does not mean every delegated property lacks a default. Specific defaults and constraints are determined by the corresponding component. Per-table properties retain their actual read-time fallbacks. ### Input and Tasks #### `connector.class` Selects the connector implementation class. * **Type**: `string` * **Default**: None * **Importance**: High * **Required**: Yes * **Valid Values / Notes**: Use `org.apache.iceberg.connect.IcebergSinkConnector`. #### `tasks.max` Sets the maximum number of tasks. * **Type**: `int` * **Default**: `1` * **Importance**: High * **Valid Values / Notes**: At least `1`. Effective parallelism is limited by input partition assignment; tasks are not assigned one per table, and global ordering across partitions is not guaranteed. #### `topics` Specifies the list of input Kafka topics. * **Type**: `list` * **Default**: Empty list `[]` * **Importance**: High * **Valid Values / Notes**: Comma-separated; choose either this setting or a nonempty `topics.regex`. This is not a target table list or the control topic. #### `topics.regex` Subscribes to input topics using a regular expression. * **Type**: `string` * **Default**: Empty string * **Importance**: High * **Valid Values / Notes**: A valid Java regular expression; choose either this setting or nonempty `topics`. #### `key.converter` Converts Kafka message keys to Connect data. * **Type**: `class` * **Default**: `null` * **Importance**: Low * **Valid Values / Notes**: Inherits the worker converter when unset; an explicitly specified class must implement `Converter`. Message keys are not automatically written to table fields. #### `value.converter` Converts Kafka message values to Connect data. * **Type**: `class` * **Default**: `null` * **Importance**: Low * **Valid Values / Notes**: Inherits the worker converter when unset; there is no uniform JSON default. After conversion and SMT processing, a non-null top-level value must be a `Struct` or `Map`. Converter subproperties must match the actual input encoding. #### `consumer.override.*` Overrides properties of the Connect task's data consumer. This property set has no uniform default; individual property types and defaults are determined by the Kafka Consumer. * **Type**: Pass-through `Kafka Consumer` properties * **Default**: N/A * **Importance**: N/A * **Valid Values / Notes**: Must be permitted by the worker's client override policy. Settings take precedence in this order, from lowest to highest: Connect base values, worker `consumer.*`, and connector `consumer.override.*`. When overriding `group.id`, also update `iceberg.connect.group-id` to match. These properties do not configure internal control clients. `auto.offset.reset` only affects cases with no valid offset and cannot be used as a lossless recovery mechanism. ### Catalog and Storage #### `iceberg.catalog` Sets the catalog instance name, not its implementation type. * **Type**: `string` * **Default**: `iceberg` * **Importance**: Medium * **Valid Values / Notes**: A nonempty set of `iceberg.catalog.*` properties is required even when using the default name. #### `iceberg.catalog.*` Passes properties, with the prefix removed, to the Iceberg catalog, including implementation selection, service addresses, authentication, and FileIO configuration. This property set has no uniform default; specific defaults are determined by the catalog and FileIO. * **Type**: Pass-through `string` properties * **Default**: N/A * **Importance**: N/A * **Required**: Yes * **Valid Values / Notes**: `type` and `catalog-impl` are mutually exclusive. `type` is case-insensitive and accepts `hive`, `hadoop`, `rest`, `glue`, `nessie`, or `jdbc`; actual availability depends on installed implementations and client dependencies. When neither is set, the underlying implementation falls back to Hive, but this is not a declaration of the connector's default type. Whether `uri`, `warehouse`, `io-impl`, and other properties are required depends on the selected implementation. #### `iceberg.hadoop-conf-dir` Specifies the Hadoop XML configuration directory. * **Type**: `string` * **Default**: `null` * **Importance**: Medium * **Valid Values / Notes**: The directory must be accessible to the worker. It reads `core-site.xml`, `hdfs-site.xml`, and `hive-site.xml` from this directory and requires available Hadoop classes. `iceberg.hadoop.*` overrides corresponding properties after the XML files are loaded. #### `iceberg.hadoop.*` Sets properties, with the prefix removed, in the Hadoop Configuration. This property set has no uniform default; specific defaults are determined by Hadoop. * **Type**: Pass-through `string` properties * **Default**: N/A * **Importance**: N/A * **Valid Values / Notes**: Requires Hadoop classes. This is not a prefix for Kafka client or catalog properties. ### Target Tables and Routing #### `iceberg.tables` Sets the static target table list. * **Type**: `list` * **Default**: `null` * **Importance**: High * **Valid Values / Notes**: Required in static mode; use comma-separated, fully qualified table names. Mutually exclusive with `iceberg.tables.dynamic-enabled=true`. An empty list provides no write targets. Without a routing field, each record is written to all static target tables. #### `iceberg.tables.dynamic-enabled` Enables dynamic routing that selects a target table from a record field. * **Type**: `boolean` * **Default**: `false` * **Importance**: Medium * **Valid Values / Notes**: When `true`, remove `iceberg.tables` and set `iceberg.tables.route-field`. The routing value is converted to lowercase and used as the fully qualified table name; per-table routing regular expressions are not used. Null values are skipped, and invalid table identifiers may cause failure. #### `iceberg.tables.route-field` Specifies the routing field in the record value. * **Type**: `string` * **Default**: `null` * **Importance**: Medium * **Valid Values / Notes**: Required in dynamic mode; supports dot-separated paths through nested `Struct` or `Map` fields. In static mode, the field value is matched independently against each table's `route-regex`. If the field is missing or null, no table receives the record. #### `iceberg.table..route-regex` Sets the routing match condition for a single static table. * **Type**: `string` * **Default**: Not registered; falls back to `null` when read * **Importance**: N/A * **Valid Values / Notes**: When a routing field is configured in static mode, provide a regular expression for each table that should receive data. Java regular expressions match the entire string; overlapping expressions write the record to multiple tables. Tables without a matching expression do not receive records. This setting is ignored in dynamic mode. ### Automatic Table Creation and Schema #### `iceberg.tables.auto-create-enabled` Allows missing target tables to be created. * **Type**: `boolean` * **Default**: `false` * **Importance**: Medium * **Valid Values / Notes**: Infers the table schema from the first record's schema or value and requires table creation permissions. An empty object cannot be used to infer a schema. When disabled, a missing target actually selected by static routing throws `NoSuchTableException` and puts the task in the `FAILED` state; only dynamic routing skips writes for this missing-table exception. Dynamic missing-table skips do not apply to invalid table identifiers, permission errors, or other catalog exceptions. #### `iceberg.tables.evolve-schema-enabled` Allows supported table schema updates. * **Type**: `boolean` * **Default**: `false` * **Importance**: Medium * **Valid Values / Notes**: Can add new fields whose types can be inferred. A `Struct` with a schema also supports promotion from `int` to `long` and from `float` to `double`, and relaxation of required fields to optional. Schemaless data does not have the same promotion path for existing fields. When disabled, extra fields are ignored. Arbitrary renaming, column deletion, or type migration is not supported. #### `iceberg.tables.schema-force-optional` Makes created or evolved fields optional. * **Type**: `boolean` * **Default**: `false` * **Importance**: Medium * **Valid Values / Notes**: Also applies to container value types that are created or evolved; it does not rewrite the optionality of all fields in an existing table. By default, input schema optionality is respected. #### `iceberg.tables.schema-case-insensitive` Controls whether table field lookup is case-insensitive. * **Type**: `boolean` * **Default**: `false` * **Importance**: Medium * **Valid Values / Notes**: Does not rename fields. When the table has a name mapping, the mapping-based lookup path is used; this switch does not unconditionally override the mapping. #### `iceberg.tables.default-partition-by` Sets the default partition rules for automatic table creation. * **Type**: `string` * **Default**: `null` * **Importance**: Medium * **Valid Values / Notes**: Applies only to newly created tables and does not change existing table partitioning. Supports fields themselves and the `year`, `month`, `day`, `hour`, `bucket`, and `truncate` transforms. Separate multiple rules with commas; commas inside transform parentheses are preserved. For `bucket` and `truncate`, the argument order is column name, then width. Parsing or construction exceptions are logged as errors, and creation falls back to an unpartitioned table; configuration alone does not establish that partitioning took effect. #### `iceberg.table..partition-by` Overrides automatic table creation partition rules for a single table. * **Type**: `string` * **Default**: Not registered; falls back to `iceberg.tables.default-partition-by` when read * **Importance**: N/A * **Valid Values / Notes**: Used only for automatic table creation. An explicit empty string creates an unpartitioned table. Syntax and exception fallback behavior are the same as for the global partition rules. #### `iceberg.tables.auto-create-props.*` Provides Iceberg table properties for automatically created tables. This property set has no uniform default; specific defaults are determined by the Iceberg table and catalog. * **Type**: Pass-through `Iceberg` table properties * **Default**: N/A * **Importance**: N/A * **Valid Values / Notes**: Passed to the table creation operation with the prefix removed; does not update existing table properties. #### `iceberg.tables.write-props.*` Overrides Iceberg table properties used when initializing writers, such as file format and target file size. This property set has no uniform default; specific defaults are determined by Iceberg table properties. * **Type**: Pass-through `Iceberg` table properties * **Default**: N/A * **Importance**: N/A * **Valid Values / Notes**: Overrides writer-local properties without persistently modifying table properties. The target file size is not guaranteed to be reached on every commit. ### Identifier Columns and Commit Branches #### `iceberg.tables.default-id-columns` Sets the default identifier column list. * **Type**: `string` * **Default**: `null` * **Importance**: Medium * **Valid Values / Notes**: Comma-separated, with surrounding whitespace trimmed; columns must exist. When unset or empty, it does not override identifier fields in the table schema. This is not a primary-key uniqueness constraint and does not enable upsert or delete existing rows. #### `iceberg.table..id-columns` Overrides the identifier column list for a single table. * **Type**: `string` * **Default**: Not registered; falls back to `iceberg.tables.default-id-columns` when read * **Importance**: N/A * **Valid Values / Notes**: An explicit empty string suppresses the global list override and preserves the table schema's identifier fields. Other constraints are the same as for the global setting; append semantics do not change. #### `iceberg.tables.default-commit-branch` Sets the default branch for table snapshot commits. * **Type**: `string` * **Default**: `null` * **Importance**: Medium * **Valid Values / Notes**: Commits to `main` when unset. The branch need not exist beforehand; the underlying snapshot commit allows a new branch to be created. An existing reference with the same name must be a branch, not a tag. Per-table configuration takes precedence. #### `iceberg.table..commit-branch` Overrides the commit branch for a single table. * **Type**: `string` * **Default**: Not registered; falls back to `iceberg.tables.default-commit-branch` when read * **Importance**: N/A * **Valid Values / Notes**: Uses `main` if the effective setting remains unset. Constraints on new branches and tags are the same as for the global setting. Data written to other branches does not automatically appear in queries against `main`. ### Control Channel and Commits #### `iceberg.control.topic` Specifies the control topic that carries written-file references and commit coordination events. * **Type**: `string` * **Default**: `control-iceberg` * **Importance**: Medium * **Valid Values / Notes**: Not the input data topic; the connector does not explicitly issue a topic creation request. Retention must cover events needed for unfinished commits and recovery, rather than being set solely according to the normal commit interval. #### `iceberg.control.group-id-prefix` Sets the internal control consumer group prefix. * **Type**: `string` * **Default**: `cg-control-` * **Importance**: Low * **Valid Values / Notes**: The default includes the trailing hyphen. This group differs from the Connect data consumer group, and recovery depends on retaining control consumer group offsets. #### `iceberg.control.commit.interval-ms` Sets the interval for initiating table commits, in milliseconds. * **Type**: `int` * **Default**: `300000` * **Importance**: Medium * **Valid Values / Notes**: Use a positive value. The interval affects query visibility and file closing frequency but is not an upper bound on end-to-end latency. The configuration definition does not validate a range or the relationship between this value and the timeout. #### `iceberg.control.commit.timeout-ms` Sets the timeout for the coordinator to wait for responses from writing tasks, in milliseconds. * **Type**: `int` * **Default**: `30000` * **Importance**: Medium * **Valid Values / Notes**: Use a positive value. On timeout, the coordinator may commit the partial set of responses already received. A timeout does not necessarily mean task failure, nor is it an upper bound on the total duration of all catalog commit operations. #### `iceberg.control.commit.threads` Sets the number of threads used by the coordinator to commit target tables in parallel. * **Type**: `int` * **Default**: `Runtime.getRuntime().availableProcessors() * 2` * **Importance**: Medium * **Valid Values / Notes**: The default expression is evaluated when the configuration definition is initialized and uses twice the number of processors visible to the worker JVM. The thread pool requires a positive value. Multiple tables are committed separately, without a cross-table transaction. #### `iceberg.kafka.*` Configures internal control Producer, Consumer, and Admin clients. This property set has no uniform default; it attempts to read worker properties, then overrides them with properties under this prefix. Individual property types are determined by the corresponding Kafka client. * **Type**: Pass-through `Kafka` client properties * **Default**: N/A * **Importance**: N/A * **Valid Values / Notes**: Automatic reading depends on the standard Connect startup entry point and readable worker properties containing `bootstrap.servers`; do not assume it works in every deployment. Explicitly set broker addresses and security properties when necessary. Worker `consumer.*` and `producer.*` properties are not automatically stripped of their prefixes. The internal Producer enforces the generated transactional ID and serializers; the internal Consumer enforces its group ID, disables automatic commits, uses `read_committed` and fixed deserializers, and falls back to `latest` for `auto.offset.reset` when not explicitly set. These properties do not override the task's data consumer. ### Advanced Identity Configuration #### `iceberg.connect.group-id` Informs the coordinator of the actual Connect data consumer group. * **Type**: `string` * **Default**: `null` * **Importance**: Low * **Valid Values / Notes**: Falls back to `connect-` when read if unset. This setting does not change the task's consumer group. If the actual data group is changed through `consumer.override.group.id`, both must match; otherwise, coordinator election and commits may not complete correctly. #### `iceberg.coordinator.transactional.prefix` Sets the prefix used when generating transactional IDs. * **Type**: `string` * **Default**: `null` * **Importance**: Low * **Valid Values / Notes**: Falls back to an empty string when read. This is not a complete transactional ID; `iceberg.kafka.transactional.id` cannot replace the transactional ID generated by the connector. ## Best Practices ### Write Known Event Categories to Separate Tables Business scenario: A single event stream contains order and payment events, and analysts need to query the two histories separately rather than have every table receive all events. Prepare `analytics.orders` and `analytics.payments` in advance, each with fields for its corresponding events. Configuration example: Override the target tables in the Quick Start configuration and add the following routing settings; retain the other catalog, converter, and Kafka settings. Use `order` or `payment` for `event_type` in input values. ```properties theme={null} iceberg.tables=analytics.orders,analytics.payments iceberg.tables.route-field=event_type iceberg.table.analytics.orders.route-regex=order iceberg.table.analytics.payments.route-regex=payment ``` Key considerations: Both expressions match the entire string, so each record with a valid category is written only to the corresponding table. This does not automatically map topics to table names. Records with a missing, null, or unmatched category are not written to any table, but consumer offsets may still advance; the input side must define category conventions and how to handle unmatched data. If expressions overlap, the same record is written to multiple tables, and their snapshots are not guaranteed to become visible simultaneously. ### Automatically Create Tables for New Event Streams and Accept New Fields Business scenario: A new audit event stream has no target table yet. Records contain a stable business-date field, and fields needed for queries will be added over time. Allow the connector to create the table from the first event and extend its schema when new fields appear in subsequent events, avoiding manual table changes before each field addition. Configuration example: In the Quick Start configuration, replace the target table with the nonexistent `analytics.audit_events` and add automatic creation, evolution, and date-field partitioning settings. The `analytics` namespace must be available, or the catalog must permit its creation. ```properties theme={null} iceberg.tables=analytics.audit_events iceberg.tables.auto-create-enabled=true iceberg.tables.evolve-schema-enabled=true iceberg.tables.default-partition-by=event_date ``` On the input side, write JSON objects without schema envelopes to the topic specified in Quick Start. The first record contains a stable string date for partitioning, and the next adds an `actor` field, for example: ```json theme={null} {"event_id":"evt-1","event_date":"2026-09-17","action":"login"} {"event_id":"evt-2","event_date":"2026-09-17","action":"logout","actor":"user-1"} ``` Key considerations: This example partitions by the original value of `event_date`; it does not automatically interpret the string as a timestamp or generate a business date from write time. The input side must keep the date format consistent. The first record determines the initial schema, and a subsequent non-null string `actor` can be added as a new field; this does not imply support for arbitrary type changes. Partition rules apply only to newly created tables. Check the actual creation result, because invalid rules may fall back to an unpartitioned table. Enabling automatic creation does not recreate or repartition existing tables. ## Monitoring ### What to Monitor Monitor Kafka Connect cluster health, connector and task status, throughput, processing latency, consumer lag, offset commits, errors and retries, and worker JVM heap, GC, and thread signals. Monitor DLQ activity only when the corresponding framework error handling is enabled. Distinguish input offset advancement from target table query visibility; low lag does not directly indicate that all writes are complete. ### Import the Grafana Dashboard Download the [Kafka Connect Cluster Grafana Dashboard](https://automq-download-center.oss-cn-hangzhou.aliyuncs.com/connect-dashboard/automq-connect-cluster-dashboard.json). Confirm that monitoring collection is enabled and that the Prometheus-compatible data source, collected metrics, and labels match the dashboard queries, then import the JSON into Grafana and select the corresponding data source. ## Limitations * The built-in write path appends records; it does not perform primary-key-based upsert, enforce uniqueness, or apply CDC row-level deletes. Null tombstones do not delete existing rows. * The static target table list and dynamic routing mode are mutually exclusive. * Snapshots for multiple tables are committed independently, without cross-table atomicity or simultaneous visibility guarantees. * Schema evolution does not automatically rename fields, delete columns, narrow types, or perform arbitrary breaking changes. * Recovery depends on retaining control events, related consumer group offsets, referenced data files, and snapshot checkpoint history. Cleaning up these resources or resetting identities or offsets may invalidate the prerequisites for exactly-once recovery. * Fault tolerance and DLQ configuration for the Connect Converter and SMT stages cannot be generalized to a guarantee that every bad record in the Iceberg write path can be skipped or sent to a DLQ. ## FAQ ### Why Is Data Still Missing from the Table After Consumer Lag Decreases? Input offsets and file references are committed through Kafka transactions first; table snapshots are subsequently committed by the coordinator. First check whether the commit interval has elapsed and whether the target table and query branch are correct, then check for coordinator, catalog, or storage errors. The default commit interval is 5 minutes; slow responses or catalog commits can further affect visibility. Consumer offsets cannot substitute for table commit results. ### Why Are Some Records Missing from Tables Even Though the Task Has Not Failed? Check whether the routing field is missing or null, or fails to match the entire regular expression in static routing. Null tombstones are also not written to tables. In dynamic routing with automatic table creation disabled, writes are also skipped when the target table does not exist; this does not include invalid table identifiers, permission errors, or other catalog exceptions. These skips are not automatically sent to a DLQ, and their consumer offsets can be committed when a subsequent Kafka transaction succeeds. After correcting category data or match conditions, or creating the missing dynamic target table, a normal restart does not automatically recover skipped records whose offsets have already been committed. Determine the backfill scope and an idempotent processing strategy separately. In static routing with automatic table creation disabled, a missing target actually selected by routing puts the task in the `FAILED` state; it cannot be treated as a dynamic missing-table skip. Check the target table named in the exception and verify the namespace, schema, partitioning, and permissions. After creating target resources that can be loaded and are compatible with the input, keep the connector name, actual data consumer group, `iceberg.connect.group-id`, control topic, control consumer group and its offsets, target table and commit branch, and snapshot checkpoint identity unchanged, then restart the failed task to continue processing. First verify the persistent consumer offsets for the failed input; do not treat in-memory offset advancement as committed. After restart, check replay of the failed input, the final row set covering both failed and new input, snapshot checkpoints, and persistent offsets to confirm there are no omissions or duplicates. Retain the control events, referenced data files, and checkpoint history needed for recovery. Do not blindly switch groups or reset offsets, or treat this procedure as a guarantee of atomic multi-table recovery under arbitrary failures. ### Why Is the Table Not Partitioned as Expected After Enabling Automatic Creation? Partition configuration is used only when creating a missing table; existing tables are not repartitioned. For a new table, check whether the partition field's type can be inferred, whether transforms are compatible with the field type, and whether logs contain partition rule errors. Parsing or construction exceptions may result in an unpartitioned table. Act on the actual table structure; continued writes do not mean that partition configuration succeeded. ### Why Are There Multiple Rows for the Same Business Key After Setting Identifier Columns? Identifier columns do not enable uniqueness constraints or merge logic; the built-in path appends every non-null record. CDC envelope normalization only organizes change records and operation metadata; it does not automatically apply updates or deletes to existing rows. If you need a current-state table, implement merging through downstream query logic or a separate processing job. Exactly-once semantics also do not deduplicate business events that are already duplicated in the input. ### Why Do Commits Stall After Changing the Consumer Group? Check whether the task's actual data consumer group matches `iceberg.connect.group-id`. Without an override, the latter falls back to `connect-`; changing only `iceberg.connect.group-id` does not change the actual consumer. If `consumer.override.group.id` is configured, ensure that both match and that the worker permits the override. Consumer groups, the control topic, and control group offsets are part of the recovery identity; arbitrary changes or resets should not be treated as transparent restarts. ### Why Do Bad Records Still Fail the Task After Configuring a DLQ? First distinguish whether the exception comes from the Converter or SMT, or from Iceberg record conversion, file writes, or catalog operations. Framework fault tolerance and DLQ handling cover only the stages they manage; they cannot be promised to handle this connector's `SinkTask.put` write exceptions. Correct the input or target schema based on the full exception and safe topic, partition, and offset context. For storage, transaction, and catalog errors, also check the corresponding services and permissions. Avoid merely adding fault-tolerance settings and losing sight of the actual cause. ### Why Do Queries Against main Remain Unchanged After Committing to Another Branch? Check the effective global and per-table `commit-branch` values; per-table configuration takes precedence, and commits go to `main` only when the setting is unset. Queries must target the branch actually receiving writes. A new branch need not be created beforehand, but an existing reference with the same name cannot be a tag if it is to serve as a commit target. This setting does not automatically merge branch snapshots back into `main`. # ArangoDB Sink Connector Source: https://docs.automq.com/automq-cloud/kafka-connect/sink-connectors/arangodb-sink-connector Configure and operate the ArangoDB Sink Connector in AutoMQ Connect, including prerequisites, configuration, monitoring, and troubleshooting. ## Overview The ArangoDB Sink Connector consumes records from a Kafka topic and writes the records to a specified ArangoDB database. Each record is routed to an ArangoDB collection based on the Kafka topic name: if the topic name does not contain a period, the full name is used; if it contains a period, the suffix after the last period is used. For example, `dbserver1.inventory.customers` is written to the `customers` collection. The connector uses the first field of the Kafka record key as the ArangoDB document `_key`. A non-`null` object value inserts a new document or fully replaces the existing document with the same `_key`; in normal mode, a tombstone record with a `null` value deletes the document by `_key`. It is suitable for continuously synchronizing business objects, cache views, or change events to ArangoDB, but it does not provide field-level partial updates, relationship edge mapping, or transactions across Kafka and ArangoDB. ## Prerequisites * Use ArangoDB 3.4 or later, pre-create the target database, and pre-create a collection for each subscribed topic using the suffix after the topic's last period as the collection name. The connector does not create these resources automatically, and the account used must have document write and delete permissions for the target database and collections. ## License Uses the MIT License. ## Quick Start Prepare a Connect cluster, Kafka, the target ArangoDB database, and the `customers` collection in advance, and confirm network connectivity and access permissions. For specific preparation and management operations, see [Manage Connectors](../manage-connectors). ```properties theme={null} connector.class=io.github.jaredpetersen.kafkaconnectarangodb.sink.ArangoDbSinkConnector topics=customers arangodb.host= arangodb.port= arangodb.user= arangodb.password= arangodb.database.name= key.converter=org.apache.kafka.connect.json.JsonConverter key.converter.schemas.enable=false value.converter=org.apache.kafka.connect.json.JsonConverter value.converter.schemas.enable=false ``` Replace the ArangoDB address, port, username, password, and database placeholders. Write an object key such as `{"id":"customer-1001"}` and an object value such as `{"id":"customer-1001","name":"Alice","tier":"gold"}` to the `customers` topic. The connector uses the value of the first field in the key as `_key` and removes the `id` field with the same name from the written document's value. Sending a new object value with the same key later fully replaces the original document instead of updating only the fields that changed. Before deploying to production, also assess the risk that this version may expose the password when recording the original configuration. ## Configuration ### Connector Identity and Tasks #### `connector.class` The implementation class of the ArangoDB Sink Connector to load. * **Type**: `string` * **Default**: None * **Importance**: High * **Valid values / considerations**: Use `io.github.jaredpetersen.kafkaconnectarangodb.sink.ArangoDbSinkConnector`. Do not use the old class name in the installation package's quick start file. * **Required**: Yes #### `tasks.max` The maximum number of tasks that the connector requests to create. * **Type**: `int` * **Default**: `1` * **Importance**: High * **Valid values / considerations**: Must be at least `1`. Actual parallelism is limited by topic partition assignment; tasks do not have global ordering or conflict coordination for the same document key. ### Topic Subscription #### `topics` The list of Kafka topics to consume. * **Type**: `list` * **Default**: Empty list * **Importance**: High * **Valid values / considerations**: Use comma-separated literal topic names. Exactly one of `topics` and `topics.regex` must be configured with a non-empty value; the suffix after the last period of each topic must correspond to an existing ArangoDB collection. * **Required**: `conditional` (required when `topics.regex` is not configured) #### `topics.regex` The regular expression used to select Kafka topics. * **Type**: `string` * **Default**: `""` * **Importance**: High * **Valid values / considerations**: Use Java regular expression syntax. Exactly one of `topics` and `topics.regex` must be configured with a non-empty value; do not allow the expression to match the DLQ topic used for error handling. * **Required**: `conditional` (required when `topics` is not configured) ### ArangoDB Connection and Target #### `arangodb.host` The hostname or address of the ArangoDB server. * **Type**: `string` * **Default**: None * **Importance**: High * **Valid values / considerations**: Enter an ArangoDB hostname or address accessible to the Connect worker. This configuration has no non-empty or reachability validation. * **Required**: Yes #### `arangodb.port` The port of the ArangoDB server. * **Type**: `int` * **Default**: None * **Importance**: High * **Valid values / considerations**: Enter the actual listening port. The connector only checks whether the value can be parsed as an integer; it does not check for a positive value or a valid TCP port range. * **Required**: Yes #### `arangodb.database.name` The name of the ArangoDB database to which all records are written. * **Type**: `string` * **Default**: None * **Importance**: High * **Valid values / considerations**: The database must already exist, and all subscribed topics use this one database. Collection names are determined by topic suffixes and cannot be mapped in this configuration. * **Required**: Yes ### ArangoDB Authentication #### `arangodb.user` The username used to connect to ArangoDB. * **Type**: `string` * **Default**: None * **Importance**: High * **Valid values / considerations**: The account must have document write and delete permissions for the target database and collections. This configuration has no non-empty or authentication precheck. * **Required**: Yes #### `arangodb.password` The password used to connect to ArangoDB. * **Type**: `password` * **Default**: `""` * **Importance**: High * **Valid values / considerations**: An omitted value uses an empty string. Version 1.0.4 records the original configuration Map in INFO logs, which may expose the password provided here; restrict access to and retention of Worker logs, and use a fixed build or another assessed mitigation before deploying to production. ### Record Conversion #### `key.converter` The connector-level Kafka record key converter class. * **Type**: `class` * **Default**: `null` * **Importance**: Low * **Valid values / considerations**: When omitted, inherits the Worker's key converter. The converter must produce an object key with at least one field whose first value is not `null`; the connector uses only the value of the object's first field as the ArangoDB `_key` and does not support raw strings, numbers, byte arrays, or stable composite-key mappings. #### `value.converter` The connector-level Kafka record value converter class. * **Type**: `class` * **Default**: `null` * **Importance**: Low * **Valid values / considerations**: When omitted, inherits the Worker's value converter. After conversion, a non-`null` value must be an object; arrays and scalars cannot be written as ArangoDB documents. In normal mode, a converted `null` value indicates deletion. ## Best Practices ### Write to Multiple Collections by Topic Rules When Expanding an Integration Applicable business scenario: You have already created multiple collections for business objects in one ArangoDB database and want the same connector to subscribe to subsequent topics that follow a common naming rule. The following configuration matches topics with the `inventory.` prefix; each topic is still written to the collection corresponding to the name after its last period. ```properties theme={null} connector.class=io.github.jaredpetersen.kafkaconnectarangodb.sink.ArangoDbSinkConnector topics.regex=inventory\\..+ arangodb.host= arangodb.port= arangodb.user= arangodb.password= arangodb.database.name= key.converter=org.apache.kafka.connect.json.JsonConverter key.converter.schemas.enable=false value.converter=org.apache.kafka.connect.json.JsonConverter value.converter.schemas.enable=false ``` Key considerations: Remove `topics` from the quick start configuration because it is mutually exclusive with `topics.regex`. Before enabling the connector, create a same-named collection for the suffix of every topic that might match, such as `customers` and `orders` for `inventory.customers` and `inventory.orders`, respectively; also confirm that the expression does not accidentally subscribe to internal topics or DLQ topics. All matching topics are written to the same `arangodb.database.name`; different databases cannot be selected by topic. ### Handle Updates and Deletes Consistently When Ingesting CDC Events Applicable business scenario: An upstream CDC system emits objects with `before` and `after`, and you want to write `after` as the current complete document to ArangoDB and delete the corresponding document when `after=null`. The following configuration adds the connector's built-in CDC SMT to the quick start configuration. ```properties theme={null} connector.class=io.github.jaredpetersen.kafkaconnectarangodb.sink.ArangoDbSinkConnector topics=customers arangodb.host= arangodb.port= arangodb.user= arangodb.password= arangodb.database.name= key.converter=org.apache.kafka.connect.json.JsonConverter key.converter.schemas.enable=false value.converter=org.apache.kafka.connect.json.JsonConverter value.converter.schemas.enable=false transforms=cdc transforms.cdc.type=io.github.jaredpetersen.kafkaconnectarangodb.sink.transforms.Cdc ``` Key considerations: A non-`null` `after` must be a complete object, and the connector fully replaces the document with the same `_key`; `after=null` follows the key-based deletion path. CDC mode drops a tombstone whose top-level value is `null`, so a delete event must be expressed as `after=null` inside a non-`null` envelope. For schemaless objects, a missing `after` cannot be distinguished from an explicit `after=null`, and is also treated as a delete; validate the upstream event structure before enabling this mode, and ensure that the key is a supported single-field object. ## Monitoring ### What to Monitor Monitor Kafka Connect health, Connector and Task status, throughput, latency, offset commits, errors, retries, and Worker JVM signals; monitor DLQ activity only when the corresponding error handling is enabled. Because the connector has no plugin-specific health checks or metrics, also use the state of target documents in ArangoDB and Worker logs to determine whether writes match expectations. ### Import the Grafana Dashboard Confirm that Connect metrics are connected to a Grafana data source and that collection labels meet the dashboard's filtering requirements; download the [Kafka Connect Dashboard](https://automq-download-center.oss-cn-hangzhou.aliyuncs.com/connect-dashboard/automq-connect-cluster-dashboard.json), import the JSON into Grafana, and select the corresponding data source. ## Limitations * The connector does not automatically create an ArangoDB database or collection and does not provide an explicit topic-to-collection mapping; each record can only be written to the pre-created collection corresponding to the suffix after the current topic's last period. * A non-`null` value is inserted or replaced as a complete document. The connector does not support field-level partial updates, creating a dedicated schema, soft deletes, foreign-key conversion, or edge relationship mapping; old fields omitted from the new value are not merged or retained. * A Kafka key must be an object with at least one field whose first value is not `null`, and the connector uses only the first field's value; raw-type keys, empty keys, and stable composite-key mappings are not supported. A non-`null` value must convert to an object; arrays and scalars are not supported. * Version 1.0.4 does not provide connector-level TLS, truststore, connection timeout, retry-count, or backoff configurations. * Record conversion exceptions and ArangoDB write exceptions are thrown directly from `task.put` and cause the task to fail; `errors.tolerance` and the DLQ cannot handle invalid keys, invalid values, or database write errors on this path. * There is no cross-system transaction between the connector and Kafka offsets. Earlier writes in a polling batch may already have succeeded when a later write causes the task to fail; after a manual restart, records after the last committed offset may be replayed. Full replacement or deletion by a stable `_key` can reduce the likelihood of duplicate document creation, but does not provide exactly-once, no-replay, or global-order guarantees. * Version 1.0.4 may log the original configuration Map containing `arangodb.password` at INFO level; restricting log access alone does not provide encryption for the transport path, so the risk of credential exposure must be assessed separately before production use. ## FAQ ### Why did some fields disappear from the original document after an update? The connector performs a complete document replacement for a non-`null` value and does not merge fields. Check whether the new message value contains every field that the final document must retain, and confirm that the first field of the key still points to the same `_key`. If the upstream system produces only field differences, first reconstruct the complete object in Kafka Streams or another processing layer, and then pass it to the connector for writing. ### Why was a record written to the wrong collection, or did it fail because the collection does not exist? The connector uses the string after the last period in the topic name as the collection name. Check the actual topic name and the matching range of `topics` or `topics.regex`, and pre-create the corresponding collection; for example, `dbserver1.inventory.customers` requires a `customers` collection. The connector cannot use configuration to remap this topic to another collection. ### Why did a tombstone record not delete the document? First confirm that the key is an object with at least one field whose first value is not `null`. In normal mode, a tombstone with a `null` value deletes the document by that key. When the CDC SMT is enabled, a top-level tombstone is dropped, and deletion must use a non-`null` CDC envelope with `after=null`. Do not use an unschematized envelope without `after` to represent another event, because it also enters the deletion path. ### How should I recover after a task fails, and will records be written again? First confirm the cause from the Worker logs and ArangoDB state, fix the invalid records, permissions, target resources, network, or server-side issue, and then manually restart the failed task. Ordinary connector or driver exceptions are not automatically categorized and retried by the plugin, and `errors.tolerance` or the DLQ cannot be relied on to skip failures inside `task.put`. Because successful writes and Kafka offset commits are not part of one transaction, a restart may replay records after the last committed offset, including earlier batches that were already written before the failure. After recovery, check the target documents and consumer-group offsets; do not treat returning the task to RUNNING as proof that no replay or data overwrite occurred. # Azure IoT Hub Sink Connector Source: https://docs.automq.com/automq-cloud/kafka-connect/sink-connectors/azure-iot-hub-sink-connector Configure and operate the Azure IoT Hub Sink Connector in AutoMQ Connect, including prerequisites, configuration, monitoring, and troubleshooting. ## Overview The Azure IoT Hub Sink Connector reads cloud-to-device messages from a Kafka topic, converts each record into an Azure IoT Hub message, and sends it to the device specified by the record. It sits between the Kafka event stream and the IoT Hub device messaging channel, and is suitable for forwarding device commands, notifications, or configuration updates generated by business systems to IoT Hub. The record value can be represented by a Struct or a JSON string. A message must contain at least `messageId`, `message`, and `deviceId`; `deviceId` selects the target device. `expiry` can be used in a Struct to specify the message expiration time, while the corresponding property name in a JSON string is `expiryTime`. The Connector does not handle device feedback, direct methods, or other cloud-to-device communication patterns. ## Prerequisites * The target device that receives messages must exist in Azure IoT Hub, and the connection string must have permission to send cloud-to-device messages to IoT Hub. If message expiration is used, also confirm that the business rules of the target Azure IoT Hub and device side match the expected behavior. ## License Uses the MIT License. ## Quick Start Prepare the Connect Cluster, Kafka, and Azure IoT Hub in advance, confirm that the Worker can access the input topic and Azure IoT Hub, and prepare the target device. For cluster and Connector management operations, see [Manage Connectors](../manage-connectors). The following configuration reads JSON strings from a topic and sends each message to the device specified by its `deviceId`. ```properties theme={null} connector.class=com.microsoft.azure.iot.kafka.connect.sink.IotHubSinkConnector topics= value.converter=org.apache.kafka.connect.storage.StringConverter IotHub.ConnectionString= ``` Replace `` with the input topic and `` with the Azure IoT Hub connection string. Do not write the connection string to logs or commit it to version control. When using this example, the string value of each message in the topic should be parseable JSON, for example: ```json theme={null} {"messageId":"msg-1001","message":"reboot","deviceId":"device-001"} ``` The optional `expiryTime` in JSON must be a parseable ISO-8601 Instant; omitting this property means that no expiration time is set. Record conversion fails when an input record is missing a required field, a field type does not match, or the JSON cannot be parsed. ## Configuration ### Connection and Messages #### `IotHub.ConnectionString` Sets the Azure IoT Hub connection string. * **Type**: `string` * **Default**: None * **Importance**: High * **Required**: Yes * **Valid Values / Notes**: Must provide a connection string that can be used to create an Azure IoT Hub ServiceClient. The configuration definition does not validate whether the value is non-empty, correctly formatted, or reachable; an invalid value may cause failure when the Connector starts or sends a message. This configuration contains sensitive credentials. Use a secure configuration injection method and do not output it to logs. #### `IotHub.MessageDeliveryAcknowledgement` Sets the message delivery acknowledgement mode for messages written to Azure IoT Hub. * **Type**: `string` * **Default**: `None` * **Importance**: High * **Valid Values / Notes**: Only the case-sensitive values `None`, `Full`, `PositiveOnly`, or `NegativeOnly` can be used. The value is sent as acknowledgement metadata for each Azure message; it does not prove that the device has received, processed, or returned feedback for the message, and it does not generate a Kafka acknowledgement record. ### Input Subscription and Tasks #### `connector.class` Selects the Azure IoT Hub Sink Connector implementation class. * **Type**: `string` * **Default**: None * **Importance**: High * **Required**: Yes * **Valid Values / Notes**: Use `com.microsoft.azure.iot.kafka.connect.sink.IotHubSinkConnector`. #### `topics` Specifies the list of Kafka topics to read. * **Type**: `list` * **Default**: Empty list `[]` * **Importance**: High * **Required**: Mutually exclusive with `topics.regex` * **Valid Values / Notes**: Use comma-separated topic names and configure a non-empty `topics` instead of `topics.regex`; setting both or leaving both empty causes Sink configuration validation to fail. #### `topics.regex` Subscribes to Kafka topics using a regular expression. * **Type**: `string` * **Default**: Empty string * **Importance**: High * **Required**: Mutually exclusive with `topics` * **Valid Values / Notes**: Use a non-empty Java regular expression instead of `topics`; setting both or leaving both empty causes Sink configuration validation to fail. #### `tasks.max` Sets the maximum number of Tasks that the Connector can create. * **Type**: `int` * **Default**: `1` * **Importance**: High * **Valid Values / Notes**: Must be at least `1`. Actual parallelism is limited by the number of Kafka partitions and the assignment result; increasing this value does not guarantee per-device serialization and does not establish global ordering across partitions or Tasks. ### Data Conversion #### `key.converter` Converts Kafka record keys into Kafka Connect data. * **Type**: `class` * **Default**: `null` * **Importance**: Low * **Valid Values / Notes**: When not set, the Worker-level key converter is used. When set, it must be an instantiable `org.apache.kafka.connect.storage.Converter` implementation. The Connector uses the record value to select the device and does not read the record key to map the target device. #### `value.converter` Converts Kafka record values into Kafka Connect data for the Connector to map to Azure IoT Hub messages. * **Type**: `class` * **Default**: `null` * **Importance**: Low * **Valid Values / Notes**: When not set, the Worker-level value converter is used. When set, it must be an instantiable `org.apache.kafka.connect.storage.Converter` implementation. The converted value must conform to a String or Struct path supported by the Connector. A String value should be JSON containing `messageId`, `message`, `deviceId`, and optional `expiryTime`; a Struct value must contain same-named string fields `messageId`, `message`, and `deviceId`, and may contain a string-typed `expiry` field. ## Best Practices ### Subscribe to a Group of Input Topics by Regular Expression **Applicable business scenario**: You are connecting multiple message topics with consistent naming rules for the first time, or will continue creating topics of the same type and want the Connector to automatically include matching topics without modifying a fixed topic list each time. **Configuration example**: ```properties theme={null} connector.class=com.microsoft.azure.iot.kafka.connect.sink.IotHubSinkConnector topics.regex=devices\..*\.commands value.converter=org.apache.kafka.connect.storage.StringConverter IotHub.ConnectionString= ``` Replace `` with the Azure IoT Hub connection string. After using `topics.regex`, remove `topics`; do not configure both subscription methods. String values in each topic matched by the expression should follow the same JSON message structure. **Key point**: Regular-expression subscription makes it easier to manage topics of the same type uniformly, but the topic naming rules directly determine the consumption scope. Before changing the naming rules, confirm whether the old and new topics will match at the same time to avoid unintentionally expanding or shrinking the input scope. ### Increase Task Parallelism by Partition **Applicable business scenario**: The Connector is already sending messages reliably, the input topic has multiple partitions, and the per-record synchronous sending throughput of a single Task is insufficient. You want to process partitions in parallel by increasing the number of Tasks. **Configuration example**: ```properties theme={null} connector.class=com.microsoft.azure.iot.kafka.connect.sink.IotHubSinkConnector topics= tasks.max=2 value.converter=org.apache.kafka.connect.storage.StringConverter IotHub.ConnectionString= ``` Replace `` and `` with the actual values. First confirm that the input topic has at least two assignable partitions, then increase `tasks.max` gradually while observing Task status, sending latency, and consumer Lag. **Key point**: `tasks.max` is an upper limit, not the actual number of parallel Tasks; Kafka Connect creates and assigns Tasks based on the partition assignment result. Each Task sends messages independently. The Connector does not guarantee processing order for the same device across partitions or Tasks, so when ordering is required, an appropriate partition key should be designed upstream. ## Monitoring ### What to Monitor Monitor the health status and status changes of the Kafka Connect Worker, Connector, and Tasks, and pay attention to input throughput, sending latency, consumer Lag, Offset commits, errors, and retries. Also observe CPU, memory, and garbage-collection signals for the Worker JVM. Because the Connector sends each record synchronously, increased sending latency may slow Task processing. If Kafka Connect error handling or a dead-letter queue is enabled, also monitor the corresponding error-handling counters and DLQ activity. Do not treat `IotHub.MessageDeliveryAcknowledgement` as a device feedback metric. ### Import the Grafana Dashboard Obtain the Dashboard JSON from [Download the Connect Cluster Grafana Dashboard](https://automq-download-center.oss-cn-hangzhou.aliyuncs.com/connect-dashboard/automq-connect-cluster-dashboard.json), prepare a Prometheus data source that collects Kafka Connect metrics, and confirm that the label names match the data source configuration. Then import the JSON into Grafana and select the corresponding data source. ## Limitations * The Connector only handles cloud-to-device messages; it does not provide device feedback, consumption of acknowledgement results, direct methods, or other Azure IoT Hub communication patterns. * Each input record is converted and sent synchronously and individually. There are no Connector-level batch requests, asynchronous sending, rate limiting, or configurable in-flight message count. * Exactly one of `topics` and `topics.regex` must be configured with a non-empty value; they cannot be used together or both omitted. * Successful message sending and Kafka Offset commits are not one atomic operation. If the process fails after sending completes but before the Offset is committed, the record may be sent again after recovery. * The Connector does not provide global ordering across partitions, Tasks, or by device, and does not provide idempotent deduplication or exactly-once delivery guarantees. * Struct input requires `messageId`, `message`, and `deviceId` to be string fields. String input must be JSON that can be deserialized into a message object; incorrect fields or formats cause record conversion to fail. ## FAQ ### What should I do if the Connector reports a `topics` and `topics.regex` configuration error when starting? Check whether the two configurations are both empty or both set. For a fixed-topic scenario, keep only a non-empty `topics`; to subscribe by naming rules, keep only a non-empty `topics.regex`. Submit the Connector configuration again after making the change, and confirm that the regular expression is a valid Java regular expression. ### How can I check input records when message conversion fails? First check the conversion error in the Task log, then confirm that the value converter outputs a String or Struct. A String value should be JSON containing string-typed `messageId`, `message`, and `deviceId`; a Struct value should contain these fields and use a string-typed `expiry` for the optional expiration time. The expiration field name in JSON is `expiryTime`; do not confuse it with the Struct field name `expiry`. ### Why might a Kafka record be sent again after a successful send call? Connector sending and Kafka Offset committing are two separate steps. If the process fails after the Azure service accepts the send request but before the Offset is committed, the record may be read and sent again after recovery. Check the Task status, Offset commit status, and consumer Lag, and handle potential duplicates according to the message's business idempotency design. Do not interpret the acknowledgement mode as a cross-system exactly-once guarantee. ### Is it normal for processing order to change after increasing `tasks.max`? Yes. After the number of Tasks increases, Kafka may assign different partitions to different Tasks. The Connector only preserves the iteration order of records received in a single processing call by an individual Task; it does not guarantee global ordering across partitions, Tasks, or by device. When ordering is required, put related messages in the same partition and control parallelism. # Camunda Zeebe Sink Connector Source: https://docs.automq.com/automq-cloud/kafka-connect/sink-connectors/camunda-platform-8-zeebe-sink-connector Configure and operate the Camunda Zeebe Sink Connector in AutoMQ Connect, including prerequisites, configuration, monitoring, and troubleshooting. ## Overview The Camunda Zeebe Sink Connector reads JSON business events from Kafka and publishes each record as a Zeebe message. It sits between a Kafka event stream and Camunda Platform 8 processes: the Connector extracts the message name and correlation key from each event and requests message correlation for BPMN process instances waiting for that message. It can also pass the event's variables and message time-to-live to Zeebe. The input record value must be parseable according to JSON and JSONPath semantics. By default, the `messageName` and `correlationKey` fields map to the Zeebe message name and correlation key, `variables` maps to process variables, and `timeToLive` maps to the message TTL. The Kafka record key is not used for message mapping. The Connector can connect to Camunda SaaS or a self-managed Zeebe Gateway; it publishes and correlates messages, but does not start processes, complete tasks, or consume Zeebe feedback. ## Prerequisites * For Camunda SaaS mode, prepare the cluster ID, the region when it is not the default region, and a Client ID and Client Secret with access. For self-managed mode, prepare an accessible Zeebe Gateway address and the corresponding authentication method. * Each record value in the Kafka input Topic must be a parseable JSON document from which the configured JSONPath expressions can read `messageName` and `correlationKey`; if variables or TTL are used, the document must also provide fields convertible to the corresponding types. * The Zeebe process model must contain message catch events whose message names and correlation keys match the input; if a message may arrive before the process instance, design the TTL according to the business waiting window. ## License Uses Apache License 2.0. ## Quick Start Prepare a Connect Cluster, Kafka, an accessible Zeebe Gateway, and an input Topic, and confirm network connectivity and the required access permissions. For general steps to create and manage a Connector, see AutoMQ's [Manage Connectors](../manage-connectors). The following example uses a self-managed Zeebe Gateway, a String Converter for the record key, and a JSON Converter for the record value; the record key is not used for JSONPath message mapping. If you use Camunda SaaS, use the SaaS settings in the Configuration section instead. ```properties theme={null} connector.class=io.zeebe.kafka.connect.ZeebeSinkConnector tasks.max=1 topics= key.converter=org.apache.kafka.connect.storage.StringConverter value.converter=org.apache.kafka.connect.json.JsonConverter value.converter.schemas.enable=false zeebe.client.gateway.address=:26500 zeebe.client.security.plaintext=false message.path.messageName=$.messageName message.path.correlationKey=$.correlationKey message.path.variables=$.variables message.path.timeToLive=$.timeToLive ``` Replace `` and `` with the actual resources. The value of each input record should contain at least `messageName` and `correlationKey`; `variables` and `timeToLive` are optional fields. The record key can be a string, but it does not replace fields in the JSON value and is not used for JSONPath message mapping. For a self-managed Gateway using plaintext transport, set `zeebe.client.security.plaintext` to `true`; Camunda SaaS does not use these Gateway settings and instead uses the `zeebe.client.cloud.*` settings. After the configuration is applied, the Connector publishes each input record as a Zeebe message, and Zeebe correlates it by message name and correlation key. ## Configuration ### Zeebe Gateway #### `zeebe.client.gateway.address` The address of the self-managed Zeebe Gateway. * **Category**: Zeebe Gateway * **Type**: `string` * **Default**: `localhost:26500` * **Importance**: High * **Valid values / Notes**: Enter an accessible `host:port` address. Takes effect only when `zeebe.client.cloud.clusterId` is not set; Camunda SaaS mode ignores this setting. #### `zeebe.client.requestTimeout` The Zeebe request timeout in milliseconds. * **Category**: Zeebe Gateway * **Type**: `long` * **Default**: `1000` * **Importance**: Low * **Valid values / Notes**: Direct Gateway mode uses this value; provide a non-negative duration in milliseconds accepted by the client. The Camunda SaaS client construction branch does not use this setting. #### `zeebe.client.security.plaintext` Whether to use a plaintext connection to the self-managed Zeebe Gateway. * **Category**: Zeebe Gateway * **Type**: `boolean` * **Default**: `false` * **Importance**: Low * **Valid values / Notes**: `true` or `false`. Only direct Gateway mode reads this setting; use `true` only when the Gateway is explicitly configured for plaintext transport. Camunda SaaS mode ignores this setting. ### Camunda SaaS #### `zeebe.client.cloud.clusterId` The Camunda SaaS cluster ID to connect to. * **Category**: Camunda SaaS * **Type**: `string` * **Default**: `null` * **Importance**: Low * **Valid values / Notes**: Setting a non-`null` value selects the Camunda SaaS client branch; use it together with `zeebe.client.cloud.clientId` and `zeebe.client.cloud.clientSecret`. This version does not perform a non-empty validation. #### `zeebe.client.cloud.region` The region where the Camunda SaaS cluster is located. * **Category**: Camunda SaaS * **Type**: `string` * **Default**: `null` * **Importance**: Low * **Valid values / Notes**: This setting overrides the SDK's region selection only when both `zeebe.client.cloud.clusterId` and this setting are provided; direct Gateway mode ignores it. The SDK processes the region value; this Connector does not validate the region. ### Authentication #### `zeebe.client.cloud.clientId` The Client ID used to connect to Camunda SaaS or in direct OAuth mode. * **Category**: Authentication * **Type**: `string` * **Default**: `null` * **Importance**: Low * **Valid values / Notes**: In Camunda SaaS mode, use it with the cluster ID and Client Secret; in direct OAuth mode, setting it enables the OAuth credentials provider and also requires the Client Secret and token audience. #### `zeebe.client.cloud.clientSecret` The Client Secret used to connect to Camunda SaaS or in direct OAuth mode. * **Category**: Authentication * **Type**: `string` * **Default**: `null` * **Importance**: Low * **Valid values / Notes**: Sensitive value. Inject it through controlled configuration and do not write it to shared documents or logs; in Camunda SaaS mode, use it with the cluster ID and Client ID. #### `zeebe.client.cloud.token.audience` The token audience used to request a token in direct OAuth mode. * **Category**: Authentication * **Type**: `string` * **Default**: `null` * **Importance**: Low * **Valid values / Notes**: Used only when `zeebe.client.cloud.clusterId` is not set and `zeebe.client.cloud.clientId` is set; the Camunda SaaS client branch ignores it. This Connector does not validate the audience format. #### `zeebe.client.cloud.authorization.server.url` A configuration property representing the authorization server address in the registry. * **Category**: Authentication * **Type**: `string` * **Default**: `null` * **Importance**: Low * **Valid values / Notes**: In this version, the client construction logic does not read this setting, so setting it does not configure a custom token endpoint. Do not rely on it when a custom OAuth endpoint is required. ### Message Mapping #### `message.path.messageName` The JSONPath expression used to extract the Zeebe message name from the input JSON document. * **Category**: Message Mapping * **Type**: `string` * **Default**: `messageName` * **Importance**: High * **Valid values / Notes**: Enter an expression that can be compiled by JSONPath and ensure that every record resolves to a value convertible to a message name. This is a JSONPath expression and does not require a fixed field name. #### `message.path.correlationKey` The JSONPath expression used to extract the Zeebe message correlation key from the input JSON document. * **Category**: Message Mapping * **Type**: `string` * **Default**: `correlationKey` * **Importance**: High * **Valid values / Notes**: Enter an expression that can be compiled by JSONPath and ensure that every record resolves to a value convertible to a Zeebe correlation key. Design a stable, business-unique correlation key for each process instance. #### `message.path.variables` The JSONPath expression used to extract Zeebe message variables from the input JSON document. * **Category**: Message Mapping * **Type**: `string` * **Default**: `variables` * **Importance**: Medium * **Valid values / Notes**: An empty string disables the variables path. If this setting is enabled but the path is missing from a record, the Connector falls back to using the entire JSON document as variables. #### `message.path.timeToLive` The JSONPath expression used to extract the Zeebe message TTL from the input JSON document. * **Category**: Message Mapping * **Type**: `string` * **Default**: `timeToLive` * **Importance**: Low * **Valid values / Notes**: An empty string disables the TTL path; the extracted value is read as milliseconds. If the path is missing, no TTL is sent, and message expiration is determined by Zeebe message semantics. ### Kafka Connect Sink Basics #### `connector.class` The Kafka Connect Sink Connector class to instantiate. * **Category**: Kafka Connect Sink Basics * **Type**: `string` * **Default**: No ConfigDef default * **Importance**: High * **Valid values / Notes**: Required; use the fixed value `io.zeebe.kafka.connect.ZeebeSinkConnector`. #### `tasks.max` The maximum number of Sink Tasks requested for creation. * **Category**: Kafka Connect Sink Basics * **Type**: `int` * **Default**: `1` * **Importance**: High * **Valid values / Notes**: Must be at least `1`. Actual parallelism also depends on input Topic partition assignment and Zeebe client capacity; increasing this value does not provide ordering guarantees across Tasks. #### `tasks.max.enforce` Whether to enforce the `tasks.max` limit. * **Category**: Kafka Connect Sink Basics * **Type**: `boolean` * **Default**: `true` * **Importance**: Low * **Deprecated**: Yes * **Valid values / Notes**: `true` or `false`. Kafka Connect has deprecated this setting and a future major version may remove it; new configurations should not rely on `false`. #### `key.converter` The Kafka record key Converter at the Connector level. * **Category**: Kafka Connect Sink Basics * **Type**: `class` * **Default**: `null` * **Importance**: Low * **Valid values / Notes**: Must be an instantiable Converter class; when unset, inherits the Worker selection. `org.apache.kafka.connect.storage.StringConverter` is recommended for record keys; the record key undergoes only Kafka Connect type conversion, does not generate Zeebe message fields, and is not used for JSONPath message mapping. #### `value.converter` The Kafka record value Converter at the Connector level. * **Category**: Kafka Connect Sink Basics * **Type**: `class` * **Default**: `null` * **Importance**: Low * **Valid values / Notes**: Must be an instantiable Converter class; when unset, inherits the Worker selection. The converted value is parsed according to JSON semantics; the Connector does not select a Converter automatically. #### `header.converter` The Kafka record header Converter at the Connector level. * **Category**: Kafka Connect Sink Basics * **Type**: `class` * **Default**: `null` * **Importance**: Low * **Valid values / Notes**: Must be an instantiable HeaderConverter class; when unset, inherits the Worker selection. This Connector does not read record headers directly. #### `transforms` The list of single message transformation (SMT) aliases applied before the SinkTask processes records. * **Category**: Kafka Connect Sink Basics * **Type**: `list` * **Default**: Empty list * **Importance**: Low * **Valid values / Notes**: Use comma-separated unique aliases; each alias must correspond to a defined transformation. SMTs run before JSONPath extraction. #### `predicates` The list of predicate aliases available to conditional SMTs. * **Category**: Kafka Connect Sink Basics * **Type**: `list` * **Default**: Empty list * **Importance**: Low * **Valid values / Notes**: Use comma-separated unique aliases; no predicates are enabled by default. #### `config.action.reload` The action taken when an external ConfigProvider value changes. * **Category**: Kafka Connect Sink Basics * **Type**: `string` * **Default**: `restart` * **Importance**: Low * **Valid values / Notes**: Valid values are `none` or `restart`; this controls the action after an external configuration change and is not a Zeebe client property. ### Error Handling #### `errors.retry.timeout` The maximum retry duration after a Kafka Connect framework operation fails, in milliseconds. * **Category**: Error Handling * **Type**: `long` * **Default**: `0` * **Importance**: Medium * **Valid values / Notes**: `0` means no retry, and `-1` means retry indefinitely. This differs from the Zeebe request timeout and the Connector's own asynchronous retry mechanism. #### `errors.retry.delay.max.ms` The maximum delay between Kafka Connect framework retries, in milliseconds. * **Category**: Error Handling * **Type**: `long` * **Default**: `60000` * **Importance**: Medium * **Valid values / Notes**: Limits framework retry delay; it does not change the backoff parameters for the Connector's internal Zeebe request retries. #### `errors.tolerance` The Kafka Connect tolerance policy for framework-level errors. * **Category**: Error Handling * **Type**: `string` * **Default**: `none` * **Importance**: Medium * **Valid values / Notes**: Valid values are `none` or `all`. `all` only allows Connect to skip problems identified during framework processing; it does not guarantee that Zeebe publish failures or all SinkTask exceptions are skipped. #### `errors.log.enable` Whether to record tolerated errors and failed operations. * **Category**: Error Handling * **Type**: `boolean` * **Default**: `false` * **Importance**: Medium * **Valid values / Notes**: `true` or `false`. This setting does not independently enable a dead letter queue. #### `errors.log.include.messages` Whether to include the Sink record's Topic, partition, Offset, and timestamp in error logs. * **Category**: Error Handling * **Type**: `boolean` * **Default**: `false` * **Importance**: Medium * **Valid values / Notes**: `true` or `false`. Enabling it increases the amount of record metadata exposed; it does not mean that the record value is written to logs. #### `errors.deadletterqueue.topic.name` The dead letter queue Topic used by the Kafka Connect framework error reporter. * **Category**: Error Handling * **Type**: `string` * **Default**: Empty string * **Importance**: Medium * **Valid values / Notes**: An empty string means that no DLQ is configured. Once configured, this Topic must not also be consumed by `topics` or matched by `topics.regex`; a DLQ does not mean that every Zeebe publish failure can be recovered record by record. #### `errors.deadletterqueue.topic.replication.factor` The replication factor used when creating a missing DLQ Topic. * **Category**: Error Handling * **Type**: `short` * **Default**: `3` * **Importance**: Medium * **Valid values / Notes**: Only `short` type parsing is performed; the Broker's Topic creation policy and replica constraints still apply. #### `errors.deadletterqueue.context.headers.enable` Whether to write Kafka Connect error-context headers to DLQ records. * **Category**: Error Handling * **Type**: `boolean` * **Default**: `false` * **Importance**: Medium * **Valid values / Notes**: `true` or `false`. Takes effect only when a DLQ destination is configured; written headers use the `__connect.errors.` prefix. ### Kafka Topic Subscription #### `topics` The list of Kafka Topics consumed by the Connector. * **Category**: Kafka Topic Subscription * **Type**: `list` * **Default**: Empty string * **Importance**: High * **Valid values / Notes**: Use comma-separated Topic names; this setting is mutually exclusive with `topics.regex`, and the configured DLQ Topic must not be included in the consumption range. #### `topics.regex` The regular expression for Kafka Topics consumed by the Connector. * **Category**: Kafka Topic Subscription * **Type**: `string` * **Default**: Empty string * **Importance**: High * **Valid values / Notes**: Use Java Pattern syntax; this setting is mutually exclusive with `topics`, and the expression must not match the configured DLQ Topic. ## Best Practices ### Trigger Process Messages with a Stable Correlation Key Applicable business scenario: Kafka continuously receives order, payment, or inventory events, while BPMN processes in Zeebe wait for the corresponding messages. Each event must be correlated reliably to the target process instance instead of relying on the Kafka record key. ```properties theme={null} connector.class=io.zeebe.kafka.connect.ZeebeSinkConnector tasks.max=1 topics= key.converter=org.apache.kafka.connect.storage.StringConverter value.converter=org.apache.kafka.connect.json.JsonConverter value.converter.schemas.enable=false zeebe.client.gateway.address=:26500 zeebe.client.security.plaintext=false message.path.messageName=$.messageName message.path.correlationKey=$.orderId message.path.variables=$.variables ``` Key notes: `correlationKey` should map to a stable, business-unique identifier such as an order ID or process business key, and should be designed consistently with the correlation key used by the BPMN message subscription. Do not treat the Connector's replay behavior as cross-system exactly-once; downstream business actions should still be idempotent. For SaaS, use the `zeebe.client.cloud.*` settings in the Configuration section instead. ### Buffer Early Events with a TTL Applicable business scenario: A business event may enter Kafka before the process instance waiting for the message is created. Zeebe should retain the message for a limited time so that a short difference in arrival order does not immediately lose the correlation opportunity. ```properties theme={null} connector.class=io.zeebe.kafka.connect.ZeebeSinkConnector tasks.max=1 topics= key.converter=org.apache.kafka.connect.storage.StringConverter value.converter=org.apache.kafka.connect.json.JsonConverter value.converter.schemas.enable=false zeebe.client.gateway.address=:26500 zeebe.client.security.plaintext=false message.path.messageName=$.messageName message.path.correlationKey=$.correlationKey message.path.timeToLive=$.timeToLive ``` Key notes: `timeToLive` is read in milliseconds, and the TTL is sent only when the input document provides a value through the configured path. TTL expiration means that Zeebe's message waiting window has ended; it does not mean that the Kafka record was deleted, the business process completed, or the message entered a DLQ. The TTL should cover the acceptable delay before process-instance creation. For SaaS, use the `zeebe.client.cloud.*` settings in the Configuration section instead. ### Pass Only the Variables Required by the Process Applicable business scenario: A Kafka event contains many business fields, but the process needs only a stable, serializable subset. Those fields should be passed as Zeebe message variables without bringing unrelated data into the process context. ```properties theme={null} connector.class=io.zeebe.kafka.connect.ZeebeSinkConnector tasks.max=1 topics= key.converter=org.apache.kafka.connect.storage.StringConverter value.converter=org.apache.kafka.connect.json.JsonConverter value.converter.schemas.enable=false zeebe.client.gateway.address=:26500 zeebe.client.security.plaintext=false message.path.messageName=$.messageName message.path.correlationKey=$.correlationKey message.path.variables=$.workflowVariables ``` Key notes: Put the fields actually required by the process model in the `workflowVariables` object, and keep their types and structure stable. If the configured variables path is missing, the Connector falls back to sending the entire JSON document; to avoid this fallback, require the object in the production data contract. Message publication does not provide a process-completion acknowledgement; design a separate Zeebe or Kafka feedback stream when an acknowledgement is required. For SaaS, use the `zeebe.client.cloud.*` settings in the Configuration section instead. ## Monitoring ### What to Monitor Monitor the health and restart counts of the Kafka Connect Worker, Connector, and Tasks, as well as consumption throughput, processing latency, Offset commit progress, consumer lag, errors, and retries. Also observe Worker JVM heap usage, garbage collection, threads, and CPU. When error tolerance or a DLQ is enabled, monitor tolerated errors, DLQ write volume, and DLQ Topic lag separately; when internal Zeebe retries continue, use Task status, request latency, and Zeebe Gateway availability together to determine whether a downstream failure exists. ### Import the Grafana Dashboard Download the [AutoMQ Connect Cluster Dashboard](https://automq-download-center.oss-cn-hangzhou.aliyuncs.com/connect-dashboard/automq-connect-cluster-dashboard.json), select in Grafana a data source that collects Kafka Connect metrics, and ensure that metric labels include the cluster, Connector, and Task identifiers. Then use Grafana's Import function to import the JSON dashboard. ## Limitations * There is no cross-system transaction between the Connector and Kafka Offset commits, so Kafka-to-Zeebe exactly-once delivery, duplicate-free publishing, and atomic batches are not guaranteed. * The Connector does not provide strict message ordering for the same Kafka partition, correlation key, or process instance; after `tasks.max` is increased, Tasks do not share ordering coordination. * Zeebe publish requests within one Kafka Connect batch execute concurrently. If some requests succeed while others fail, there is no transactional rollback, and a restart or an Offset commit gap may publish records again. * The Zeebe client performs asynchronous retries only for some gRPC statuses and has no configurable maximum retry count; JSONPath parsing errors and other non-retryable exceptions do not enter this retry mechanism. * `errors.tolerance` and DLQ settings belong to Kafka Connect framework error handling and do not guarantee that Connector-internal Zeebe publish failures are written to the DLQ one by one or skipped. * The Connector reads messages only according to JSON/JSONPath semantics; this should not be taken to mean that arbitrary Connect Schemas, field mappings, or Schema evolution combinations are compatible. * After a message TTL expires, Zeebe may discard a message that has not been correlated. TTL expiration is not Kafka record deletion, process completion, or confirmation of business processing. ## FAQ ### Why does the Task not publish messages after it starts? Check that exactly one of `topics` and `topics.regex` is configured as the subscription selector, confirm that the input Topic has new records, and check whether each value can be parsed through `message.path.messageName` and `message.path.correlationKey`. For a self-managed Zeebe deployment, confirm that the Gateway address and TLS or plaintext setting match the server. For SaaS, confirm that the cluster ID, Client ID, and Client Secret are set and that self-managed Gateway settings are not being used accidentally. ### Why was the message not correlated to a process instance? First confirm that the message name read by JSONPath matches the BPMN message subscription name, then confirm that the correlation key matches a waiting process instance. If the event may arrive before the process instance, set `message.path.timeToLive` and provide a sufficient value in milliseconds. After the TTL expires, the message does not continue waiting and no business acknowledgement is generated automatically. ### What JSON structure do input records require? By default, the structure must contain at least `messageName` and `correlationKey`; for example, an event object can contain those two fields together with `variables` and `timeToLive`. If the fields are located elsewhere, change the corresponding `message.path.*` settings. The value after Converter processing must still conform to the JSON/JSONPath handling supported by the Connector; the Kafka record key does not replace the correlation key in the JSON document. ### Why might the same message be published again after a restart? Kafka Connect advances the record position only after `put` succeeds and the subsequent Offset commit process completes. If a restart, rebalance, or failure occurs after Zeebe has accepted the message but before the Kafka Offset is committed, the record may be delivered again. The Connector generates the same message ID from the same Topic, partition, and Offset. Zeebe may treat an identical existing publish request as successful through `ALREADY_EXISTS`, but this is not a cross-system exactly-once guarantee; business processing should still be replayable or idempotent. ### Why are Zeebe publish failures still missing after a dead letter queue is configured? The DLQ is a Kafka Connect framework error-handling capability and mainly covers errors in framework stages such as Converter and SMT processing. Connector-internal Zeebe publish failures are handled in the SinkTask, so setting `errors.deadletterqueue.topic.name` alone does not guarantee one record per failure in the DLQ. Also check Task error logs, Zeebe Gateway status, authentication settings, and the Connector's retry and recovery strategy. # ClickHouse Sink Connector Source: https://docs.automq.com/automq-cloud/kafka-connect/sink-connectors/clickhouse-sink-connector Configure and operate the ClickHouse Sink Connector in AutoMQ Connect, including table mapping, delivery behavior, security, monitoring, and troubleshooting. ## Overview ClickHouse Sink Connector consumes records from Kafka Topics and writes record values to ClickHouse tables for real-time analytics pipelines involving behavioral events, application logs, and business transactions. Typically, each Topic corresponds to a table with the same name, but it can also be explicitly mapped to an existing business table. Fields in structured records and JSON objects are matched to target columns by name; CSV/TSV strings are written in the target table's input column order. The Connector uses the Connect data model produced by the value Converter to process structured records with schemas, schemaless JSON objects, or string records. Writes are append-based; ordinary Kafka messages are not automatically converted into key-based updates or deletes. Optional Debezium CDC processing converts change events into versioned rows that represent current state in conjunction with the target table engine. ## Prerequisites * The ClickHouse server must be version 23.3 or later. * Create the target database and tables in advance. Column names, types, and default-value rules for missing fields must match the input records. * The ClickHouse account must be able to read target table metadata and execute INSERT. * When automatic column addition is enabled, the account also needs ALTER permission on the target tables. * When enabling `exactlyOnce`, configure an available KeeperMap state store with permissions to create its table and read and write state, and confirm that the target table engine and deduplication window meet replay deduplication requirements. ## License Licensed under Apache License 2.0. ## Quick Start Prepare a Connect Cluster, Kafka Topic, ClickHouse database, and target table in advance, and confirm network connectivity and access permissions. For resource preparation and Connector management, see [Manage Connectors](../manage-connectors). The following configuration accepts schemaless JSON objects and writes over HTTPS to a table with the same name as the Topic. ```properties theme={null} connector.class=com.clickhouse.kafka.connect.ClickHouseSinkConnector topics= hostname= database= username= password= ssl=true client_version=V2 value.converter=org.apache.kafka.connect.json.JsonConverter value.converter.schemas.enable=false ``` Replace the environment placeholders. `hostname` must not include a protocol or port. The default HTTPS port is `8443`; add `port` if the server uses another port. For HTTP deployments, set both `ssl=false` and the corresponding HTTP port, such as `8123`. Changing the protocol does not automatically change the port. Provide the password through secure credential management rather than committing actual credentials to a configuration repository. For example, if the input JSON objects contain an integer `event_id` and a string `event_type`, execute the following table creation statement in the ClickHouse database above, replacing `` with exactly the same name as ``. ```sql theme={null} CREATE TABLE ( event_id Int64, event_type String ) ENGINE = MergeTree ORDER BY event_id; ``` Use ordinary JSON objects for Kafka message values, such as `{"event_id":1,"event_type":"page_view"}`, without the Connect `schema` / `payload` wrapper. This configuration does not enable persistent-state deduplication. Recovery or replay can produce duplicate rows, and ordinary `MergeTree` does not automatically deduplicate based on `ORDER BY`. ## Configuration The defaults below are the values declared in the configuration definitions. Where omitting a parameter changes its actual behavior, this is explained separately in the notes. List values generally use commas as separators; the multi-field format for `dateTimeFormats` uses semicolons. ### Connector Identity and Input Subscription #### `connector.class` Specifies the Connector implementation class. * **Type**: `string` * **Default**: None * **Importance**: High * **Required**: Yes * **Valid Values / Notes**: Use `com.clickhouse.kafka.connect.ClickHouseSinkConnector`. #### `tasks.max` Maximum number of Tasks that can be created. * **Type**: `int` * **Default**: `1` * **Importance**: High * **Valid Values / Notes**: At least `1`. Effective parallelism is constrained by the number and assignment of input partitions. Adding Tasks does not guarantee a linear increase in throughput. #### `topics` Specifies the list of Topics to consume. * **Type**: `list` * **Default**: Empty list * **Importance**: High * **Required**: Either this or `topics.regex` * **Valid Values / Notes**: Comma-separated. Exactly one of this setting and `topics.regex` must have a nonempty value. The list must not include this Connector's own DLQ Topic. #### `topics.regex` Subscribes to Topics using a regular expression. * **Type**: `string` * **Default**: Empty string * **Importance**: High * **Required**: Either this or `topics` * **Valid Values / Notes**: Use a Java regular expression that does not match this Connector's own DLQ Topic. Prepare target tables for newly matched Topics as well. ### ClickHouse Connection and Authentication #### `hostname` ClickHouse hostname. * **Type**: `string` * **Default**: None * **Importance**: High * **Required**: Yes * **Valid Values / Notes**: Nonempty, without a protocol or port. #### `port` Port of the ClickHouse HTTP or HTTPS interface. * **Type**: `int` * **Default**: `8443` * **Importance**: High * **Valid Values / Notes**: `1` to `65535`. This is not the native TCP interface port and does not change automatically with `ssl`. #### `username` ClickHouse username. * **Type**: `string` * **Default**: Empty string * **Importance**: Low * **Valid Values / Notes**: If omitted, the connection implementation falls back to `default`. Specify an account explicitly to avoid relying on the different handling of omitted and empty values. #### `password` Password for the ClickHouse account. * **Type**: `password` * **Default**: Empty string * **Importance**: Low * **Valid Values / Notes**: Leading and trailing spaces are removed when read. Do not use passwords that depend on these spaces, and do not include actual credentials in logs or public examples. #### `ssl` Selects whether to connect over HTTPS. * **Type**: `boolean` * **Default**: `true` * **Importance**: Low * **Valid Values / Notes**: `true` or `false`. If omitted, the connection implementation may fall back to HTTP. Set it explicitly and match it to `port`. #### `client_version` Selects the ClickHouse client implementation. * **Type**: `string` * **Default**: Empty string * **Importance**: Low * **Valid Values / Notes**: Explicitly specify `V1` or `V2`. Only the exact value `V1` selects the older client; other values, including an explicitly empty string, select V2. Omitting the setting falls back to V1. #### `jdbcConnectionProperties` Adds query properties to the connection URL. * **Type**: `string` * **Default**: Empty string * **Importance**: Low * **Valid Values / Notes**: Use the `key=value&key=value` format; the leading `?` is optional. The connection URL may be logged, so do not pass passwords or tokens through this setting. #### `clickhouseSettings` Specifies ClickHouse server settings for write requests. * **Type**: `list` * **Default**: Empty list * **Importance**: Low * **Valid Values / Notes**: Comma-separated `key=value` entries, each containing only one `=`. The connection implementation adds each of `input_format_skip_unknown_fields=1`, `wait_end_of_query=1`, `async_insert=0`, and `send_progress_in_http_headers=1` that the user has not specified, even when this setting already contains other entries. User values are not overridden. These are not the declared defaults for this setting. Do not override the Connector-managed `insert_deduplication_token`. Asynchronous inserts must wait for actual insertion; `wait_for_async_insert=0` does not provide persistence acknowledgment. #### `ssl_socket_sni` Overrides the SNI hostname in the TLS handshake. * **Type**: `string` * **Default**: Empty string * **Importance**: Low * **Valid Values / Notes**: Use only for special TLS routing requirements. With the V1 client, a nonempty value also disables certificate and hostname verification; this is not an SNI adjustment without security implications. ### Proxy Connection #### `proxyType` Specifies the proxy type for ClickHouse connections. * **Type**: `string` * **Default**: Empty string * **Importance**: Low * **Valid Values / Notes**: Recommended values are `IGNORE`, `DIRECT`, `HTTP`, and `SOCKS`. An empty string or unrecognized value ignores the proxy. V2 constructs an HTTP proxy for every non-`IGNORE` type and does not preserve the original SOCKS or DIRECT semantics. #### `proxyHost` Proxy server hostname. * **Type**: `string` * **Default**: Empty string * **Importance**: Low * **Valid Values / Notes**: Used only for non-`IGNORE` proxy types. Specify the actual hostname when enabling a proxy. #### `proxyPort` Proxy server port. * **Type**: `int` * **Default**: `-1` * **Importance**: Low * **Valid Values / Notes**: Explicitly specify a valid network port when enabling a proxy. The default does not represent a usable port. ### Database and Table Routing #### `database` Default target database. * **Type**: `string` * **Default**: `default` * **Importance**: Low * **Valid Values / Notes**: The database must already exist. When Topic splitting is enabled, the database portion of the Topic name can override this value. #### `topic2TableMap` Maps Topics to target tables. * **Type**: `list` * **Default**: Empty list * **Importance**: Low * **Valid Values / Notes**: Comma-separated `topic=table` entries. Leading and trailing spaces are removed from keys and values; later entries take precedence for duplicate keys. Unmapped Topics use tables with the same name. A mapping value is a table name, not cross-database `database.table` routing syntax, and does not create a table. #### `enableDbTopicSplit` Splits the Topic name into database and table-routing names. * **Type**: `boolean` * **Default**: `false` * **Importance**: Low * **Valid Values / Notes**: Explicitly set `dbTopicSplitChar` when enabling this option. The database is overridden only when the name splits into exactly two parts; `topic2TableMap` is then looked up using the resulting Topic portion. Otherwise, the original database and Topic name are retained. #### `dbTopicSplitChar` Separator between the database and Topic portions. * **Type**: `string` * **Default**: Empty string * **Importance**: Low * **Valid Values / Notes**: Used only with `enableDbTopicSplit=true`. Recommended values are `_`, `-`, or `.`; the value is treated as a literal separator, not a regular expression. #### `suppressTableExistenceException` Suppresses exceptions when a target table does not exist. * **Type**: `boolean` * **Default**: `false` * **Importance**: Low * **Valid Values / Notes**: When enabled, records for missing tables may be ignored while Offsets continue to advance. This neither creates tables nor waits for them to appear. Keep it disabled in pipelines that require complete delivery. ### Value Formats and Field Processing #### `value.converter` Deserializes Kafka message values into Connect data. * **Type**: `class` * **Default**: `null` * **Importance**: Low * **Valid Values / Notes**: `null` uses the Worker's Converter. The class must implement Converter. Struct values with schemas, schemaless Map values, and String values use different write paths. Avro or Protobuf requires the corresponding Converter and dependencies to be supplied separately. #### `customInsertFormat` Custom format option for string input. * **Type**: `boolean` * **Default**: `false` * **Importance**: Low * **Valid Values / Notes**: This setting affects recommended format values in the configuration interface, rather than independently controlling the actual write path. The actual string format is determined by `insertFormat`. #### `insertFormat` Specifies the insertion format for String values. * **Type**: `string` * **Default**: `none` * **Importance**: Low * **Valid Values / Notes**: Explicitly select `CSV`, `TSV`, or `JSON` for string input; JSON uses JSONEachRow. `NONE` cannot write strings. Do not rely on unknown values falling back to JSON. CSV/TSV field order must match the target table's input order. #### `bypassRowBinary` Switches records with schemas from binary writes to JSONEachRow. * **Type**: `boolean` * **Default**: `false` * **Importance**: Low * **Valid Values / Notes**: Does not change the Converter or automatically fill in fields. The default schema-based path uses RowBinary or RowBinaryWithDefaults. #### `dateTimeFormats` Specifies parsing patterns for date-time fields. * **Type**: `list` * **Default**: Empty list * **Importance**: Low * **Valid Values / Notes**: The actual input uses semicolons to separate multiple `field=pattern` entries, such as `created_at=yyyy-MM-dd HH:mm:ss;updated_at=yyyy-MM-dd HH:mm:ss`. Patterns follow Java DateTimeFormatter syntax. Invalid patterns cause configuration reading to fail. #### `bypassFieldCleanup` Retains top-level fields that do not belong to the target table in the JSON write path. * **Type**: `boolean` * **Default**: `false` * **Importance**: Low * **Valid Values / Notes**: When disabled, extra top-level fields are removed according to the target columns. When enabled, server-side `input_format_skip_unknown_fields` and type checks still apply. #### `debeziumCDCEnabled` Converts Debezium Envelopes into versioned target rows. * **Type**: `boolean` * **Default**: `false` * **Importance**: Medium * **Valid Values / Notes**: Requires Struct values whose schema names end in `.Envelope`. Use `ReplacingMergeTree(_version, is_deleted)` for the target table and design the sorting key around the business primary key. Delete events (`op=d`) use `before` and write `is_deleted=1`; create, snapshot read, and update events (`op=c/r/u`) use `after` and write `is_deleted=0`. Both add `_version`. Truncate events (`op=t`) cannot clear the target table. Delete markers do not execute SQL DELETE or guarantee immediate physical deletion. ### Table Structure and Automatic Column Addition #### `tableRefreshInterval` Periodically refreshes target table metadata. * **Type**: `long` * **Default**: `0` * **Importance**: Low * **Valid Values / Notes**: `0` to `600`, in seconds. `0` disables periodic refresh. Existing tables are primarily reread when the column count increases; tracking column type changes, removals, or renames is not guaranteed. #### `bypassSchemaValidation` Skips schema alignment checks between records and the target table. * **Type**: `boolean` * **Default**: `false` * **Importance**: Low * **Valid Values / Notes**: Skips only the Connector's checks, not serialization constraints or ClickHouse type validation. Do not use it to fix incompatible data. #### `auto.evolve` Adds missing columns to the target table based on the input schema. * **Type**: `boolean` * **Default**: `false` * **Importance**: Medium * **Valid Values / Notes**: Intended for structured records with actual Connect schemas. Do not rely on schemaless JSON or String values to infer business types automatically. Requires ALTER permission. Does not create business tables, change existing column types, or remove columns. Fields are checked using the last record in each write batch; keep schema evolution ordered consistently within batches. #### `auto.evolve.ddl.refresh.retries` Number of retries to wait for new column metadata to become visible after automatic column addition. * **Type**: `int` * **Default**: `3` * **Importance**: Low * **Valid Values / Notes**: At least `0`. Controls only metadata refresh after DDL, not a unified retry count for write requests or framework errors. #### `auto.evolve.struct.to.json` Infers Connect STRUCT values as ClickHouse JSON columns during automatic column addition. * **Type**: `boolean` * **Default**: `false` * **Importance**: Medium * **Valid Values / Notes**: Applies only to automatic evolution type mapping. The server must support the JSON type and related settings. For binary writes to JSON columns, also set `input_format_binary_read_json_as_string=1` or `true` in `clickhouseSettings`. #### `clusterName` Specifies the ClickHouse cluster for automatic evolution DDL. * **Type**: `string` * **Default**: Empty string * **Importance**: Medium * **Valid Values / Notes**: A nonempty value adds `ON CLUSTER`; an empty string runs local DDL only. Requires a valid cluster and DDL permissions. Specify only a trusted cluster name, not SQL fragments. Independent of `keeperOnCluster`. ### Batching and Internal Buffering #### `ignorePartitionsWhenBatching` Combines records from different partitions of the same Topic for writes. * **Type**: `boolean` * **Default**: `false` * **Importance**: Low * **Valid Values / Notes**: Used with `exactlyOnce=false`. With `exactlyOnce=true` and no buffering, this option is not used; with buffering enabled, setting it to `true` causes Task startup to fail. Does not provide global ordering across partitions. #### `bufferCount` Record-count threshold for accumulation across multiple consumption calls. * **Type**: `int` * **Default**: `0` * **Importance**: Low * **Valid Values / Notes**: At least `0`. `0` disables internal buffering. In non-exactly-once mode, reaching the total count threshold triggers a flush; the threshold is not a maximum batch size. In exactly-once mode, complete, fixed-size batches are sent per Topic/partition, requiring `bufferFlushTime=0` and `ignorePartitionsWhenBatching=false`. Remaining records below the count continue to wait. #### `bufferFlushTime` Time threshold for triggering an internal buffer flush. * **Type**: `long` * **Default**: `0` * **Importance**: Low * **Valid Values / Notes**: At least `0`, in milliseconds. `0` disables time-based triggering. Effective only with `bufferCount>0`. The time condition is checked during Task processing calls; it is not a promise of independently scheduled flushing. Must remain `0` in exactly-once buffering mode. ### State, Deduplication, and Offsets #### `exactlyOnce` Enables the KeeperMap-based persistent-state and batch-deduplication path. * **Type**: `boolean` * **Default**: `false` * **Importance**: Low * **Valid Values / Notes**: Records state before and after processing per Topic/partition. Replay deduplication depends on an available KeeperMap, target engine deduplication support and a valid window, stable data and batch boundaries, and reliable insertion acknowledgment. Enabling this option alone does not establish an unconditional exactly-once guarantee. Data writes and state writes are not a single transaction; cross-table or cross-partition atomicity is not provided. #### `zkPath` KeeperMap state storage path. * **Type**: `string` * **Default**: `/kafka-connect` * **Importance**: Low * **Valid Values / Notes**: Must not be blank and must start with `/`. Used for state storage with `exactlyOnce=true`; plan state isolation. #### `zkDatabase` KeeperMap state table name. * **Type**: `string` * **Default**: `connect_state` * **Importance**: Low * **Valid Values / Notes**: Despite the name Database, this is a state table identifier, not a separate database creation setting. Use a valid, trusted table name. #### `keeperOnCluster` Specifies the ClickHouse cluster used for the Keeper state table. * **Type**: `string` * **Default**: Empty string * **Importance**: Low * **Valid Values / Notes**: Used for persistent-state scenarios in self-hosted clusters. Not equivalent to `clusterName` for business table DDL. #### `tolerateStateMismatch` Tolerates certain mismatches between batch ranges and existing state. * **Type**: `boolean` * **Default**: `false` * **Importance**: Low * **Valid Values / Notes**: Some records behind existing state may be skipped. This is not a switch for reinserting data after an Offset rollback and does not guarantee correction of all state errors. Evaluate data completeness before enabling it. #### `reportInsertedOffsets` Makes the direct-write strategy report Offsets for processed write ranges before committing. * **Type**: `boolean` * **Default**: `false` * **Importance**: Low * **Valid Values / Notes**: The internal buffering strategy maintains flushed ranges itself and is not controlled by this setting. Non-exactly-once cross-partition batching still uses the Worker's current Offsets. Error tolerance and missing-table suppression can make "processed" differ from "actually inserted"; this setting is not proof of successful insertion for each row. ### Timeouts and Error Handling #### `timeoutSeconds` Timeout for ClickHouse driver operations. * **Type**: `int` * **Default**: `30` * **Importance**: Low * **Valid Values / Notes**: `0` to `600`, in seconds. Configured separately from the insert-response wait limit `clickhouseClientInsertTimeoutMs`. #### `retryCount` Retry count for ClickHouse client auxiliary operations. * **Type**: `int` * **Default**: `3` * **Importance**: Low * **Valid Values / Notes**: `3` to `10`. Affects auxiliary operations such as connection probes and queries, not a unified maximum retry count for all INSERT operations. #### `clickhouseClientInsertTimeoutMs` Maximum wait for a single insert response with the V2 client. * **Type**: `long` * **Default**: `240000` * **Importance**: Low * **Valid Values / Notes**: At least `100`, in milliseconds. V1 inserts do not use this separate wait limit. It should be shorter than the consumer's effective `max.poll.interval.ms`, with headroom for processing and retries. A timeout or canceled wait does not prove that the server did not accept the data. #### `consumer.override.max.poll.interval.ms` Overrides the maximum interval between consecutive polls by the Sink consumer. * **Type**: `int` * **Default**: No independent Connector-level default; the underlying client default is `300000` * **Importance**: Medium * **Valid Values / Notes**: At least `1`, in milliseconds. Worker consumer configuration can change the effective value; whether an override is allowed depends on the Worker's client override policy. Set it longer than the insert wait time, with headroom, to avoid rebalances during slow writes. #### `errors.retry.timeout` Total retry duration for retriable Kafka Connect framework errors. * **Type**: `long` * **Default**: `0` * **Importance**: Medium * **Valid Values / Notes**: In milliseconds. `0` disables retries; `-1` retries indefinitely. Applies only to the corresponding framework retriable-processing paths, not a guarantee of automatic retries for all ClickHouse write errors. Does not replace `retryCount`. #### `errors.tolerance` Controls the error tolerance policy. * **Type**: `string` * **Default**: `none` * **Importance**: Low * **Valid Values / Notes**: `none` or `all`. The framework setting with the same name has Medium importance. `all` can skip tolerated errors and continue advancing; it is not a retry switch. Plugin write failures may be reported for an entire group and must not be treated as precise, per-row isolation of bad records. Without an available DLQ, skipped data is not necessarily durably stored. #### `errors.deadletterqueue.topic.name` Specifies a dead-letter queue Topic for error reporting. * **Type**: `string` * **Default**: Empty string * **Importance**: Medium * **Valid Values / Notes**: An empty string disables DLQ recording. Requires an error tolerance policy and the Worker's error reporting mechanism; the Topic must not be subscribed to by this Connector. Configuring a Topic name does not mean reports have been persisted successfully. Check actual DLQ writes and their errors. ## Best Practices ### Writing Multiple Business Event Streams to Existing Analytics Tables Applicable business scenario: Order events and payment events use different Kafka Topics, while ClickHouse already has analytics tables with established names. You want to retain those table names without requiring the Topics and tables to share names. Configuration example: Override `topics` in the Quick Start configuration and add the following mapping. Both tables are in the database specified in Quick Start and must be created in advance to match their respective event structures. ```properties theme={null} topics=, topic2TableMap==,= ``` Key considerations: Mapping only selects the write destination. It neither merges the field structures of the two Topics nor creates tables automatically. This suits scenarios where each stream maintains its own data model. Unmapped Topics still use tables with the same name, so prepare the corresponding target tables before expanding the subscription scope. ### Accumulating Sparse Events to Reduce Small-Batch Writes Applicable business scenario: Behavioral or application events arrive continuously, but each consumption call returns only a few records. You want to accumulate them before writing to ClickHouse to reduce frequent small-batch inserts, while giving low-volume records opportunities to flush during subsequent processing calls. Configuration example: Add the following settings to the Quick Start configuration. This approach stays in non-exactly-once mode and must not be mixed with the persistent-state deduplication buffering approach. ```properties theme={null} bufferCount=1000 bufferFlushTime=1000 ``` Key considerations: Flushing occurs when the count threshold is reached or a Task processing call checks that the time threshold has elapsed. `1000` milliseconds is not a strict upper bound on insertion latency, and no independent background timer guarantees insertion at that time. A single consumption call can return more records than the count threshold; final writes are still grouped by Topic/partition. Adjust the count and time based on event size, Worker memory, and acceptable latency, and check actual visibility latency. This approach does not eliminate replay duplicates and does not guarantee exactly-once recovery. ## Monitoring ### What to Monitor Monitor Kafka Connect cluster health, Connector and Task running and failed states, consumption and write throughput, consumer backlog and end-to-end latency, Offset commit progress and failures, changes in errors and retries, and Worker JVM heap, GC, and thread signals. When error tolerance and DLQ reporting are enabled, also monitor DLQ activity and reporting failures so that a continuously running Task is not mistaken for complete insertion of all data. ### Import the Grafana Dashboard Download the shared [Kafka Connect Grafana Dashboard](https://automq-download-center.oss-cn-hangzhou.aliyuncs.com/connect-dashboard/automq-connect-cluster-dashboard.json). Ensure that Kafka Connect metrics are collected into a Prometheus-compatible data source and that labels such as cluster, Worker, Connector, and Task match the dashboard queries. Import the JSON file into Grafana and select the corresponding data source. ## Limitations * The Connector does not automatically create business databases or tables; automatic evolution only adds missing columns. * Kafka tombstones do not trigger deletions in target tables, and ordinary writes do not execute key-based SQL UPDATE or DELETE. * Input values must be converted to supported Struct, Map, String, or null values. Direct writes of arbitrary Connect primitive scalars are not supported. * Global ordering across partitions or Tasks is not provided, and target query results are not guaranteed to follow insertion order. * Data writes and Keeper state writes are not a single transaction; cross-table and cross-partition atomic transactions are not provided. * Exactly-once internal buffering does not support time-triggered flushing or cross-partition batching. Remaining records below the count threshold are not forcibly written on commit, close, or stop. * Automatic column addition does not change existing column types or remove columns, and periodic metadata refresh is not an automatic adaptation mechanism for arbitrary table structure changes. ## FAQ ### A Task Cannot Connect to ClickHouse or Cannot Find a Table at Startup Check whether `hostname` incorrectly includes a protocol, whether `port` is an HTTP/HTTPS port, and whether `ssl` matches the server. Specify `ssl` and `client_version` explicitly to avoid connection effects from fallback behavior when parameters are omitted. Confirm that the server meets the version requirement, the account can read table metadata, and the target table already exists under `database`. When using mappings, check the Topic and table names. Do not enable `suppressTableExistenceException` to hide missing-table issues; create or correct the target table first. ### JSON Input Produces Format or Field Type Errors Determine whether messages are ordinary JSON objects or Connect JSON with a `schema` / `payload` wrapper. For ordinary objects, use the Quick Start JsonConverter and disable schema-wrapper parsing. Check target column names, types, and DEFAULT or Nullable definitions for missing fields. StringConverter input also requires an explicit `insertFormat`. Do not simply enable `bypassSchemaValidation`; it does not make ClickHouse accept incompatible types. ### Small Amounts of Data Remain Invisible After Buffering Is Enabled Check whether the record count has reached `bufferCount`. In non-exactly-once mode, you can set a nonzero `bufferFlushTime`, but the time condition is checked only during subsequent Task processing calls. If the business requires data to become visible promptly, disable internal buffering. Exactly-once buffering writes only complete, fixed-size batches and does not support time-based flushing. Reduce the count threshold or disable buffering rather than adding conflicting time-trigger settings. ### Duplicate Rows Appear After a Restart A failure window exists between successful insertion and Kafka Offset commit, so replay can insert data again. An ordinary MergeTree sorting key does not provide a uniqueness constraint. First check commit failures, rebalances, and timeouts, and determine whether the server has already accepted the request. If persistent-state deduplication is needed, evaluate KeeperMap, target engine deduplication conditions and windows, stable batches, and insertion acknowledgment. Do not assume duplicates are impossible merely by setting `exactlyOnce=true` or a custom deduplication token. ### State Mismatches Appear After Rolling Back Offsets Persistent state still retains processed ranges; an external Offset rollback does not automatically coordinate KeeperMap. Stop writes first, compare the required replay range with the corresponding Topic/partition state, and then plan state cleanup or a separate replay approach while evaluating duplicate risks. `tolerateStateMismatch=true` may skip older ranges; it is not a repair switch for reimporting historical data. ### A Task Keeps Running but Data Is Missing or the DLQ Has No Records Check whether `errors.tolerance=all` or missing-table exception suppression is enabled. Either can advance records as processed even when they were not inserted. Confirm that the DLQ Topic is outside the subscription scope and the Worker's error reporting mechanism is available. Check reporting permissions, send errors, and actual messages; configuring a Topic name does not guarantee successful report persistence. When complete delivery is required, keep failures visible, fix the root cause, and arrange replay using confirmed Offset ranges. # Couchbase Sink Connector Source: https://docs.automq.com/automq-cloud/kafka-connect/sink-connectors/couchbase-kafka-connect-couchbase-sink-connector Configure and operate the Couchbase Sink Connector in AutoMQ Connect, including prerequisites, configuration, monitoring, and troubleshooting. ## Overview Couchbase Sink Connector consumes records from Kafka topics and writes them to Couchbase. The default handler converts non-null record values to JSON documents and performs full-document upserts; tombstone records delete the corresponding documents. The Connector also supports N1QL, Analytics, and sub-document handlers for conditional updates, analytical data writes, and partial document changes. The Connector can route records by Kafka topic to different Couchbase Buckets, Scopes, and Collections. A document ID can come from a business field in the message value, the Kafka record key, or a combination of topic, partition, and offset. Kafka Connect advances the offset for a batch only after the target write completes, but the Couchbase write and Kafka offset commit do not form a cross-system transaction. ## Prerequisites * For the default KV, N1QL, and sub-document handlers, the target Bucket, Scope, and Collection must already exist, and the connection account must have the corresponding read and write permissions; when using the Analytics handler, a usable Couchbase Analytics service and target dataset are also required. * When using TLS, prepare a trusted PEM CA certificate or Java truststore; when using mutual TLS, also prepare the client certificate bundle and its password. * The Couchbase node addresses used by `couchbase.seed.nodes` must be accessible from the Connect Worker; when specifying a custom port, use the KV port. ## License Uses Apache License 2.0. ## Quick Start Prepare a Connect Cluster, Kafka, the target Couchbase Bucket, and Collection in advance, and confirm network connectivity and access permissions. For preparation and management operations, see [Manage Connectors](../manage-connectors). ```properties theme={null} connector.class=com.couchbase.connect.kafka.CouchbaseSinkConnector topics= couchbase.seed.nodes= couchbase.username= couchbase.password= couchbase.bucket= ``` Replace ``, ``, ``, ``, and `` with the actual values. The default handler writes non-null records to the `_default._default` Collection in the target Bucket; to use another Scope or Collection, add `couchbase.default.collection`. ## Configuration ### Kafka Input and Tasks #### `connector.class` Specifies the Couchbase Sink Connector implementation class to load. * **Type**: `string` * **Default**: None * **Importance**: High * **Valid values / notes**: Use `com.couchbase.connect.kafka.CouchbaseSinkConnector`. * **Required**: Yes #### `topics` Specifies the list of Kafka topics consumed by the Connector. * **Type**: `list` * **Default**: Empty list * **Importance**: High * **Valid values / notes**: Use comma-separated topic names; exactly one non-empty value must be configured between `topics` and `topics.regex`. #### `topics.regex` Uses a Java regular expression to select the Kafka topics consumed by the Connector. * **Type**: `string` * **Default**: Empty string * **Importance**: High * **Valid values / notes**: Enter a valid Java Pattern; exactly one non-empty value must be configured between `topics` and `topics.regex`. #### `tasks.max` Specifies the maximum number of Tasks that Kafka Connect can start for this Connector. * **Type**: `int` * **Default**: `1` * **Importance**: High * **Valid values / notes**: Must be at least `1`; effective parallelism is also limited by the number of input partitions and Couchbase processing capacity. #### `key.converter` Specifies the Connector-level Converter for Kafka record keys. * **Type**: `class` * **Default**: `null`, inherited from the Worker configuration * **Importance**: Low * **Valid values / notes**: Use an instantiable Kafka Connect Converter; the record key can be used as a fallback source for the Couchbase document ID. #### `value.converter` Specifies the Connector-level Converter for Kafka record values. * **Type**: `class` * **Default**: `null`, inherited from the Worker configuration * **Importance**: Low * **Valid values / notes**: Use a Converter compatible with the input data; the conversion result must be serializable as JSON by the Connector. ### Couchbase Connection and Authentication #### `couchbase.seed.nodes` Specifies the seed nodes used to discover the Couchbase cluster. * **Type**: `list` * **Default**: None * **Importance**: High * **Valid values / notes**: Enter one or more accessible node addresses separated by commas; a custom port must be the KV port. * **Required**: Yes #### `couchbase.username` Specifies the Couchbase username used for password authentication. * **Type**: `string` * **Default**: None * **Importance**: High * **Valid values / notes**: Configuration parsing requires this value; when client certificate authentication is used, the value is ignored at runtime. * **Required**: Yes #### `couchbase.password` Specifies the Couchbase password used for password authentication. * **Type**: `password` * **Default**: None * **Importance**: High * **Valid values / notes**: Configuration parsing requires this value; the environment variable `KAFKA_COUCHBASE_PASSWORD` can override it after parsing. When client certificate authentication is used, the value is ignored at runtime. * **Required**: Yes #### `couchbase.bucket` Specifies the default target Bucket and the default Bucket for a Collection Keyspace that omits the Bucket. * **Type**: `string` * **Default**: Empty string * **Importance**: High * **Valid values / notes**: Handlers that use KV Collections must configure an existing and accessible Bucket; the Analytics handler may omit it. #### `couchbase.network` Selects the cluster address network view used by the Couchbase SDK. * **Type**: `string` * **Default**: `auto` * **Importance**: Medium * **Valid values / notes**: Can be `auto`, `default`, or `external`. #### `couchbase.bootstrap.timeout` Sets the maximum time to wait for a Couchbase connection during startup. * **Type**: `string` * **Default**: `30s` * **Importance**: Medium * **Valid values / notes**: Use a non-negative integer followed by `ms`, `s`, `m`, `h`, or `d`; `0` is also allowed. ### TLS and Certificates #### `couchbase.enable.tls` Controls whether to enable TLS for Couchbase connections. * **Type**: `boolean` * **Default**: `false` * **Importance**: Medium * **Valid values / notes**: Can be `true` or `false`; secure endpoints should enable TLS and configure appropriate trust material. #### `couchbase.enable.hostname.verification` Controls whether to verify the hostname in the TLS server certificate. * **Type**: `boolean` * **Default**: `true` * **Importance**: Medium * **Valid values / notes**: Can be `true` or `false`; disabling it weakens server identity verification. #### `couchbase.trust.store.path` Specifies the absolute path to the Java KeyStore containing trusted Couchbase CAs. * **Type**: `string` * **Default**: Empty string * **Importance**: Medium * **Valid values / notes**: The path must be readable; this is the trust-material alternative to `couchbase.trust.certificate.path`. #### `couchbase.trust.store.password` Specifies the truststore password. * **Type**: `password` * **Default**: Empty string * **Importance**: Medium * **Valid values / notes**: Provide the value required by the truststore; the environment variable `KAFKA_COUCHBASE_TRUST_STORE_PASSWORD` can override it. #### `couchbase.trust.certificate.path` Specifies the absolute path to a trusted Couchbase CA PEM certificate. * **Type**: `string` * **Default**: Empty string * **Importance**: Medium * **Valid values / notes**: The path must be readable; this is the PEM alternative to `couchbase.trust.store.path`. #### `couchbase.client.certificate.path` Specifies the path to a Java KeyStore or PKCS12 file containing the client private key and certificate chain. * **Type**: `string` * **Default**: Empty string * **Importance**: Medium * **Valid values / notes**: Setting a non-empty value selects client certificate authentication and causes the username and password to be ignored at runtime. #### `couchbase.client.certificate.password` Specifies the client certificate bundle password. * **Type**: `password` * **Default**: Empty string * **Importance**: Medium * **Valid values / notes**: Provide the value required by the certificate bundle; the environment variable `KAFKA_COUCHBASE_CLIENT_CERTIFICATE_PASSWORD` can override it. ### Routing and Document IDs #### `couchbase.default.collection` Specifies the default target Keyspace and allows per-Kafka-topic overrides. * **Type**: `string` * **Default**: `_default._default` * **Importance**: Medium * **Valid values / notes**: Use `scope.collection` or `bucket.scope.collection`; when the Bucket is omitted, `couchbase.bucket` is used. For a per-topic override, use `couchbase.default.collection[]`; topics without an override inherit the base value. #### `couchbase.topic.to.collection` Uses the legacy mapping to specify a target Keyspace by Kafka topic. * **Type**: `list` * **Default**: Empty list * **Importance**: Medium * **Valid values / notes**: Entries use the format `topic=scope.collection` or `topic=bucket.scope.collection`; prefer `couchbase.default.collection[]`. * **Deprecation status**: Deprecated * **Replacement**: `couchbase.default.collection[]` #### `couchbase.document.id` Sets the format used to extract a Couchbase document ID from the record value. * **Type**: `string` * **Default**: Empty string * **Importance**: Medium * **Valid values / notes**: JSON Pointer placeholders such as `${/id}` or `prefix::${/id}` can be used. When the value is empty or extraction fails, the Connector falls back to the Kafka record key and then to the topic, partition, and offset. For a per-topic override, use `couchbase.document.id[]`. #### `couchbase.topic.to.document.id` Uses the legacy mapping to specify a document ID format by Kafka topic. * **Type**: `list` * **Default**: Empty list * **Importance**: Medium * **Valid values / notes**: Entries use the format `topic=`; each entry can contain only one mapping separator. Prefer `couchbase.document.id[]`. * **Deprecation status**: Deprecated * **Replacement**: `couchbase.document.id[]` #### `couchbase.remove.document.id` Controls whether to remove the field used to generate the document ID from the written document. * **Type**: `boolean` * **Default**: `false` * **Importance**: Medium * **Valid values / notes**: Meaningful only when all JSON Pointers in `couchbase.document.id` are extracted successfully. For a per-topic override, use `couchbase.remove.document.id[]`. #### `couchbase.document.expiration` Sets the document expiration time. * **Type**: `string` * **Default**: `0` * **Importance**: Medium * **Valid values / notes**: Use a non-negative integer followed by `ms`, `s`, `m`, `h`, or `d`; `0` means no expiration. For a per-topic override, use `couchbase.document.expiration[]`. ### Write Handling and Retries #### `couchbase.sink.handler` Specifies the SinkHandler implementation that converts Sink records into Couchbase operations. * **Type**: `class` * **Default**: `com.couchbase.connect.kafka.handler.sink.UpsertSinkHandler` * **Importance**: Medium * **Valid values / notes**: Use a loadable SinkHandler class with an accessible constructor; a `couchbase.document.mode` other than `DOCUMENT` overrides this value. #### `couchbase.document.mode` Selects document, sub-document, or N1QL handling through the compatibility mode. * **Type**: `string` * **Default**: `DOCUMENT` * **Importance**: Medium * **Valid values / notes**: Can be `DOCUMENT`, `SUBDOCUMENT`, or `N1QL`; `N1QL` and `SUBDOCUMENT` override `couchbase.sink.handler`. * **Deprecation status**: Deprecated * **Replacement**: `couchbase.sink.handler` #### `couchbase.retry.timeout` Sets the total time window for the Connector to retry failed writes. * **Type**: `string` * **Default**: `0` * **Importance**: Medium * **Valid values / notes**: Use a non-negative integer followed by `ms`, `s`, `m`, `h`, or `d`; `0` means no retry. This setting differs from Kafka Connect's `errors.retry.timeout`; on failure, the entire batch may be replayed. ### Write Durability #### `couchbase.durability` Sets the enhanced durability level for Couchbase Server 6.5 or later. * **Type**: `string` * **Default**: `NONE` * **Importance**: Medium * **Valid values / notes**: Can be `NONE`, `MAJORITY`, `MAJORITY_AND_PERSIST_TO_ACTIVE`, or `PERSIST_TO_MAJORITY`. A non-`NONE` value cannot be used together with a non-`NONE` `couchbase.persist.to` or `couchbase.replicate.to`. #### `couchbase.persist.to` Sets the disk-persistence requirement for older Couchbase Server versions. * **Type**: `string` * **Default**: `NONE` * **Importance**: Medium * **Valid values / notes**: Can be `NONE`, `ACTIVE`, `ONE`, `TWO`, `THREE`, or `FOUR`, and the cluster topology must be able to satisfy the requirement. For Couchbase Server 6.5 or later, prefer `couchbase.durability`. #### `couchbase.replicate.to` Sets the in-memory replica confirmation requirement for older Couchbase Server versions. * **Type**: `string` * **Default**: `NONE` * **Importance**: Medium * **Valid values / notes**: Can be `NONE`, `ONE`, `TWO`, or `THREE`, and the cluster topology must be able to satisfy the requirement. For Couchbase Server 6.5 or later, prefer `couchbase.durability`. ### N1QL Handler #### `couchbase.n1ql.operation` Selects the update method used by `N1qlSinkHandler`. * **Type**: `string` * **Default**: `UPDATE` * **Importance**: Medium * **Valid values / notes**: Can be `UPDATE` or `UPDATE_WHERE`; applies only to `N1qlSinkHandler`. #### `couchbase.n1ql.where.fields` Specifies the fields and optional literals used to construct the `UPDATE_WHERE` condition. * **Type**: `list` * **Default**: Empty list * **Importance**: Medium * **Valid values / notes**: Use field names or `field:literal` entries; a non-empty list is required when `UPDATE_WHERE` is selected. #### `couchbase.n1ql.create.document` Controls whether N1QL `UPDATE` mode creates a missing document through MERGE. * **Type**: `boolean` * **Default**: `true` * **Importance**: Medium * **Valid values / notes**: Applies only to `UPDATE` mode of `N1qlSinkHandler`. ### Analytics Handler #### `couchbase.analytics.max.records.in.batch` Sets the maximum number of records in each Analytics UPSERT or DELETE statement batch. * **Type**: `int` * **Default**: `100` * **Importance**: Medium * **Valid values / notes**: ConfigDef accepts any 32-bit integer; in practice, use a positive integer. This setting has not been committed as a stable interface. #### `couchbase.analytics.max.size.in.batch` Sets the maximum total number of bytes for document data in an Analytics UPSERT batch. * **Type**: `string` * **Default**: `5m` * **Importance**: Medium * **Valid values / notes**: Use a non-negative integer followed by `b`, `k`, `m`, or `g`; in practice, use a positive size limit. This setting has not been committed as a stable interface. #### `couchbase.analytics.query.timeout` Sets the client timeout for Analytics query requests. * **Type**: `string` * **Default**: `5m` * **Importance**: Medium * **Valid values / notes**: Use a non-negative integer followed by `ms`, `s`, `m`, `h`, or `d`; `0` is also allowed. This setting has not been committed as a stable interface. ### Sub-Document Handler #### `couchbase.subdocument.path` Specifies the sub-document path modified by `SubDocumentSinkHandler`. * **Type**: `string` * **Default**: Empty string * **Importance**: Medium * **Valid values / notes**: Use a non-empty path; an ordinary value represents a fixed path, while a value beginning with `/` represents a JSON Pointer that extracts a dynamic path from each message. #### `couchbase.subdocument.operation` Selects the sub-document mutation operation. * **Type**: `string` * **Default**: `UPSERT` * **Importance**: Medium * **Valid values / notes**: Can be `UPSERT`, `ARRAY_PREPEND`, or `ARRAY_APPEND`; applies only to `SubDocumentSinkHandler`. #### `couchbase.subdocument.create.path` Controls whether a sub-document mutation creates missing parent paths. * **Type**: `boolean` * **Default**: `true` * **Importance**: Medium * **Valid values / notes**: Can be `true` or `false`; when `couchbase.subdocument.create.document=true`, setting this to `false` does not change document creation behavior. #### `couchbase.subdocument.create.document` Controls whether a sub-document mutation creates a target document that does not exist. * **Type**: `boolean` * **Default**: `true` * **Importance**: Medium * **Valid values / notes**: `true` uses UPSERT storage semantics, and `false` uses REPLACE storage semantics. #### `couchbase.create.document` Provides a legacy compatibility alias for document creation behavior for the N1QL or sub-document handlers. * **Type**: `boolean` * **Default**: No fixed default * **Importance**: Medium * **Valid values / notes**: Copied to the handler setting only when the corresponding current setting is not configured. * **Deprecation status**: Deprecated * **Replacement**: `couchbase.n1ql.create.document` or `couchbase.subdocument.create.document` ### Logging and Metrics #### `couchbase.log.redaction` Sets the redaction level for Couchbase log markers. * **Type**: `string` * **Default**: `NONE` * **Importance**: Medium * **Valid values / notes**: Can be `NONE`, `PARTIAL`, or `FULL`. #### `couchbase.log.document.lifecycle` Controls whether document lifecycle messages are promoted to the INFO level. * **Type**: `boolean` * **Default**: `false` * **Importance**: Medium * **Valid values / notes**: Can be `true` or `false`; enabling it may produce a high volume of logs. #### `couchbase.metrics.interval` Sets the interval at which the Connector writes metric snapshots to the log. * **Type**: `string` * **Default**: `10m` * **Importance**: Medium * **Valid values / notes**: Use a non-negative integer followed by `ms`, `s`, `m`, `h`, or `d`; `0` disables metric logging. This setting has not been committed as a stable interface. ### SDK Extensions #### `couchbase.env.*` Passes Couchbase Java SDK properties to `ClusterEnvironment`. * **Type**: `SDK-dependent` * **Default**: `SDK default` * **Importance**: Medium * **Valid values / notes**: After `couchbase.env.`, enter the SDK property name with the `com.` prefix removed; an invalid property causes Task startup to fail. This pattern is not a fixed configuration item in the Connector ConfigDef. ## Best Practices ### Update the Same Document by a Stable Business Key **Applicable business scenario**: When first connecting a continuously changing business entity, the message value already contains a stable and unique business ID. Repeated deliveries and later updates must continue to affect the same Couchbase document instead of creating multiple documents from Kafka record coordinates. **Configuration example**: ```properties theme={null} connector.class=com.couchbase.connect.kafka.CouchbaseSinkConnector topics=orders couchbase.seed.nodes= couchbase.username= couchbase.password= couchbase.bucket= couchbase.document.id=${/orderId} couchbase.remove.document.id=true ``` **Key notes**: `${/orderId}` extracts the document ID from the scalar field in the message value. The example also removes the field from the stored body; if the business still needs to query that field, retain the default `false`. If the field is missing, `null`, or not scalar, the Connector falls back to the Kafka key or record coordinates, so ensure before onboarding that the business ID is complete and stable. ### Route Multiple Topics to Different Collections **Applicable business scenario**: After connecting a single data stream, one Connector needs to consume multiple business topics and continuously write each business domain to its own Couchbase Collection while reusing the connection and authentication settings. **Configuration example**: ```properties theme={null} connector.class=com.couchbase.connect.kafka.CouchbaseSinkConnector topics=orders,payments couchbase.seed.nodes= couchbase.username= couchbase.password= couchbase.bucket= couchbase.default.collection\u005Borders\u005D=sales.orders couchbase.default.collection\u005Bpayments\u005D=sales.payments ``` **Key notes**: Java properties parses `\u005B` and `\u005D` as `[` and `]`, respectively, so the example actually uses `couchbase.default.collection[orders]` and `couchbase.default.collection[payments]`. The per-topic context configuration overrides the default Collection without a suffix; the target Scope and Collection must be created in advance. This routing is based only on the original Kafka topic and does not select a Collection dynamically from a partition or message field. ### Set Limited Retries and a Durability Level for Production Writes **Applicable business scenario**: The Connector already writes reliably, but transient network or target-side failures should not cause immediate failure, and Couchbase should treat a write as complete only after the specified replica confirmation condition is reached. **Configuration example**: ```properties theme={null} connector.class=com.couchbase.connect.kafka.CouchbaseSinkConnector topics= couchbase.seed.nodes= couchbase.username= couchbase.password= couchbase.bucket= couchbase.retry.timeout=2m couchbase.durability=MAJORITY ``` **Key notes**: `2m` is an example retry window; adjust it based on the recovery objective and alert response time. The Connector does not distinguish transient errors from permanent data errors, so an overly long window can delay exposure of bad records. `MAJORITY` requires support from the target cluster and enough available replicas. Retries may re-execute a partially successful batch, and this configuration does not provide exactly-once guarantees between Kafka offset commits and Couchbase writes; when using array appends, conditional updates, or custom non-idempotent handlers, evaluate duplicate side effects separately. ## Monitoring ### What to Monitor Monitor Kafka Connect health, Connector and Task status, throughput, latency, offset commits, errors, retries, and Worker JVM heap, GC, thread, and CPU signals; monitor DLQ activity only when the corresponding error handling is enabled in the deployment. ### Import the Grafana Dashboard Confirm that Kafka Connect metrics are connected to a Grafana data source and that the collected labels meet the dashboard filtering requirements; download the [Kafka Connect Dashboard](https://automq-download-center.oss-cn-hangzhou.aliyuncs.com/connect-dashboard/automq-connect-cluster-dashboard.json), import the JSON in Grafana, and select the corresponding data source. ## Limitations * Couchbase writes and Kafka offset commits do not form an atomic transaction; if a failure occurs after the write succeeds but before the offset is committed, the record may be replayed after recovery, so end-to-end exactly-once guarantees are not provided. * Different Tasks do not coordinate write ordering; records from different Kafka partitions that map to the same document ID can be written concurrently, so no global ordering across partitions, Tasks, or documents is guaranteed. * The default handler performs full-document upserts rather than field merges; a later record with the same document ID replaces the target document with the new complete JSON. * Sub-document array append and prepend operations are not idempotent under replay; a partially successful batch retry may insert the same element again. * Kafka Connect per-record error tolerance and DLQ handling do not automatically handle Couchbase Handler or write errors that occur inside `SinkTask.put`. * When `couchbase.durability` is not `NONE`, both `couchbase.persist.to` and `couchbase.replicate.to` must be `NONE`. ## FAQ ### Why was the same business entity written as multiple documents? When `couchbase.document.id` does not successfully extract the business ID and the Kafka record key is empty or has an unsupported type, the Connector generates a fallback ID from the topic, partition, and offset. Check that the message always contains a stable scalar business field or a stable Kafka key; when extracting from the message value, configure for example `couchbase.document.id=${/orderId}` and confirm that the field is not missing, `null`, an object, or an array. ### Why was the record written to the wrong Collection? Check that `couchbase.default.collection` uses the `scope.collection` or `bucket.scope.collection` format, and confirm that the topic name in the per-topic override exactly matches the actual record topic. Prefer `couchbase.default.collection[]` and avoid mixing it with the deprecated `couchbase.topic.to.collection`; routing does not switch Collections automatically based on a message field. ### Why can the Task not connect to Couchbase after TLS is enabled? Check `couchbase.enable.tls`, the certificate hostname, and the certificate file paths on the Worker. For a PEM CA, use `couchbase.trust.certificate.path`; for a Java truststore, use `couchbase.trust.store.path` and its password. Mutual TLS also requires the client certificate path and password. Do not disable `couchbase.enable.hostname.verification` unless you clearly understand the risk. ### Why does a Couchbase write error still fail the Task after Kafka Connect error tolerance or a DLQ is configured? Kafka Connect per-record error handling mainly covers stages such as the Converter and SMT. The Couchbase Handler and target write occur inside `SinkTask.put`, so they are not automatically skipped by `errors.tolerance` or written to a DLQ. Check the specific write error in the Task log and fix invalid data, permissions, the Keyspace, or the connection problem; for recoverable failures, set a limited `couchbase.retry.timeout` and use alerts to avoid retrying permanent errors for too long. ### Why did increasing `tasks.max` not improve throughput, or change the update order for the same document? Effective Task parallelism is limited by the number of Kafka topic partitions and Worker assignment; a single partition is not split among multiple Tasks. If records from different partitions use the same Couchbase document ID, different Tasks can write that document concurrently, and the final result depends on the order in which the target completes the writes. To preserve per-entity ordering, place the same entity consistently in the same Kafka partition and adjust `tasks.max` gradually based on target capacity. ### Why did a sub-document write fail or unexpectedly create a document? Confirm that `couchbase.sink.handler` selects `SubDocumentSinkHandler` and that a non-empty `couchbase.subdocument.path` is provided. Array append or prepend operations require the target path to satisfy Couchbase array-operation conditions; to modify existing documents only, set `couchbase.subdocument.create.document` to `false`. `couchbase.subdocument.create.path` controls only missing parent paths and cannot replace control over whether the target document exists. # Datadog Logs Sink Connector Source: https://docs.automq.com/automq-cloud/kafka-connect/sink-connectors/datadog-logs-sink-connector Configure and operate the Datadog Logs Sink Connector in AutoMQ Connect, including prerequisites, configuration, monitoring, and troubleshooting. ## Overview The Datadog Logs Sink Connector consumes log records from a Kafka topic and sends them to Datadog over HTTPS. It is suitable for collecting application logs, service runtime events, and similar data into a unified log search pipeline. The [official project](https://github.com/DataDog/datadog-kafka-connect-logs) provides this Connector. For each non-null record, the value is converted to JSON and placed in the log's `message` field. The outer payload includes `ddsource=kafka-connect` and a Topic tag, and can consistently add service, host, and environment tags. The Kafka key is not written into the log body; fields in the value are not automatically promoted to Datadog's outer metadata. The Connector sends logs through the [Datadog Logs API](https://docs.datadoghq.com/api/latest/logs/); successful HTTP acceptance does not mean that a log has already been indexed or is queryable. ## Prerequisites * Prepare a valid API key for the target Datadog organization and confirm the organization's [Datadog Site](https://docs.datadoghq.com/getting_started/site/) to avoid sending logs to another site. ## License Licensed under Apache License 2.0. ## Quick Start Prepare a Connect Cluster, Kafka, the log Topic, and the target Datadog organization in advance. Confirm network connectivity and access permissions; see [Manage Connectors](../manage-connectors) for Connect Cluster and Connector preparation and management. The following configuration applies to a Topic whose key is a string or null and whose value is UTF-8 log text. ```properties theme={null} connector.class=com.datadoghq.connect.logs.DatadogLogsSinkConnector topics= key.converter=org.apache.kafka.connect.storage.StringConverter value.converter=org.apache.kafka.connect.storage.StringConverter datadog.api_key= datadog.site= ``` Replace the log Topic, API key, and Site domain, such as `datadoghq.com` or `datadoghq.eu`, then apply the configuration. Provide real secrets through controlled credential management and do not commit them to the repository. A string value becomes a JSON string as `message`; even if the text content is JSON, it is not automatically parsed as an object. After connecting, send a small number of logs, search Datadog with `source:kafka-connect` and `topic:`, and check the consumption progress to confirm the pipeline. The Connector does not need to wait for a full batch before sending. ## Configuration ### Connector and Subscription #### `connector.class` Specifies the Connector implementation class. * **Type**: `string` * **Default**: None * **Importance**: High * **Required**: Yes * **Valid values / notes**: Use `com.datadoghq.connect.logs.DatadogLogsSinkConnector`. #### `topics` Specifies the log Topics to consume. * **Type**: `list` * **Default**: Empty list * **Importance**: High * **Valid values / notes**: Comma-separated; exactly one of `topics` and `topics.regex` must be non-empty, and the subscription must not include a DLQ Topic. #### `topics.regex` Subscribes to log Topics by name using a regular expression. * **Type**: `string` * **Default**: Empty string * **Importance**: High * **Valid values / notes**: Use a valid Java regular expression; mutually exclusive with `topics`, and must not match a DLQ Topic. #### `tasks.max` Sets the maximum number of Tasks. * **Type**: `int` * **Default**: `1` * **Importance**: High * **Valid values / notes**: At least `1`; effective consumption parallelism is constrained by Topic partitions and task assignment and does not imply proportional throughput growth. #### `tasks.max.enforce` Controls whether the generated Task count limit is enforced. * **Type**: `boolean` * **Default**: `true` * **Importance**: Low * **Deprecated**: Yes * **Replacement**: No separate replacement parameter; keep the generated Task count within `tasks.max`. * **Valid values / notes**: `true` or `false`; disabling the count limit check is not recommended. ### Datadog Authentication and Target Site #### `datadog.api_key` Authenticates requests to the Datadog log intake endpoint. * **Type**: `password` * **Default**: None * **Importance**: High * **Required**: Yes * **Valid values / notes**: A valid API key for the target organization; an empty string is not a valid credential. The `password` type does not imply end-to-end credential encryption. #### `datadog.site` Specifies the Datadog Site and therefore the log intake host. * **Type**: `string` * **Default**: `null` * **Importance**: Medium * **Valid values / notes**: Enter a Site domain, such as `datadoghq.eu`, rather than the full console URL. A non-empty `datadog.url` takes precedence; when both settings are absent or empty, runtime falls back to `http-intake.logs.datadoghq.com`. This fallback is not the default value of this property. #### `datadog.url` Overrides the log intake host. * **Type**: `string` * **Default**: `null` * **Importance**: Medium * **Valid values / notes**: Enter a host and optional port, such as `http-intake.logs.datadoghq.com:443`; do not include `https://` or a path. The Connector automatically appends HTTPS and `/api/v2/logs`. When non-empty, this setting overrides `datadog.site`; confirm that the target is trusted and supports the API. ### Log Metadata #### `datadog.tags` Adds common tags to all sent logs. * **Type**: `list` * **Default**: `null` * **Importance**: Medium * **Valid values / notes**: A comma-separated list of tags; the Connector also adds the `topic:` tag. #### `datadog.service` Sets a common outer service name for logs. * **Type**: `string` * **Default**: `null` * **Importance**: Medium * **Valid values / notes**: `service` is omitted when unset; the service name is not automatically extracted from each record's value. #### `datadog.hostname` Sets a common outer host name for logs. * **Type**: `string` * **Default**: `null` * **Importance**: Medium * **Valid values / notes**: `hostname` is omitted when unset; the Kafka Broker or Worker host name is not used automatically. #### `datadog.add_published_date` Adds the Kafka record timestamp to the log. * **Type**: `boolean` * **Default**: `false` * **Importance**: Medium * **Valid values / notes**: When `true`, adds a millisecond `published_date` value to logs whose record timestamp is non-null; this does not mean that Datadog automatically treats it as the standard event time. #### `datadog.parse_record_headers` Adds Kafka Headers as a `kafkaheaders` object. * **Type**: `boolean` * **Default**: `false` * **Importance**: Medium * **Valid values / notes**: `true` or `false`; before enabling, confirm that the Header converter is compatible with the actual data and check whether Headers contain sensitive information. Arbitrary Header structures are not guaranteed to convert successfully. ### Proxy #### `datadog.proxy.url` Sets the HTTP proxy host. * **Type**: `string` * **Default**: `null` * **Importance**: Low * **Valid values / notes**: Enter the proxy host name, not a complete URL; when enabled, `datadog.proxy.port` must also be set. No public proxy authentication parameter is available. #### `datadog.proxy.port` Sets the HTTP proxy port. * **Type**: `int` * **Default**: `null` * **Importance**: Low * **Valid values / notes**: Use together with a non-empty proxy host and enter an actually valid port; there is no default proxy port. ### Send Retries #### `datadog.retry.max` Sets the Connector retry budget for consecutive send failures. * **Type**: `int` * **Default**: `5` * **Importance**: Low * **Valid values / notes**: Use a non-negative integer; `0` means no Connector retries. The budget applies to a failed `put` and resets after success; it is not a strict upper bound on the number of underlying network requests. The Task fails after retries are exhausted. #### `datadog.retry.backoff_ms` Sets the base wait time for send retries in milliseconds. * **Type**: `int` * **Default**: `3000` * **Importance**: Low * **Valid values / notes**: Use a positive integer; later waits use backoff and randomization, so this is not an exact resend timer or total retry deadline. It is different from the framework's `errors.retry.*` settings. ### Data Conversion and Transformations #### `key.converter` Specifies the converter for Kafka keys. * **Type**: `class` * **Default**: `null` * **Importance**: Low * **Valid values / notes**: When unset, inherits the Worker converter; although the key is not written to Datadog, the framework still converts it, so this setting must match the upstream encoding. #### `value.converter` Specifies the converter for Kafka values. * **Type**: `class` * **Default**: `null` * **Importance**: Low * **Valid values / notes**: When unset, inherits the Worker converter; it must match the upstream serialization format, and additional parameters belong to the selected converter. The converted value is then converted to JSON and placed in `message`; raw bytes are not sent directly to Datadog. #### `header.converter` Specifies the converter for Kafka Headers. * **Type**: `class` * **Default**: `null` * **Importance**: Low * **Valid values / notes**: When unset, inherits the Worker Header converter; check type compatibility when exposing Headers in logs. #### `transforms` Declares aliases for single message transformations (SMTs) to run in order. * **Type**: `list` * **Default**: Empty list * **Importance**: Low * **Valid values / notes**: Aliases must be unique, and each alias needs a corresponding transformation type; detailed transformation parameters are defined by the selected plugin. #### `transforms..type` Specifies the implementation class for an SMT alias. * **Type**: `class` * **Default**: None * **Importance**: High * **Required**: `required` when this SMT alias is configured * **Valid values / notes**: Replace `` with an alias from `transforms` and use an instantiable Transformation implementation class. #### `predicates` Declares aliases for predicates used to conditionally run SMTs. * **Type**: `list` * **Default**: Empty list * **Importance**: Low * **Valid values / notes**: Aliases must be unique; predicate-specific parameters are defined by each plugin. #### `predicates..type` Specifies the implementation class for a predicate alias. * **Type**: `class` * **Default**: None * **Importance**: High * **Required**: `required` when this predicate alias is configured * **Valid values / notes**: Replace `` with an alias from `predicates` and use an instantiable Predicate implementation class. #### `transforms..predicate` Selects the condition under which an SMT runs. * **Type**: `string` * **Default**: `null` * **Importance**: Medium * **Valid values / notes**: References a configured predicate alias; `` is the SMT alias. #### `transforms..negate` Controls whether the SMT predicate result is inverted. * **Type**: `boolean` * **Default**: `false` * **Importance**: Medium * **Valid values / notes**: When this property is explicitly set, the corresponding `predicate` must also be explicitly set, even when this property is `false`. ### External Credential Configuration Updates #### `config.action.reload` Controls how changes to a Config Provider value are handled. * **Type**: `string` * **Default**: `restart` * **Importance**: Low * **Valid values / notes**: `none` or `restart`; registering a Provider is a Worker configuration, and this property alone does not enable credential management or guarantee that arbitrary secret changes are detected automatically. ### Framework Error Handling #### `errors.retry.timeout` Sets the total retry duration for framework error handling in milliseconds. * **Type**: `long` * **Default**: `0` * **Importance**: Medium * **Valid values / notes**: `0` means no retries, and `-1` means unlimited retries; this applies to framework-supported stages such as conversion and SMT processing and cannot replace Datadog HTTP send retries. #### `errors.retry.delay.max.ms` Sets the maximum wait interval for framework retries. * **Type**: `long` * **Default**: `60000` * **Importance**: Medium * **Valid values / notes**: This is not `datadog.retry.backoff_ms` and does not control the plugin's HTTP send backoff. #### `errors.tolerance` Controls whether record-processing errors supported by the framework may be skipped. * **Type**: `string` * **Default**: `none` * **Importance**: Medium * **Valid values / notes**: `none` or `all`; `all` can tolerate supported conversion or SMT errors, but does not automatically skip HTTP send or log serialization failures inside `put`. A skipped record is not sent to Datadog. #### `errors.log.enable` Enables logging of framework-failed records. * **Type**: `boolean` * **Default**: `false` * **Importance**: Medium * **Valid values / notes**: `true` or `false`; independent of the Connector's own exception logging and does not change failure handling. #### `errors.log.include.messages` Controls whether framework error logs include detailed record context. * **Type**: `boolean` * **Default**: `false` * **Importance**: Medium * **Valid values / notes**: Takes effect when framework error logging is enabled; Sink context includes the Topic, partition, Offset, and timestamp, so restrict log access. #### `errors.deadletterqueue.topic.name` Sets the framework dead-letter queue (DLQ) Topic. * **Type**: `string` * **Default**: Empty string * **Importance**: Medium * **Valid values / notes**: An empty value disables it; together with `errors.tolerance=all`, it can retain failed records within the framework's supported scope. The Topic must not be subscribed to by this Connector; HTTP send failures inside the plugin's `put` are not captured automatically. #### `errors.deadletterqueue.topic.replication.factor` Sets the replication factor when a DLQ Topic is created automatically. * **Type**: `short` * **Default**: `3` * **Importance**: Medium * **Valid values / notes**: Used when the DLQ Topic does not exist and must be created; it should be compatible with the number of available Brokers in the Kafka cluster. #### `errors.deadletterqueue.context.headers.enable` Adds error context Headers to DLQ records. * **Type**: `boolean` * **Default**: `false` * **Importance**: Medium * **Valid values / notes**: When `true`, adds `__connect.errors.*` context; DLQ must already be enabled, and this does not expand the range of errors it can capture. ## Best Practices ### Add Consistent Search Tags During Onboarding **Applicable business scenario**: After logs can be delivered, you need to distinguish services and environments within the same Datadog organization for later search and operations. Configure log streams that share the same service identity first, then connect more sources to avoid labeling mixed services as one service. **Configuration example**: Add the following settings to the Quick Start configuration; the placeholders represent the service name and deployment environment for this log stream. ```properties theme={null} datadog.service= datadog.tags=env: ``` **Key notes**: These values are applied uniformly to the outer log metadata for this Connector, while the Topic tag is still added automatically. Use separate Connectors for different services; do not expect a `service` field inside the value to override the configured value. Common tags should not contain secrets or personal information. ### Allow Recovery Time for Transient Send Failures During Operation **Applicable business scenario**: A transient intake-side failure occurs during operation, and you need to allow retries and observe backlog instead of stopping the Task immediately. Before increasing the retry budget, confirm that the failure is not caused by an invalid key, an incorrect Site, or a data problem that reproduces consistently. **Configuration example**: Add the following settings to the Quick Start configuration to override the Connector's default retry budget and base wait time. ```properties theme={null} datadog.retry.max=8 datadog.retry.backoff_ms=5000 ``` **Key notes**: The example values are not universally optimal; adjust them according to acceptable backlog and recovery time. Synchronous sending and waiting create backpressure. The budget resets after success, and after it is exhausted you must fix the cause and recover the Task. Retries may resend logs that were already received, and the framework DLQ cannot replace this failure recovery; do not treat duplicate logs as exactly-once writes. ### Increase Consumption Parallelism by Partition When Scaling **Applicable business scenario**: After continuous operation, consumption backlog appears, the input Topic has multiple partitions, and the target still has intake capacity. You need to add consumption Tasks to share the processing load. Observe latency and errors first, then scale gradually to avoid turning a downstream bottleneck into more failed requests. **Configuration example**: For an input with at least two assignable partitions, set the Task limit from the Quick Start configuration to the following value. ```properties theme={null} tasks.max=2 ``` **Key notes**: Connect manages task assignment, and effective parallelism is limited by the number of partitions. This value is only a starting point for scaling and does not promise linear speedup or global ordering. After increasing the task count, also monitor Datadog intake errors, throughput, and consumption backlog. ## Monitoring ### What to Monitor Monitor Kafka Connect cluster health, Connector and Task status, input and processing throughput, consumption backlog and end-to-end latency, Offset commit progress and failures, error and retry frequency, and Worker JVM memory, GC, and thread signals. Monitor DLQ activity only when the corresponding error handling is enabled. When backlog persists or retries are frequent, inspect task exceptions together with authentication, Site, and downstream responses; do not determine that logs have been indexed based only on `RUNNING`, input record counts, or HTTP success. ### Import the Grafana Dashboard Download the [AutoMQ Connect Cluster Dashboard](https://automq-download-center.oss-cn-hangzhou.aliyuncs.com/connect-dashboard/automq-connect-cluster-dashboard.json), confirm that Connect metrics are collected by a Prometheus-compatible data source and that labels such as cluster and instance match the dashboard queries, then import the JSON into Grafana and select the corresponding data source. ## Limitations * Exactly-once writes and idempotent deduplication are not provided; retries after partial request success, lost responses, and restarts before the send Offset is committed may produce duplicate logs. * Records whose value is `null` are skipped and do not result in a delete request to Datadog, so the number of consumed Kafka records is not equal to the number of logs actually sent. * Global ordering across Topics, partitions, or Tasks is not guaranteed, and Datadog display order is not guaranteed. * HTTP success is the send-acceptance boundary and does not guarantee that each log has been persisted, indexed, or made queryable in Datadog; `flush` also does not check Datadog downstream status. * Logs remain subject to Datadog API and organization intake policies. The Connector splits batches at an internal uncompressed JSON threshold of about 4.5 MB; a serialized log that exceeds this threshold and cannot fit into an empty batch is skipped. Automatic batching does not mean that a single log of any size will be accepted by Datadog. See the [Logs API](https://docs.datadoghq.com/api/latest/logs/) for the applicable constraints. ## FAQ ### The Task is RUNNING, but no logs can be found in Datadog First check whether the input Topic contains non-null values, whether consumption progress is advancing, and whether the Task log contains send or conversion errors. Confirm that the API key and Site belong to the target organization, use an appropriate time range, and search with `source:kafka-connect` and the corresponding Topic tag. If HTTP has been accepted but the log is still not searchable, continue checking Datadog log processing, indexing, and exclusion policies; do not treat HTTP success as proof of query visibility. ### HTTP sends keep failing, and the Connector still stops after a DLQ is configured The framework DLQ mainly handles conversion and SMT errors within its supported scope; it does not automatically receive HTTP failures inside the plugin's `put`. Check the complete exception and safe response context. Fix the API key and Site for authentication errors, and allow Connector retries for transient intake failures. After persistent failure or exhausted retries, fix the cause and recover the Task. This plugin does not distinguish permanent and transient failures by HTTP status and does not schedule retries according to `Retry-After`. ### Duplicate logs appear, or some logs are sent again after a restart Log intake and Kafka consumer Offset commits are not one transaction. A process exit after a successful send but before the commit, or a later request failure while processing a batch, may cause a resend. Check retries, Task restarts, and Offset commit errors, and include duplicates in downstream processing design; do not interpret a larger retry budget as a no-duplicate guarantee. ### The original log is JSON, but its fields are still inside `message` The Quick Start uses a string converter, so JSON text remains a string rather than an automatically parsed object. When a structured Connect value is required, choose a converter and its parameters that match the actual upstream serialization format, then confirm the output structure. Even when the value is already an object, its fields remain inside `message` and are not automatically converted into outer `service` or `hostname` fields. ### A URL error appears after configuring the intake address Check whether `datadog.url` was mistakenly set to a complete HTTPS address or to the `/api/v2/logs` path. This property accepts only a host and optional port; the Connector adds the protocol and path. When non-empty, it also overrides `datadog.site`. For normal Site-based intake, use the Site setting and remove an unnecessary URL override. ### Business content appears in troubleshooting logs. How can exposure risk be controlled? Do not leave TRACE enabled for long periods in production. Request bodies, responses, and previews of some oversized logs may enter runtime logs. Restrict log level, access permissions, and retention time; avoid exposing sensitive Headers to Datadog and confirm that a custom intake host is trusted. Redact shared diagnostic material, while retaining exception stacks and safe Topic, partition, and Offset context for troubleshooting. # Diffusion Sink Connector Source: https://docs.automq.com/automq-cloud/kafka-connect/sink-connectors/diffusion-sink-connector Configure and operate the Diffusion Sink Connector in AutoMQ Connect, including prerequisites, configuration, monitoring, and troubleshooting. ## Overview The Diffusion Sink Connector writes records from Kafka topics to a Diffusion Server. It converts each record value to JSON that Diffusion can process and resolves the target Diffusion topic path from the configuration. If the target topic does not exist, the Connector creates it as a JSON topic before writing the value; otherwise, it updates the existing topic. The Connector can map one or more Kafka topics to a fixed Diffusion path, or use `${topic}`, `${key}`, `${key.version}`, and `${value.version}` to generate paths from record metadata. A typical use case is publishing business events from Kafka to Diffusion for real-time consumption by browser, mobile, and IoT clients. ## Prerequisites * Diffusion Server 6.9 or later, with a service account prepared to receive data; the account must be able to update the target path and create JSON topics when the target topic does not exist. * A runtime using Java 11 or later, with access to the Diffusion Server through `diffusion.url`. ## License Uses Apache License 2.0. ## Quick Start Prepare a Connect Cluster, Kafka, and Diffusion Server in advance, and confirm network connectivity and service account permissions. For specific preparation and management operations, see [Manage Connectors](../manage-connectors). ```properties theme={null} connector.class=com.diffusiondata.connect.diffusion.sink.DiffusionSinkConnector topics=price diffusion.url=ws://:8080 diffusion.username= diffusion.password= diffusion.destination=kafka/${topic} ``` Replace ``, ``, and `` with the actual connection details. This configuration writes records from the Kafka topic `price` to the Diffusion topic `kafka/price`. Submit only the Connector properties shown above, without a REST request wrapper. ## Configuration ### Diffusion Connection #### `diffusion.url` The connection address of the Diffusion Server. * **Type**: `string` * **Default**: None * **Importance**: High * **Valid values / notes**: Required. Use a complete address that the Kafka Connect Worker can access; the Connector configuration parses this value as a string only and does not validate the protocol, host, port, or whether the value is empty. * **Required**: Yes #### `diffusion.username` The principal used to authenticate with the Diffusion Server. * **Type**: `string` * **Default**: None * **Importance**: High * **Valid values / notes**: Required. The account must have permission to access the target Diffusion Topic; the Connector configuration does not validate whether the value is empty. * **Required**: Yes #### `diffusion.password` The password used to authenticate with the Diffusion Server. * **Type**: `password` * **Default**: None * **Importance**: High * **Valid values / notes**: Required. Store it using Connect's sensitive configuration management; do not write the password to logs or public configuration repositories. * **Required**: Yes ### Target Path #### `diffusion.destination` The pattern used to generate the Diffusion Topic path. The Connector resolves this pattern for each SinkRecord. * **Type**: `string` * **Default**: None * **Importance**: High * **Valid values / notes**: Required. Supports `${topic}`, `${key}`, `${key.version}`, and `${value.version}`. `${topic}` uses the input Kafka Topic; the other tokens depend on the record key or Schema version. When the record key is null, the Connector does not continue resolving key and version tokens after replacing `${topic}`; tokens without available values remain as literals. Path separators are not cleaned or replaced. * **Required**: Yes ### Input Subscription #### `topics` The list of Kafka topics to consume. * **Type**: `list` * **Default**: empty list * **Importance**: High * **Valid values / notes**: Mutually exclusive with `topics.regex`. Use comma-separated topic names and configure at least one non-empty topic. Topic names can participate in target path generation through `${topic}`. #### `topics.regex` Subscribes to Kafka topics using a Java regular expression. * **Type**: `string` * **Default**: empty string * **Importance**: High * **Valid values / notes**: Mutually exclusive with `topics`. The value must be a compilable, non-empty Java regular expression. If a DLQ topic is configured, the expression must not match that topic. ### Connector Identity and Tasks #### `connector.class` The Sink Connector implementation class to load. * **Type**: `string` * **Default**: None * **Importance**: High * **Valid values / notes**: Use `com.diffusiondata.connect.diffusion.sink.DiffusionSinkConnector`. * **Required**: Yes #### `tasks.max` The maximum number of tasks that this Connector may use. * **Type**: `int` * **Default**: `1` * **Importance**: High * **Valid values / notes**: Must be greater than or equal to `1`. This implementation always returns one task configuration, so increasing this value does not cause a single Connector instance to create multiple Diffusion Sink tasks. #### `tasks.max.enforce` Whether to enable Kafka Connect's framework constraint for `tasks.max`. * **Type**: `boolean` * **Default**: `true` * **Importance**: Low * **Valid values / notes**: Optional. This configuration is deprecated in Kafka Connect 3.9.1 and has no replacement; it does not change the Connector's one-task behavior. * **Deprecated**: Yes ### Data Conversion #### `key.converter` Specifies the Converter for Kafka record keys. The converted key can be used with `${key}`, and its Schema version can be used with `${key.version}`. * **Type**: `class` * **Default**: `null` * **Importance**: Low * **Valid values / notes**: Optional. When omitted, inherits the Worker's key Converter; when configured, it must be a concrete Converter class that can be instantiated. #### `value.converter` Specifies the Converter for Kafka record values. The converted value is serialized as Diffusion JSON, and its Schema version can be used with `${value.version}`. * **Type**: `class` * **Default**: `null` * **Importance**: Low * **Valid values / notes**: Optional. When omitted, inherits the Worker's value Converter; when configured, it must be a concrete Converter class that can be instantiated. Map keys must be representable as strings; values that do not meet this requirement cause record processing to fail. ### Error Handling #### `errors.retry.timeout` The total retry duration for retryable errors, in milliseconds. * **Type**: `long` * **Default**: `0` * **Importance**: Medium * **Valid values / notes**: `0` disables retries, `-1` enables infinite retries, and other non-negative values specify the retry duration. This is a general Kafka Connect policy and does not replace the fixed wait behavior used by the Sink Task while waiting for Diffusion publication results. #### `errors.tolerance` The scope of continued processing allowed when an error occurs. * **Type**: `string` * **Default**: `none` * **Importance**: Medium * **Valid values / notes**: Valid values are `none` and `all`. This is a general error policy; configuring it alone does not guarantee that Diffusion publication failures are automatically written to the DLQ. #### `errors.deadletterqueue.topic.name` The Kafka DLQ topic name used to store error records. * **Type**: `string` * **Default**: empty string * **Importance**: Medium * **Valid values / notes**: An empty string means that records are not published to a DLQ. When a non-empty value is configured, that topic must not also appear in `topics` or match `topics.regex`. #### `errors.deadletterqueue.topic.replication.factor` The replication factor used when Kafka Connect creates the DLQ topic. * **Type**: `short` * **Default**: `3` * **Importance**: Medium * **Valid values / notes**: Used only when the configured DLQ topic does not exist and Kafka Connect creates it; the value must be suitable for the number of replicas in the Kafka cluster. #### `errors.deadletterqueue.context.headers.enable` Whether to add error context headers to records written to the DLQ. * **Type**: `boolean` * **Default**: `false` * **Importance**: Medium * **Valid values / notes**: Takes effect only when DLQ records are actually produced; when enabled, the error context uses the `__connect.errors.` prefix. ## Best Practices ### Connect Kafka Data Streams by Topic Pattern **Applicable business scenario**: You need to continuously ingest a set of Kafka topics whose names follow a consistent pattern and write each topic's records to the corresponding Diffusion path. A regular-expression subscription avoids maintaining the topic list individually. **Configuration example**: ```properties theme={null} connector.class=com.diffusiondata.connect.diffusion.sink.DiffusionSinkConnector topics.regex=orders-.* diffusion.url=ws://:8080 diffusion.username= diffusion.password= diffusion.destination=events/${topic} ``` **Key notes**: Do not configure a non-empty `topics` when `topics.regex` is non-empty. `${topic}` preserves the input topic name, so `orders-created` is written to `events/orders-created`. Before expanding the subscription scope, confirm that the Diffusion principal has update or create permission for every target path that may be generated. ### Separate Data Streams with Multiple Connector Instances **Applicable business scenario**: You need to manage business streams separately, assign different target paths or failure boundaries, and the topic set in one Connector instance has become large. Create an independent Connector instance for each topic group. **Configuration example**: ```properties theme={null} connector.class=com.diffusiondata.connect.diffusion.sink.DiffusionSinkConnector topics=orders,inventory tasks.max=1 diffusion.url=ws://:8080 diffusion.username= diffusion.password= diffusion.destination=business/${topic} ``` When creating a second Connector instance for another topic group, use different `topics` or `topics.regex` values and a different target path instead of only increasing `tasks.max` on the same instance. This implementation always creates one task, so increasing `tasks.max` does not create task-level parallelism within an instance. Divide input topics explicitly between instances to avoid consuming the same data stream more than once. ## Monitoring ### What to Monitor Monitor Kafka Connect health, Connector and task status, throughput, latency, offset commits, errors, retries, and Worker JVM signals. Monitor DLQ activity only when the corresponding error handling is enabled. ### Import the Grafana Dashboard Confirm that Connect metrics are connected to a Grafana data source and that the collected labels meet the dashboard's filtering requirements; download the [Kafka Connect Dashboard](https://automq-download-center.oss-cn-hangzhou.aliyuncs.com/connect-dashboard/automq-connect-cluster-dashboard.json), import the JSON in Grafana, and select the corresponding data source. ## Limitations * A single Diffusion Sink Connector instance always creates one task; increasing `tasks.max` does not make the instance create multiple tasks in parallel. To scale at the deployment level, separate input topics across multiple instances. * Exactly one non-empty subscription method must be selected between `topics` and `topics.regex`; if both are non-empty or both are empty, Sink configuration validation fails. * If the connection is lost or the task restarts after a Diffusion update succeeds but before the framework commits the Kafka offset, the offset may remain uncommitted. The record may be written to the same path again after recovery, so the Connector does not guarantee that application-level side effects occur only once. * When the record key is null, `diffusion.destination` replaces only `${topic}`; `${key}`, `${key.version}`, and `${value.version}` are not resolved further. Therefore, a path pattern that depends on these tokens should ensure that input records have the required key and Schema version. ## FAQ ### Why is there still only one task after increasing `tasks.max`? This is the Connector's implementation behavior. Its `taskConfigs` method always returns one task configuration, and `tasks.max` only sets Kafka Connect's task limit; it does not change the number of tasks in a single instance. To isolate data streams or scale the deployment, create multiple Connector instances for different topic sets and ensure that they do not subscribe to the same topic. ### Why can't the Connector start after configuring both `topics` and `topics.regex`? A Kafka Connect sink requires exactly one of them to be non-empty. Remove one, or change `topics.regex` to a valid, non-empty Java regular expression. If a DLQ topic is also configured, confirm that it is not included in the subscription list or matched by the regular expression. ### Why did unexpected topic paths appear in Diffusion? Check whether the tokens in `diffusion.destination` match the key and Schema version actually available in the records. `${topic}` uses the input Kafka topic, and `${key}` uses a non-null record key. When the record key is null, version tokens are not resolved; a token can also remain literal when its value is unavailable. Start with a fixed path or `${topic}` alone to verify the input scope, then add key and version tokens incrementally. ### Why is the same record processed again after a successful publication and restart? There is a window between a successful Diffusion update and the Kafka offset commit. If the connection is interrupted after the update completes but before the offset is committed, Kafka Connect may redeliver the record during recovery. Check whether the target uses the same key and path, assess whether the application can tolerate duplicate processing, and do not treat Diffusion's last-write result as an application-level idempotency guarantee. ### Why did the error not enter the DLQ? The DLQ is a general Kafka Connect error-handling capability, and DLQ records are produced only when `errors.deadletterqueue.topic.name` is configured and the applicable error-handling conditions are met. Diffusion publication failures are handled by the Sink Task's publication Future and flush wait; configuring only `errors.tolerance` does not guarantee that these failures are automatically written to the DLQ. First inspect Connector, Task, error, and retry metrics and logs to determine whether the failure is a record-level conversion error or a target-side publication error. # Lightstreamer Sink Connector Source: https://docs.automq.com/automq-cloud/kafka-connect/sink-connectors/lightstreamer-sink-connector Configure and operate the Lightstreamer Sink Connector in AutoMQ Connect, including prerequisites, configuration, monitoring, and troubleshooting. ## Overview The Lightstreamer Sink Connector consumes records from Kafka topics, converts them into Lightstreamer field updates, and sends them through the Lightstreamer Proxy Adapter to web, mobile, or other clients that subscribe to real-time Items. It sits between Kafka Connect and Lightstreamer Server: Kafka Connect reads records and manages offsets, the Connector routes topics to Items and maps records to fields, and Lightstreamer Server distributes updates to clients. A topic can map to one or more static Items, or Item templates can route updates to parameterized Items based on record keys, values, headers, or metadata. Field mappings can extract the key, value, headers, topic, partition, offset, and timestamp, converting the result to a string or `null`. The Connector does not provide an initial snapshot. In the normal active connection mode, records produce Item updates only when a matching client subscription exists. This Connector is suitable for pushing market data, device status, business events, and real-time dashboard data from Kafka to Lightstreamer clients. Lightstreamer Item updates and Kafka offset commits are not transactional across the two systems, so recovery may produce duplicate updates. Keep stable identifiers in events and handle duplicates in the client or business layer as needed. ## Prerequisites * Deploy Lightstreamer Server 7.4.2 or later, and configure a Proxy Data Adapter in the target Adapter Set that can communicate with the Connector. Its request/reply port, connection direction, and optional authentication settings must match the Connector configuration. * Lightstreamer clients must connect to the correct Adapter Set and Data Adapter, and subscribe to the Items defined by `topic.mappings` or `item.templates` and the fields defined by `record.mappings`. No client updates are produced without a matching subscription. * When extracting with `KEY` or `VALUE` paths, the selected Kafka Connect Converter must produce a non-null Connect Schema consistent with the record structure. When using a DLQ, prepare a Kafka topic that the Connector can write to and that is outside the input subscription scope. ## License Licensed under the Apache License 2.0. ## Quick Start Prepare a Connect Cluster, Kafka topic, Lightstreamer Server, Proxy Adapter, and subscribing client, and confirm network connectivity and access permissions. For cluster preparation and Connector management, see [Manage Connectors](../manage-connectors). The following example consumes string messages and sends each record's value as the `message` field to the static Item `events`. ```properties theme={null} connector.class=com.lightstreamer.kafka.connect.LightstreamerSinkConnector topics= lightstreamer.server.proxy_adapter.address=:6661 topic.mappings=:events record.mappings=message:#{VALUE} value.converter=org.apache.kafka.connect.storage.StringConverter ``` Replace both occurrences of `` with the same input topic, and replace the Lightstreamer Proxy Adapter address. The client must subscribe to the `events` Item and the `message` field in the corresponding Adapter Set. If authentication is enabled on the Proxy Adapter, also configure a username and password. Inject credentials through the deployment environment's secure configuration mechanism; do not store them in version control or shared logs. ## Configuration ### Connector Identity, Input, and Tasks #### `connector.class` Specifies the Lightstreamer Sink Connector implementation class. * **Type**: `string` * **Default**: None * **Importance**: High * **Valid values / Notes**: Use `com.lightstreamer.kafka.connect.LightstreamerSinkConnector`. Every Worker that may run a Task must be able to load the plugin. * **Required**: Yes #### `topics` Specifies the Kafka topics to consume. * **Type**: `list` * **Default**: Empty list * **Importance**: High * **Valid values / Notes**: Separate multiple names with commas. Configure either this property or `topics.regex`, but not both. Input topics must also match a literal or regular expression rule in `topic.mappings`. When a DLQ is enabled, do not subscribe to the DLQ topic. #### `topics.regex` Selects Kafka topics to consume by regular expression. * **Type**: `string` * **Default**: Empty string * **Importance**: High * **Valid values / Notes**: Use Java regular expression syntax. This property is mutually exclusive with `topics`. When a DLQ is configured, the expression must not match the DLQ topic. This property controls only the Kafka Connect input subscription; it does not automatically enable regular expression interpretation for `topic.mappings`. #### `tasks.max` Sets the maximum number of Tasks Kafka Connect may create. * **Type**: `int` * **Default**: `1` * **Importance**: High * **Valid values / Notes**: Must be at least `1`. The Connector always returns only one Task configuration, so increasing this value does not increase Task parallelism for a single Connector instance. ### Proxy Adapter Connection and Authentication #### `lightstreamer.server.proxy_adapter.address` Sets the Lightstreamer Proxy Adapter host and request/reply port. * **Type**: `string` * **Default**: None * **Importance**: High * **Valid values / Notes**: Use the `host:port` format. The host must not be empty, and the port must be a positive integer without leading zeros. This property is always required. It must still be provided when connection inversion is enabled, but its host and port are not used for an active outbound connection. Bracketed IPv6 addresses do not satisfy this property's validation format. * **Required**: Yes #### `lightstreamer.server.proxy_adapter.socket.connection.setup.timeout.ms` Sets how long to wait when establishing the Proxy Adapter socket in active connection mode, in milliseconds. * **Type**: `int` * **Default**: `5000` * **Importance**: Low * **Valid values / Notes**: Must be greater than or equal to `0`; `0` means no connection timeout is set. Applies only when `connection.inversion.enable=false`. #### `lightstreamer.server.proxy_adapter.socket.connection.setup.max.retries` Sets the maximum number of retries after an initial connection failure in active connection mode. * **Type**: `int` * **Default**: `1` * **Importance**: Medium * **Valid values / Notes**: Must be greater than or equal to `0`; `0` disables retries. This property controls only connection establishment during Task startup. It is not a record-level retry and does not continuously reconnect after a runtime disconnection. #### `lightstreamer.server.proxy_adapter.socket.connection.setup.retry.delay.ms` Sets the wait time between initial connection attempts in active connection mode, in milliseconds. * **Type**: `long` * **Default**: `5000` * **Importance**: Low * **Valid values / Notes**: Must be greater than or equal to `0`. Applies only when `connection.inversion.enable=false` and the maximum retry count is greater than `0`. #### `lightstreamer.server.proxy_adapter.username` Sets the username for Proxy Adapter remote connection authentication. * **Type**: `string` * **Default**: `null` * **Importance**: Medium * **Valid values / Notes**: Configure this property only when remote Adapter authentication is enabled on the Proxy Adapter. An empty string is different from leaving it unset. It can be used in both active connection and connection inversion modes. #### `lightstreamer.server.proxy_adapter.password` Sets the password for Proxy Adapter remote connection authentication. * **Type**: `password` * **Default**: `null` * **Importance**: Medium * **Valid values / Notes**: Typically configured together with `lightstreamer.server.proxy_adapter.username`. Store it through a secure configuration mechanism, and do not expose the actual value in logs, documentation, or version control. #### `connection.inversion.enable` Sets whether to reverse the direction in which the connection between the Proxy Adapter and the Connector is established. * **Type**: `boolean` * **Default**: `false` * **Importance**: Low * **Valid values / Notes**: When `false`, the Connector actively connects to `lightstreamer.server.proxy_adapter.address`. When `true`, the Connector listens on `request_reply.port`, and the Proxy Adapter connects to it. In inversion mode, also configure the Connector's remote host on the Proxy Adapter. #### `request_reply.port` Sets the request/reply port on which the Connector listens in connection inversion mode. * **Type**: `int` * **Default**: `6661` * **Importance**: Low * **Valid values / Notes**: Applies only when `connection.inversion.enable=true`. Configuration validation requires only a value greater than or equal to `0`; in practice, select a port the operating system can bind that is within the valid TCP port range. #### `max.proxy.adapter.connections` Sets the number of Proxy Adapter connections that may be active simultaneously in connection inversion mode. * **Type**: `int` * **Default**: `1` * **Importance**: Low * **Valid values / Notes**: Must be greater than or equal to `1`, and applies only when `connection.inversion.enable=true`. The same batch of records is sent to all connections active at that time, but no transactional or ordering guarantee is provided across connections. ### Topic and Item Routing #### `topic.mappings` Defines mappings from Kafka topics to static Lightstreamer Items or Item templates. * **Type**: `string` * **Default**: None * **Importance**: High * **Valid values / Notes**: Use the format `topic:item1,item2;other-topic:item3`. Each topic or regular expression key must be unique, and a mapping must not be empty. Duplicate Items within the same mapping are deduplicated. By default, topics are matched literally. When `topic.mappings.regex.enable` is enabled, Java regular expressions are used for full matches. An `item-template.` reference must be defined in `item.templates`. * **Required**: Yes #### `topic.mappings.regex.enable` Sets whether each topic key in `topic.mappings` is interpreted as a Java regular expression. * **Type**: `boolean` * **Default**: `false` * **Importance**: Medium * **Valid values / Notes**: When enabled, matching uses the full topic name. An invalid regular expression causes a failure while the Task builds its mapper. This property and `topics.regex` are independent; both sets of rules must cover the intended input topics. #### `item.templates` Defines parameterized Lightstreamer Item templates that filter subscriptions based on record content. * **Type**: `string` * **Default**: `null` * **Importance**: Medium * **Valid values / Notes**: Use the format `template-name:item-prefix-#{param=EXPRESSION};other-template:...`. Template names must be unique, and values must not be empty. `#{...}` is the Connector-side template definition; clients must provide literal filter values using the format `item-prefix-[param=literalValue]`. Template parameters can use only scalar values. `topic.mappings` references a template as `item-template.`. ### Record Conversion and Field Mapping #### `key.converter` Sets the Converter for Kafka record keys. * **Type**: `class` * **Default**: `null` * **Importance**: Low * **Valid values / Notes**: When unspecified, this property inherits the Worker setting. When using `KEY` extraction expressions or key-based Item templates, the Converter must match the message encoding and produce a non-null Connect Schema. For simple string keys, use `org.apache.kafka.connect.storage.StringConverter`. #### `value.converter` Sets the Converter for Kafka record values. * **Type**: `class` * **Default**: `null` * **Importance**: Low * **Valid values / Notes**: When unspecified, this property inherits the Worker setting. When using `VALUE` extraction expressions, the Converter must match the message encoding and produce a non-null Connect Schema. For string messages, use `org.apache.kafka.connect.storage.StringConverter`. Configure the selected Converter's own options as required by its implementation. #### `record.mappings` Defines Lightstreamer field names and their corresponding Kafka record extraction expressions. * **Type**: `list` * **Default**: None * **Importance**: High * **Valid values / Notes**: Use comma-separated `field:#{EXPRESSION}` entries. Field names must be non-empty and unique. Expressions can extract data from `KEY`, `VALUE`, `HEADERS`, `TOPIC`, `PARTITION`, `OFFSET`, or `TIMESTAMP`. This configuration fixes the field set; other fields in input records are not published automatically. When an expression needs to contain a comma, also follow properties escaping rules. * **Required**: Yes #### `record.mappings.skip.failed.enable` Sets whether to omit a field when its extraction fails and continue sending the remaining fields. * **Type**: `boolean` * **Default**: `false` * **Importance**: Medium * **Valid values / Notes**: When `false`, field extraction errors are handled by `record.extraction.error.strategy`. When `true`, only the failed field is omitted, and other fields can still be updated. This property does not skip Item template parameter extraction failures, and an empty field Map may be sent when every field fails. #### `record.mappings.map.non.scalar.values.enable` Sets whether non-scalar selection results such as Structs, Maps, and arrays may be converted to field text. * **Type**: `boolean` * **Default**: `false` * **Importance**: Medium * **Valid values / Notes**: When `false`, field mappings must select scalar values. When `true`, Structs are converted to JSON text without a Schema, while other complex Java values are sent using their string representation. This property affects only `record.mappings`; it does not relax the scalar requirement for Item template parameters. ### Extraction Errors and DLQ #### `record.extraction.error.strategy` Sets the strategy for handling extraction errors during record mapping. * **Type**: `string` * **Default**: `IGNORE_AND_CONTINUE` * **Importance**: Medium * **Valid values / Notes**: Values are case-sensitive: `IGNORE_AND_CONTINUE`, `FORWARD_TO_DLQ`, or `TERMINATE_TASK`. Ignoring an error or successfully writing to the DLQ advances the processing position for that record. To isolate bad records with `FORWARD_TO_DLQ` and continue processing subsequent records, also configure a non-empty `errors.deadletterqueue.topic.name` and `errors.tolerance=all`. A missing DLQ topic or the default tolerance level `none` causes an extraction error to terminate the Task. This strategy handles only extraction errors during mapping; it does not handle arbitrary connection or communication failures. #### `errors.deadletterqueue.topic.name` Sets the Kafka DLQ topic that receives records with extraction failures. * **Type**: `string` * **Default**: Empty string * **Importance**: Medium * **Valid values / Notes**: An empty string disables the DLQ. When using `record.extraction.error.strategy=FORWARD_TO_DLQ`, configure a non-empty value and `errors.tolerance=all` so processing can continue after the bad record is reported. The DLQ topic must not appear in `topics` or match `topics.regex`. #### `errors.tolerance` Sets whether Kafka Connect tolerates record processing failures and keeps the Task running. * **Type**: `string` * **Default**: `none` * **Importance**: Medium * **Valid values / Notes**: Valid values are `none` and `all`. With `none`, the Task terminates when the first failed record exceeds the tolerance limit. With `all`, failed records can be tolerated. For `record.extraction.error.strategy=FORWARD_TO_DLQ`, set this property to `all` so processing continues after an extraction failure is reported to the configured DLQ. This setting does not convert Proxy Adapter connection, communication, or other arbitrary errors into tolerable DLQ records. #### `errors.deadletterqueue.topic.replication.factor` Sets the replication factor Kafka Connect uses when it automatically creates the DLQ topic. * **Type**: `short` * **Default**: `3` * **Importance**: Medium * **Valid values / Notes**: Used only when the configured DLQ topic does not exist and Kafka Connect creates it. The value must be suitable for the number of brokers and replication policy in the target Kafka cluster. #### `errors.deadletterqueue.context.headers.enable` Sets whether Kafka Connect error context headers are added to DLQ records. * **Type**: `boolean` * **Default**: `false` * **Importance**: Medium * **Valid values / Notes**: Applies only when DLQ records are actually produced. When enabled, context header names use the `__connect.errors.` prefix. DLQ consumers should not treat these internal diagnostic headers as original business fields. ## Best Practices ### Expand the Input Scope by Topic Naming Pattern **Applicable scenario**: Initial integration is complete, and additional Kafka topics following a consistent naming pattern will be added over time. You want new topics to enter the same real-time event stream automatically without repeatedly changing a fixed topic list. **Configuration example**: ```properties theme={null} connector.class=com.lightstreamer.kafka.connect.LightstreamerSinkConnector topics.regex=events-.* lightstreamer.server.proxy_adapter.address=:6661 topic.mappings=events-.*:events topic.mappings.regex.enable=true record.mappings=message:#{VALUE} value.converter=org.apache.kafka.connect.storage.StringConverter ``` **Key points**: Compared with the Quick Start, this configuration removes `topics`, uses `topics.regex`, and also changes the key in `topic.mappings` to a regular expression. The two sets of rules are independent and should cover the same scope. Otherwise, Kafka Connect may consume a topic whose records do not match any Item route. Before adding a topic, also confirm that its message encoding and field structure are compatible with the existing mapping. ### Partition Client Subscriptions by Business Entity **Applicable scenario**: Clients need updates only for a specific order, device, or account, and not every subscriber should receive all records from the same topic. Use the record key to construct parameterized Items so that clients can subscribe by business entity. **Configuration example**: ```properties theme={null} connector.class=com.lightstreamer.kafka.connect.LightstreamerSinkConnector topics=entity-events lightstreamer.server.proxy_adapter.address=:6661 item.templates=entity-template:entity-#{id=KEY} topic.mappings=entity-events:item-template.entity-template record.mappings=message:#{VALUE} key.converter=org.apache.kafka.connect.storage.StringConverter value.converter=org.apache.kafka.connect.storage.StringConverter ``` **Key points**: Compared with the Quick Start, this configuration adds `item.templates` and a key Converter, and replaces the static Item with a template reference. The Connector template is defined as `entity-#{id=KEY}`. A client must subscribe with a literal filter value such as `entity-[id=42]`; only records with the key `42` match that subscription. Do not use `entity-42`. The template parameter value and Connect Schema extracted from the record must match the subscription parameter. Business entity keys should be stable and non-empty so that key changes do not route updates for the same entity to different Items. ### Isolate Field Extraction Failures in a DLQ **Applicable scenario**: The Connector is already running continuously, and schema evolution or occasional malformed records may make a field path impossible to extract. You want to retain the problematic records for investigation while continuing to process subsequent valid records. **Configuration example**: ```properties theme={null} connector.class=com.lightstreamer.kafka.connect.LightstreamerSinkConnector topics= lightstreamer.server.proxy_adapter.address=:6661 topic.mappings=:events record.mappings=message:#{VALUE.message} value.converter=org.apache.kafka.connect.json.JsonConverter value.converter.schemas.enable=true record.extraction.error.strategy=FORWARD_TO_DLQ errors.tolerance=all errors.deadletterqueue.topic.name= errors.deadletterqueue.context.headers.enable=true ``` **Key points**: Compared with the Quick Start, this configuration uses a JSON value with a Schema, a nested field path, and `FORWARD_TO_DLQ`, and adds `errors.tolerance=all` and a DLQ topic. `all` is required to isolate bad records and continue processing subsequent records. If the default `none` is retained, the Task still terminates after the error is reported because the tolerance limit is exceeded. `` must differ from the input topic and remain outside the subscription scope. After a record is successfully reported to the DLQ, its offset continues to advance. Monitor and consume the DLQ, then replay records according to business rules after correcting the data or mapping. This combination tolerates only extraction failures during mapping; it does not catch arbitrary errors such as Proxy Adapter communication failures. ## Monitoring ### What to Monitor Monitor Kafka Connect health, Connector and Task status, throughput, latency, offset commits, errors, retries, and Worker JVM signals. Monitor DLQ activity only when the corresponding error handling is enabled. ### Import the Grafana Dashboard Confirm that Connect metrics are available to a Grafana data source and that the collected labels satisfy the dashboard filters. Download the [Kafka Connect Dashboard](https://automq-download-center.oss-cn-hangzhou.aliyuncs.com/connect-dashboard/automq-connect-cluster-dashboard.json), import the JSON into Grafana, and select the corresponding data source. ## Limitations * A single Connector instance always creates only one Sink Task. Increasing `tasks.max` does not increase Task parallelism. To scale by instance, divide input topics across multiple Connector instances. * The Connector does not provide an initial snapshot, and field updates are driven by current client subscriptions. In the normal active connection mode, the Connector does not continuously advance its managed safe offset when no subscription exists. A subscription added while the Connector is running does not automatically receive records consumed earlier without a matching subscription, while a restart may replay records from the last committed position. * In connection inversion mode, Worker offsets may still be committed when there is no active Proxy Adapter or no subscription. Such records may not produce client updates and are not automatically redelivered based on Kafka offsets. * Target Item updates and Kafka offset commits are not atomic. Recovery may produce duplicate updates, and the Connector does not provide exactly-once delivery, target-side deduplication, or confirmation that end clients received an update. * `KEY` and `VALUE` path extraction requires the Converter to produce a non-null Connect Schema. Field navigation in a schema-less JSON Map must not be treated as a supported use case. * `record.extraction.error.strategy` handles only extraction errors during mapping. Runtime connection loss and other uncaught exceptions may fail the Task. The Connector does not provide record-level retries, asynchronous buffering, or continuous reconnection for active connections. ## FAQ ### Why are the Connector and Task running normally, but clients receive no updates? First confirm that the client is connected to the correct Adapter Set and Data Adapter, and has subscribed to the static Item referenced by `topic.mappings` or a parameterized Item matching `item.templates`. Then check that Kafka Connect's `topics` or `topics.regex` covers the input topic, that `topic.mappings` matches it using the correct literal or regular expression mode, and that the fields requested by the client exist in `record.mappings`. In the normal active connection mode, no updates are produced without a matching subscription. After establishing the subscription, send a new record to verify the configuration; do not assume that adding a subscription while the Connector is running automatically replays earlier records. ### Why does the Task fail after reading a record, or why does the record produce no field update? Check that `key.converter` and `value.converter` match the actual message encoding, and confirm that each `KEY` or `VALUE` path refers to a real field in a non-null Schema. A missing field, an out-of-bounds array index, navigating into a scalar, or selecting a non-scalar value can cause extraction errors. To keep other fields when one field fails, evaluate `record.mappings.skip.failed.enable=true`. To isolate the entire problematic record and continue processing subsequent records, configure `FORWARD_TO_DLQ`, a non-empty DLQ topic, and `errors.tolerance=all`. To stop processing immediately, use `TERMINATE_TASK`. This tolerance applies only to record failures that follow the error-handling path; it does not ignore arbitrary connection or communication errors. ### Why is there still only one Task after increasing `tasks.max`? This is the Connector's Task model. Each Connector instance corresponds to one Remote Adapter Task, and the Connector always generates only one Task configuration. To isolate business flows or scale the deployment, create multiple Connector instances for different topic sets. Keep the input subscriptions and Lightstreamer routing boundaries of each instance clear to avoid unintended duplicate consumption and updates. ### Why can't the Connector connect to the Lightstreamer Proxy Adapter? Check that `lightstreamer.server.proxy_adapter.address` uses a resolvable `host:port`, that the port matches the Proxy Adapter's request/reply port, that the firewall allows the connection, and that the authentication username and password match the Proxy Adapter configuration. If `connection.inversion.enable` is enabled, also confirm that the Connector can bind `request_reply.port` and configure the Proxy Adapter's remote host to point to the Connector. Active connection retry settings apply only during Task startup. After a runtime disconnection, check the Task status and logs, and restart it according to your deployment strategy. # Milvus Sink Connector Source: https://docs.automq.com/automq-cloud/kafka-connect/sink-connectors/milvus-sink-connector Configure and operate the Milvus Sink Connector in AutoMQ Connect, including prerequisites, configuration, monitoring, and troubleshooting. ## Overview The Milvus Sink Connector consumes records from Kafka topics and uses the Milvus REST API to batch-upsert them into a collection in a specified database. Fields in Kafka record values are matched by name against the collection schema. Matching fields are converted when the connector supports the target field type. Kafka record keys, topics, partitions, offsets, and headers are not used to populate target fields or route records to collections. Each connector instance writes to one fixed `database.name` and `collection.name`. It is suitable for writing entity data that has already been structured according to a Milvus schema from Kafka to a vector search collection, for example, writing an application primary key, text attributes, and a `FloatVector` field together. The target collection must be created and loaded in advance, auto-ID must be disabled, and the message value must explicitly provide the primary key. ## Prerequisites * Create and load the collection in the target Milvus or Zilliz Cloud deployment in advance, disable auto-ID, and prepare a token that can access the database and collection and perform schema queries and entity upserts. Fields to be written from each message must have the same names as the collection fields and compatible types. The Quick Start requires at least an explicit `Int64` primary key field named `id`, a `FloatVector` field named `vector`, and optional scalar fields. ## License Licensed under the Apache License 2.0. ## Quick Start Prepare a Connect cluster, Kafka, and a Milvus collection that has already been created and loaded, and verify network connectivity and access permissions. For preparation and management instructions, see [Manage Connectors](../manage-connectors). ```properties theme={null} connector.class=com.milvus.io.kafka.MilvusSinkConnector topics= public.endpoint= token= database.name= collection.name= value.converter=org.apache.kafka.connect.json.JsonConverter value.converter.schemas.enable=false ``` Replace ``, ``, ``, ``, and `` with values from your environment. For ``, use a base address that includes `http://` or `https://` and the required port. The token format depends on the target deployment and can be an API token or the `username:password` form required by that deployment. When writing schemaless JSON objects to the topic, each message value must contain fields whose names exactly match the collection fields, such as the explicit primary key `id` and the `FloatVector` field `vector`. The number of vector elements must match the dimension defined by the collection. ## Configuration ### Milvus Connection and Authentication #### `public.endpoint` The base address of the Milvus or Zilliz Cloud REST v2 API. * **Type**: `string` * **Default**: Empty string * **Importance**: Medium * **Valid values / Notes**: The connector does not validate the URL format. At runtime, you must provide a non-empty HTTP(S) address that the worker can access. When the task starts, it appends collection REST paths to this address and immediately sends requests. * **Required at runtime**: Yes #### `token` The Bearer credential used for Milvus REST requests. * **Type**: `password` * **Default**: `db_admin:****` * **Importance**: High * **Valid values / Notes**: The default is the literal value in ConfigDef, not a usable credential. The task reads the raw configuration directly before applying ConfigDef defaults, so at runtime you must explicitly provide a non-empty, valid API token or the `username:password` form required by the target deployment. Store this value using a secure configuration management method. * **Required at runtime**: Yes ### Target Database and Collection #### `database.name` The Milvus database that contains the target collection. * **Type**: `string` * **Default**: `default` * **Importance**: Medium * **Valid values / Notes**: Use the name of an existing database that the token can access. The connector does not validate the name locally or create the database. The server response determines whether the configuration is usable. #### `collection.name` The Milvus collection that receives Kafka records. * **Type**: `string` * **Default**: Empty string * **Importance**: Medium * **Valid values / Notes**: At runtime, you must specify an existing collection in the `LoadStateLoaded` state. The connector does not create or load the collection. Field names and types must be compatible with the message values, auto-ID must be disabled, and the message values must provide the primary key. * **Required at runtime**: Yes ### Kafka Input and Tasks #### `connector.class` The Milvus Sink Connector implementation class to load. * **Type**: `string` * **Default**: None * **Importance**: High * **Valid values / Notes**: Use `com.milvus.io.kafka.MilvusSinkConnector`. You can also use an alias that Kafka Connect can resolve to this class. * **Required**: Yes #### `topics` The list of Kafka topics to consume. * **Type**: `list` * **Default**: Empty list * **Importance**: High * **Valid values / Notes**: Use comma-separated topic names. Exactly one of `topics` and `topics.regex` must be non-empty. Message values from all selected topics must be compatible with the same target collection. #### `topics.regex` Selects Kafka topics to consume using a Java regular expression. * **Type**: `string` * **Default**: Empty string * **Importance**: High * **Valid values / Notes**: Use a non-empty, compilable Java regular expression. Exactly one of `topics.regex` and `topics` must be non-empty. All matched topics are written to the same target collection. #### `tasks.max` The maximum number of tasks that the connector may create. * **Type**: `int` * **Default**: `1` * **Importance**: High * **Valid values / Notes**: Must be greater than or equal to `1`. Effective parallelism is also limited by the number of partitions in the subscribed topics. Each active task independently checks the same collection and may issue concurrent upserts to it. ### Data Conversion #### `key.converter` Overrides the converter used for Kafka record keys at the connector level. * **Type**: `class` * **Default**: `null` * **Importance**: Low * **Valid values / Notes**: If omitted or set to `null`, the worker's key converter is inherited. If explicitly configured, the value must be an instantiable implementation of `org.apache.kafka.connect.storage.Converter`. The Milvus Sink Connector does not read the converted record key to populate fields or select a collection. #### `value.converter` Specifies the converter used for Kafka record values at the connector level. * **Type**: `class` * **Default**: `null` * **Importance**: Low * **Valid values / Notes**: If omitted or set to `null`, the worker's value converter is inherited. If explicitly configured, the value must be an instantiable implementation of `org.apache.kafka.connect.storage.Converter`. The top-level converted object must be a Connect `Struct` or `java.util.HashMap`, and its field names and convertible values must be compatible with the target collection schema. Sub-configurations for the converter itself are defined by the selected converter. ## Best Practices ### Scale Processing Tasks by Kafka Partition **Use case**: A single task has become the processing bottleneck for continuous writes, the input topic has multiple partitions, and messages in all partitions follow the same collection schema. In this situation, you can gradually increase the number of tasks so that the Kafka consumer group distributes partitions among them. **Configuration example**: Add or override the following property in the Quick Start configuration: ```properties theme={null} tasks.max=3 ``` **Key considerations**: `3` is only an example upper limit. Adjust it gradually based on the number of input partitions, Milvus write capacity, and observed latency. Setting more tasks than the number of assignable partitions does not increase record-processing parallelism. Multiple tasks synchronously upsert to the same collection independently. The connector does not provide global ordering across partitions or tasks, and it does not guarantee that throughput increases linearly with the number of tasks. ### Subscribe to Multiple Homogeneous Topics by Naming Pattern **Use case**: An active data pipeline needs to automatically subscribe to new topics whose names follow a common pattern, and the fields and types in messages from all these topics are compatible with the same target collection. In this situation, you can use a regular-expression subscription to reduce the work of maintaining topic lists individually. **Configuration example**: Keep the Milvus connection, collection, and converter configuration from the Quick Start, remove `topics`, and add: ```properties theme={null} topics.regex=milvus-events-.* ``` **Key considerations**: `topics.regex` and `topics` cannot both be non-empty. All topics matched by the regular expression are written to the same `database.name` and `collection.name`. The connector does not automatically select a collection based on the topic name. If different topics require different collections or schemas, use separate connector instances. ## Monitoring ### What to Monitor Monitor Kafka Connect health, connector and task status, throughput, latency, offset commits, errors, retries, and worker JVM signals. Monitor DLQ activity only when the corresponding error handling is enabled. ### Import the Grafana Dashboard Verify that Connect metrics are available through a Grafana data source and that the collected labels meet the dashboard's filtering requirements. Download the [Kafka Connect Dashboard](https://automq-download-center.oss-cn-hangzhou.aliyuncs.com/connect-dashboard/automq-connect-cluster-dashboard.json), import the JSON into Grafana, and select the corresponding data source. ## Limitations * Version 1.0.1 does not send insert or upsert requests for collections with auto-ID enabled and does not report the batch as failed. Therefore, you must disable auto-ID and explicitly provide the primary key in the message value. * The connector does not create or load collections, and it does not automatically migrate schemas. Each task reads the collection schema only once at startup. After modifying the schema while the task is running, restart the task so that it reads the schema again. * Top-level record values accept only a Connect `Struct` or a concrete `java.util.HashMap`. Top-level primitive values, JSON strings, lists, arrays, byte arrays, and other Map implementations fail conversion inside the connector and are skipped. * Fields are matched by exact, case-sensitive names. Fields in a message that do not exist in the collection schema are ignored, even when dynamic fields are enabled for the collection. The connector does not provide renaming, nested paths, flattening, or default value injection. * `FloatVector` depends on a parsable comma-separated list representation, and the connector does not validate vector dimensions. `Array`, `Float16Vector`, `BFloat16Vector`, and `None` do not have corresponding conversion branches. JSON values are serialized to strings before being sent instead of being sent as structured JSON trees. * Tombstones and records with any field-conversion exception are skipped by the connector itself. This path does not enter Kafka Connect's `ErrantRecordReporter`, DLQ, or the connector retry queue. The task may still return normally and commit offsets past these records. * The set of records delivered to a task by one worker poll forms one synchronous upsert request. The connector has no separate configuration for batch size, byte size, wait time, splitting, asynchronous queues, or rate limiting. One entity rejected by Milvus may cause the entire request to fail. * A non-200 HTTP status, a non-`0` Milvus response code, a network exception, or a response parsing exception terminates the current task as a non-recoverable runtime exception. The connector does not distinguish `429`, `5xx`, authentication, timeout, or validation errors, does not process `Retry-After`, and does not use `errors.tolerance` or the DLQ for this internal REST failure path. * Kafka offset commits and Milvus upserts are not transactional. If a failure occurs after Milvus accepts the request but before the offset is committed, records may be replayed after recovery. The connector does not guarantee exactly-once delivery, absence of duplicates, or global ordering across tasks. * The connector logs the collection name and complete data list for successfully converted batches at INFO level, which may include business fields and large vectors. Restrict access to task logs and configure an appropriate retention policy. ## FAQ ### Why does the task fail immediately at startup? When a task starts, it checks in sequence whether the collection exists and is loaded, and then reads the collection schema. Check whether `public.endpoint` is an accessible REST base address, whether `token` has the required permissions, whether `database.name` and `collection.name` are correct, and whether the collection is already in the `LoadStateLoaded` state. After correcting the target resource or permissions, restart the failed task. ### Why does the connector show as running while no new data appears in Milvus? First, verify that auto-ID is disabled for the collection. When version 1.0.1 encounters a collection with auto-ID enabled, it does not issue a write and does not report the batch as failed. Next, check whether `value.converter` converts the message value to a `Struct` or `HashMap`, whether the value contains an explicit primary key and `FloatVector`, whether field names exactly match the collection schema, and whether field-conversion exceptions appear in the logs. Records that fail conversion are skipped and do not automatically enter the DLQ. ### Why are some fields not written to the collection? The connector writes only fields that exist in the collection schema read at startup and whose names match exactly. Check case, field types, and whether the schema was modified after the task started. Extra fields are not written to dynamic fields. If the collection schema has changed, ensure that messages are compatible with the new schema, and then restart the task to read the description again. ### Why does one Milvus REST error cause the task to enter `FAILED`? The connector throws unsuccessful HTTP responses, nonzero Milvus response codes, network exceptions, and response parsing exceptions as ordinary runtime exceptions instead of Kafka Connect retriable exceptions. `errors.tolerance`, framework retry parameters, and the DLQ do not take over this internal upsert path. Check the task logs and Milvus service status. After correcting address, authentication, schema, request data, or target service issues, restart the task. Records whose offsets were not committed may be upserted again. ### Why do records from multiple topics all go to the same collection? `topics` and `topics.regex` determine only the Kafka input scope and do not participate in target routing. All records in one connector instance are written to the fixed `database.name` and `collection.name`. To write different topics to different collections, create separate connector instances for different sets of topics and configure their target databases and collections separately. # MongoDB Sink Connector Source: https://docs.automq.com/automq-cloud/kafka-connect/sink-connectors/mongodb-sink-connector Configure and operate the MongoDB Sink Connector in AutoMQ Connect, including prerequisites, configuration, monitoring, and troubleshooting. ## Overview The MongoDB Sink Connector consumes records from Kafka topics, converts message keys and values to BSON, and writes them to MongoDB databases and collections. By default, the Connector uses the configured database and uses the Kafka topic name as the collection name. You can also specify a fixed collection, route records dynamically based on record fields, or override write configurations for individual topics. The Connector is suitable for continuously writing business events, state updates, and time-series data from Kafka to MongoDB. The standard write path supports configurable document `_id` values, replacement or update strategies, field processing, bulk writes, and tombstone deletion. For supported CDC messages, dedicated processors can convert change events into MongoDB write operations. ## Prerequisites * The MongoDB account must have the permissions required to create or write to the target database and collection. When using TLS, client certificates, the Stable API, client-side field level encryption, or custom authentication, prepare the corresponding certificates, keys, key vaults, and server capabilities in advance. * When using time-series collections or the Stable API, MongoDB must be version 5.0 or later. For an existing time-series collection, its time field, metadata field, and granularity must match the Connector configuration. ## License Uses the Apache License 2.0. ## Quick Start Prepare a Connect cluster, Kafka, and MongoDB, and confirm network connectivity and access permissions. For preparation and management operations, see [Manage Connectors](../manage-connectors). ```properties theme={null} connector.class=com.mongodb.kafka.connect.MongoSinkConnector topics=mongodb-sink-input connection.uri=mongodb://:27017 database=inventory collection=events value.converter=org.apache.kafka.connect.json.JsonConverter value.converter.schemas.enable=false ``` Replace `` with a MongoDB address accessible to the Connect Worker. This configuration writes JSON objects from `mongodb-sink-input` to `inventory.events`. `value.converter.schemas.enable` is a JSON Converter configuration placed in the Connector `config`. ## Configuration ### Connector Identity and Tasks #### `connector.class` Specifies the MongoDB Sink Connector implementation class. * **Type**: `string` * **Default**: None * **Importance**: High * **Valid values / Notes**: Use `com.mongodb.kafka.connect.MongoSinkConnector`. * **Required**: Yes #### `tasks.max` The maximum number of tasks that the Connector can request. * **Type**: `int` * **Default**: `1` * **Importance**: High * **Valid values / Notes**: Must be at least `1`. Actual parallelism is also limited by the number of topic partitions and Worker assignment. ### Kafka Topic Selection #### `topics` Specifies the list of Kafka topics to consume. * **Type**: `list` * **Default**: Empty list * **Importance**: High * **Valid values / Notes**: Exactly one of `topics` and `topics.regex` must have a non-empty value. #### `topics.regex` Uses a Java regular expression to select the Kafka topics to consume. * **Type**: `string` * **Default**: Empty string * **Importance**: High * **Valid values / Notes**: Must be a valid Java regular expression. Exactly one of `topics` and `topics.regex` must have a non-empty value. ### MongoDB Connection and Authentication #### `connection.uri` The MongoDB Driver connection string, which can include hosts, credentials, and URI options. * **Type**: `password` * **Default**: `mongodb://localhost:27017` * **Importance**: High * **Valid values / Notes**: Must be a valid MongoDB Connection String. Do not expose credentials in documentation or logs. #### `mongo.custom.auth.mechanism.enable` Enables a custom MongoDB credential provider. * **Type**: `boolean-like string` * **Default**: No ConfigDef default * **Importance**: Not declared * **Valid values / Notes**: This public extension is not registered in ConfigDef. Only a value that `Boolean.parseBoolean` parses as `true` enables the provider. When enabled, `mongo.custom.auth.mechanism.providerClass` is required. #### `mongo.custom.auth.mechanism.providerClass` Specifies the custom `CustomCredentialProvider` implementation class. * **Type**: `class-name string` * **Default**: No ConfigDef default * **Importance**: Not declared * **Valid values / Notes**: Required when custom authentication is enabled. The class must be on the plugin classpath, implement `CustomCredentialProvider`, and provide an accessible no-argument constructor. ### TLS #### `connection.ssl.truststore` The truststore file used for MongoDB TLS connections. * **Type**: `string` * **Default**: Empty string * **Importance**: Medium * **Valid values / Notes**: When non-empty, the file must be readable and loadable using `connection.ssl.truststorePassword`. #### `connection.ssl.truststorePassword` The truststore password. * **Type**: `password` * **Default**: Empty string * **Importance**: Medium * **Valid values / Notes**: Used only when `connection.ssl.truststore` is non-empty. #### `connection.ssl.keystore` The keystore file used for client TLS credentials. * **Type**: `string` * **Default**: Empty string * **Importance**: Medium * **Valid values / Notes**: When non-empty, the file must be readable and loadable using `connection.ssl.keystorePassword`. #### `connection.ssl.keystorePassword` The password for the keystore and its private key. * **Type**: `password` * **Default**: Empty string * **Importance**: Medium * **Valid values / Notes**: Used only when `connection.ssl.keystore` is non-empty. ### MongoDB Stable API #### `server.api.version` Specifies the MongoDB Stable API version. * **Type**: `string` * **Default**: Empty string * **Importance**: Medium * **Valid values / Notes**: An empty value disables the Stable API. A non-empty value must be a `ServerApiVersion` supported by the Driver and requires MongoDB 5.0 or later. #### `server.api.deprecation.errors` Treats use of deprecated APIs as an error when the Stable API is enabled. * **Type**: `boolean` * **Default**: `false` * **Importance**: Medium * **Valid values / Notes**: Effective only when `server.api.version` is non-empty. #### `server.api.strict` Enables strict MongoDB Stable API version checking. * **Type**: `boolean` * **Default**: `false` * **Importance**: Medium * **Valid values / Notes**: Effective only when `server.api.version` is non-empty. ### Client-Side Field Level Encryption #### `csfle.enabled` Enables MongoDB client-side field level encryption for Sink writes. * **Type**: `boolean` * **Default**: `false` * **Importance**: Medium * **Valid values / Notes**: When set to `true`, `csfle.key.vault.namespace` and `csfle.local.master.key` are required. #### `csfle.key.vault.namespace` Specifies the key vault namespace in `database.collection` format. * **Type**: `string` * **Default**: Empty string * **Importance**: Medium * **Valid values / Notes**: Must be non-empty when `csfle.enabled=true`. #### `csfle.local.master.key` Specifies a Base64-encoded, 96-byte local KMS master key. * **Type**: `password` * **Default**: Empty string * **Importance**: Medium * **Valid values / Notes**: Required when `csfle.enabled=true`. The value is Base64-decoded at runtime. #### `csfle.schema.map` Specifies the JSON Schema Map that controls automatic field encryption. * **Type**: `string` * **Default**: Empty string * **Importance**: Medium * **Valid values / Notes**: When non-empty, it must parse as a BSON document that maps namespaces to schemas. #### `csfle.bypass.query.analysis` Bypasses automatic CS-FLE query analysis. * **Type**: `boolean` * **Default**: `true` * **Importance**: Low * **Valid values / Notes**: Relevant only when CS-FLE is enabled. Setting it to `false` requires automatic encryption support such as `mongocryptd` or `crypt_shared`. ### Target Namespace #### `database` The default target MongoDB database. * **Type**: `string` * **Default**: None * **Importance**: High * **Valid values / Notes**: Must be a non-empty string. A field path mapper can replace it per record. * **Required**: Yes #### `collection` The default target MongoDB collection. * **Type**: `string` * **Default**: Empty string * **Importance**: High * **Valid values / Notes**: With the default namespace mapper, an empty value uses the Kafka topic name. #### `namespace.mapper` Specifies the `NamespaceMapper` implementation class that selects the target database and collection. * **Type**: `string` * **Default**: `com.mongodb.kafka.connect.sink.namespace.mapping.DefaultNamespaceMapper` * **Importance**: High * **Valid values / Notes**: Must be the fully qualified name of a class that implements `NamespaceMapper` and has a public no-argument constructor. Field path configurations require `com.mongodb.kafka.connect.sink.namespace.mapping.FieldPathNamespaceMapper`. #### `namespace.mapper.key.database.field` Reads the target database name from a field path in the key document. * **Type**: `string` * **Default**: Empty string * **Importance**: Medium * **Valid values / Notes**: Requires `FieldPathNamespaceMapper` and cannot be configured together with `namespace.mapper.value.database.field`. #### `namespace.mapper.key.collection.field` Reads the target collection name from a field path in the key document. * **Type**: `string` * **Default**: Empty string * **Importance**: Medium * **Valid values / Notes**: Requires `FieldPathNamespaceMapper` and cannot be configured together with `namespace.mapper.value.collection.field`. #### `namespace.mapper.value.database.field` Reads the target database name from a field path in the value document. * **Type**: `string` * **Default**: Empty string * **Importance**: Medium * **Valid values / Notes**: Requires `FieldPathNamespaceMapper` and cannot be configured together with `namespace.mapper.key.database.field`. #### `namespace.mapper.value.collection.field` Reads the target collection name from a field path in the value document. * **Type**: `string` * **Default**: Empty string * **Importance**: Medium * **Valid values / Notes**: Requires `FieldPathNamespaceMapper` and cannot be configured together with `namespace.mapper.key.collection.field`. #### `namespace.mapper.error.if.invalid` Controls whether a record fails when a namespace field is missing or is not a string. * **Type**: `boolean` * **Default**: `false` * **Importance**: Medium * **Valid values / Notes**: Used with `FieldPathNamespaceMapper`. `false` falls back to the default database or collection, while `true` throws a `DataException`. #### `topic.override..` Overrides a topic-level Sink configuration for one Kafka topic. * **Type**: `string` * **Default**: Empty string * **Importance**: Low * **Valid values / Notes**: Use a concrete key formed from the actual topic and a registered property; do not use the template key directly. Override values are merged over the global configuration and cannot override `connection.uri` or `topics`. When using `topics.regex`, the topic in an override must match the regular expression. ### Record Conversion #### `key.converter` Overrides the Connector-level message key Converter. * **Type**: `class` * **Default**: No fixed default * **Importance**: Low * **Valid values / Notes**: Inherits the Worker setting when not configured. It must be an instantiable `Converter`, and its subconfigurations use the `key.converter.` prefix. #### `value.converter` Overrides the Connector-level message value Converter. * **Type**: `class` * **Default**: No fixed default * **Importance**: Low * **Valid values / Notes**: Inherits the Worker setting when not configured. It must be an instantiable `Converter`, and its subconfigurations use the `value.converter.` prefix. ### Document Identity #### `document.id.strategy` Specifies the `IdStrategy` implementation class used by `DocumentIdAdder` to generate the MongoDB `_id`. * **Type**: `string` * **Default**: `com.mongodb.kafka.connect.sink.processor.id.strategy.BsonOidStrategy` * **Importance**: High * **Valid values / Notes**: Use the fully qualified name of a class that implements `IdStrategy`. Although an empty string passes ConfigDef validation, initialization fails. Ignored when a CDC processor is configured. #### `document.id.strategy.overwrite.existing` Allows `DocumentIdAdder` to overwrite an existing `_id` in the value document. * **Type**: `boolean` * **Default**: `false` * **Importance**: High * **Valid values / Notes**: Relevant only when `DocumentIdAdder` runs. Ignored when a CDC processor is configured. #### `document.id.strategy.uuid.format` Specifies the BSON representation of UUIDs generated by `UuidStrategy`. * **Type**: `string` * **Default**: `string` * **Importance**: High * **Valid values / Notes**: Case-insensitive. Valid values are `string` and `binary`. Used only with `UuidStrategy`. #### `document.id.strategy.partial.key.projection.type` Specifies the dedicated field projection mode for `PartialKeyStrategy`. * **Type**: `string` * **Default**: Empty string * **Importance**: Low * **Valid values / Notes**: An empty value falls back to `key.projection.type`. Valid values are `none`, `allowlist`, and `blocklist`. The deprecated `whitelist` and `blacklist` values remain compatible but should be replaced by `allowlist` and `blocklist`, respectively. #### `document.id.strategy.partial.key.projection.list` Specifies the field list used by `PartialKeyStrategy`. * **Type**: `string` * **Default**: Empty string * **Importance**: Low * **Valid values / Notes**: An empty value falls back to `key.projection.list`. Used only with `PartialKeyStrategy`. #### `document.id.strategy.partial.value.projection.type` Specifies the dedicated field projection mode for `PartialValueStrategy`. * **Type**: `string` * **Default**: Empty string * **Importance**: Low * **Valid values / Notes**: An empty value falls back to `value.projection.type`. Valid values are `none`, `allowlist`, and `blocklist`. The deprecated `whitelist` and `blacklist` values remain compatible but should be replaced by `allowlist` and `blocklist`, respectively. #### `document.id.strategy.partial.value.projection.list` Specifies the field list used by `PartialValueStrategy`. * **Type**: `string` * **Default**: Empty string * **Importance**: Low * **Valid values / Notes**: An empty value falls back to `value.projection.list`. Used only with `PartialValueStrategy`. ### Writes and Deletion #### `writemodel.strategy` Specifies the implementation class that builds MongoDB WriteModels for non-null records. * **Type**: `string` * **Default**: `com.mongodb.kafka.connect.sink.writemodel.strategy.DefaultWriteModelStrategy` * **Importance**: Low * **Valid values / Notes**: Must implement `WriteModelStrategy`. By default, replacement writes are used, while time-series collections use inserts. Ignored when a CDC processor is configured. #### `delete.on.null.values` Converts tombstone records with a `null` value into MongoDB deletions based on the message key. * **Type**: `boolean` * **Default**: `false` * **Importance**: Medium * **Valid values / Notes**: With the default deletion strategy, `document.id.strategy` must be `FullKeyStrategy`, `PartialKeyStrategy`, or `ProvidedInKeyStrategy`. Ignored when a CDC processor is configured. #### `delete.writemodel.strategy` Specifies the implementation class that builds MongoDB deletion models for tombstone records. * **Type**: `string` * **Default**: `com.mongodb.kafka.connect.sink.writemodel.strategy.DeleteOneDefaultStrategy` * **Importance**: Low * **Valid values / Notes**: Used only when `delete.on.null.values=true`. A custom class must implement `WriteModelStrategy`. #### `max.batch.size` Limits the maximum number of records in each MongoDB bulk write. * **Type**: `int` * **Default**: `0` * **Importance**: Medium * **Valid values / Notes**: Must be at least `0`. `0` means that record groups for the same topic and namespace are not split by this configuration. This value limits the number of records, not the number of BSON bytes. #### `bulk.write.ordered` Controls whether MongoDB bulk writes execute in ordered mode. * **Type**: `boolean` * **Default**: `true` * **Importance**: Medium * **Valid values / Notes**: Ordered mode stops subsequent writes in the current batch after the first write error. Unordered mode can continue other writes in the current batch but does not guarantee record execution order. #### `rate.limiting.timeout` The number of milliseconds the Connector sleeps when rate limiting is triggered. * **Type**: `int` * **Default**: `0` * **Importance**: Low * **Valid values / Notes**: Must be at least `0`. Rate limiting is enabled only when both this configuration and `rate.limiting.every.n` are greater than `0`. #### `rate.limiting.every.n` Specifies how many batches are processed before a rate-limiting sleep is triggered. * **Type**: `int` * **Default**: `0` * **Importance**: Low * **Valid values / Notes**: Must be at least `0`. Rate limiting is enabled only when both this configuration and `rate.limiting.timeout` are greater than `0`. ### Post-Processing and Field Transformations #### `post.processor.chain` Specifies the `PostProcessor` classes executed in sequence on the standard write path. * **Type**: `list` * **Default**: `com.mongodb.kafka.connect.sink.processor.DocumentIdAdder` * **Importance**: Low * **Valid values / Notes**: Each item must be a fully qualified implementation class name. If `DocumentIdAdder` is omitted, the Connector still automatically places it at the beginning of the chain. Ignored when a CDC processor is configured. #### `key.projection.type` Specifies the key field projection mode. * **Type**: `string` * **Default**: `none` * **Importance**: Low * **Valid values / Notes**: Valid values are `none`, `allowlist`, and `blocklist`. `whitelist` and `blacklist` are deprecated and should be replaced by `allowlist` and `blocklist`, respectively. Ignored when a CDC processor is configured. #### `key.projection.list` Specifies the comma-separated field paths used for key field projection. * **Type**: `string` * **Default**: Empty string * **Importance**: Low * **Valid values / Notes**: Interpreted according to `key.projection.type`. Ignored when the mode is `none` or when a CDC processor is configured. #### `value.projection.type` Specifies the value field projection mode. * **Type**: `string` * **Default**: `none` * **Importance**: Low * **Valid values / Notes**: Valid values are `none`, `allowlist`, and `blocklist`. `whitelist` and `blacklist` are deprecated and should be replaced by `allowlist` and `blocklist`, respectively. Ignored when a CDC processor is configured. #### `value.projection.list` Specifies the comma-separated field paths used for value field projection. * **Type**: `string` * **Default**: Empty string * **Importance**: Low * **Valid values / Notes**: Interpreted according to `value.projection.type`. Ignored when the mode is `none` or when a CDC processor is configured. #### `field.renamer.mapping` Specifies a JSON array of exact field path rename rules. * **Type**: `string` * **Default**: `[]` * **Importance**: Low * **Valid values / Notes**: Each enabled object must contain `oldName` and `newName`, and the corresponding rename processor must be configured in `post.processor.chain`. #### `field.renamer.regexp` Specifies a JSON array of regular expression field rename rules. * **Type**: `string` * **Default**: `[]` * **Importance**: Low * **Valid values / Notes**: Objects must be valid regular-expression rename settings, and the corresponding processor must be configured in `post.processor.chain`. Do not use the undefined `field.renamer.regex`. #### `field.value.transformer` Specifies a custom `FieldValueTransformer` to apply to selected value fields. * **Type**: `string` * **Default**: Empty string * **Importance**: Medium * **Valid values / Notes**: When non-empty, it must be the fully qualified name of an implementation class with a public no-argument constructor. The Connector automatically appends the corresponding post-processor on the standard write path. #### `field.value.transformer.fields` Specifies the comma-separated field names processed by `field.value.transformer`. * **Type**: `string` * **Default**: Empty string * **Importance**: Medium * **Valid values / Notes**: Meaningful only when a Transformer is configured. Matching is by field name rather than full path and also matches same-named fields in nested documents and document arrays. ### CDC Processing #### `change.data.capture.handler` Specifies the `CdcHandler` implementation class that interprets CDC envelopes and builds MongoDB WriteModels. * **Type**: `string` * **Default**: Empty string * **Importance**: Low * **Valid values / Notes**: A non-empty value switches to the CDC path and ignores the post-processing chain, field renaming, key and value projections, the standard write model, document ID configurations, and `delete.on.null.values`. #### `change.data.capture.handler.remove.null.values` Removes `null` fields from CDC replacement documents and the `$set` content of updates. * **Type**: `boolean` * **Default**: `false` * **Importance**: Low * **Valid values / Notes**: Effective only when a CDC Handler is configured. It preserves `$unset` and does not affect deletion operations. ### Time-Series Collections #### `timeseries.timefield` Specifies the top-level BSON date-time field for a MongoDB time-series collection. * **Type**: `string` * **Default**: Empty string * **Importance**: Low * **Valid values / Notes**: A non-empty value enables time-series mode and requires MongoDB 5.0 or later. Every record must contain this field, and its value must be a BSON date-time or be automatically convertible. #### `timeseries.metafield` Specifies the optional top-level metadata field for a time-series collection. * **Type**: `string` * **Default**: Empty string * **Importance**: Low * **Valid values / Notes**: A non-empty value requires `timeseries.timefield`. It cannot be the same as the time field or `_id`, and MongoDB does not allow array metadata. #### `timeseries.expire.after.seconds` Specifies the data retention period in seconds for a newly created time-series collection. * **Type**: `long` * **Default**: `0` * **Importance**: Low * **Valid values / Notes**: Must be at least `0`. A non-zero value requires `timeseries.timefield`. `0` means `expireAfterSeconds` is not set when the collection is created. #### `timeseries.granularity` Specifies the expected time interval granularity for a newly created time-series collection. * **Type**: `string` * **Default**: Empty string * **Importance**: Low * **Valid values / Notes**: Valid values are `seconds`, `minutes`, and `hours`. A non-empty value requires `timeseries.timefield`. #### `timeseries.timefield.auto.convert` Converts an epoch-millisecond or string time field to a BSON date-time. * **Type**: `boolean` * **Default**: `false` * **Importance**: Low * **Valid values / Notes**: Adds the conversion processor only in time-series mode. If conversion fails, the original value is preserved and the subsequent write can still fail. #### `timeseries.timefield.auto.convert.date.format` Specifies the `DateTimeFormatter` pattern used to parse string time fields. * **Type**: `string` * **Default**: `yyyy-MM-dd[['T'][ ]][HH:mm:ss[[.][SSSSSS][SSS]][ ]VV[ ]'['VV']'][HH:mm:ss[[.][SSSSSS][SSS]][ ]X][HH:mm:ss[[.][SSSSSS][SSS]]]` * **Importance**: Low * **Valid values / Notes**: Must be accepted by `DateTimeFormatter.ofPattern`. Used only when automatically converting string time values. #### `timeseries.timefield.auto.convert.locale.language.tag` Specifies the Locale Language Tag used by the time-field formatter. * **Type**: `string` * **Default**: Empty string * **Importance**: Low * **Valid values / Notes**: An empty value uses `Locale.ROOT`. A non-empty value must be accepted by `Locale.forLanguageTag`. ### Error Handling and Retries #### `errors.tolerance` Configures Kafka Connect framework fault tolerance and serves as the base value for the Connector's internal fault tolerance. * **Type**: `string` * **Default**: `none` * **Importance**: Medium * **Valid values / Notes**: Kafka Connect 3.9.1 accepts only `none` or `all`. Do not use `data` here even though the Connector ConfigDef accepts it, because the framework rejects it. Use `all` to enable general continued error processing and the DLQ. #### `mongo.errors.tolerance` Independently overrides the Connector's internal fault-tolerance mode. * **Type**: `string` * **Default**: `none` * **Importance**: Medium * **Valid values / Notes**: Valid values are `none`, `data`, and `all`. To tolerate only Connector data errors on Kafka Connect 3.9.1, configure `data` here. #### `errors.log.enable` Enables error logging for the Kafka Connect framework and the Connector. * **Type**: `boolean` * **Default**: `false` * **Importance**: Medium * **Valid values / Notes**: When set to `true`, tolerated Connector errors are also logged. Errors that are not tolerated are logged regardless of this value. #### `mongo.errors.log.enable` Independently overrides the Connector's internal error logging setting. * **Type**: `boolean` * **Default**: `false` * **Importance**: Medium * **Valid values / Notes**: When explicitly configured, it overrides `errors.log.enable`. Connector errors that are not tolerated are still logged. #### `errors.retry.timeout` Configures the total retry duration for retryable processing stages in the Kafka Connect framework, in milliseconds. * **Type**: `long` * **Default**: `0` * **Importance**: Medium * **Valid values / Notes**: `0` disables framework retries, while `-1` means retry indefinitely. This setting does not guarantee retries for MongoDB bulk writes and does not restore the removed `max.num.retries` or `retries.defer.timeout` behavior. MongoDB Driver retryable writes are controlled by Driver options such as those in `connection.uri`. #### `errors.retry.delay.max.ms` Configures the maximum delay between consecutive framework retries, in milliseconds. * **Type**: `long` * **Default**: `60000` * **Importance**: Medium * **Valid values / Notes**: Relevant only when `errors.retry.timeout` allows retries. After reaching the limit, Kafka Connect adds random jitter. ### Dead Letter Queue #### `errors.deadletterqueue.topic.name` Specifies the Kafka topic that receives erroneous Sink records. * **Type**: `string` * **Default**: Empty string * **Importance**: Medium * **Valid values / Notes**: An empty value disables the DLQ. This topic cannot be included in `topics` or match `topics.regex`. Usually configure `errors.tolerance=all` together with the corresponding Connector fault-tolerance mode. #### `errors.deadletterqueue.topic.replication.factor` Specifies the replication factor used when Kafka Connect automatically creates the DLQ topic. * **Type**: `short` * **Default**: `3` * **Importance**: Medium * **Valid values / Notes**: Used only when the DLQ topic does not already exist. The Kafka cluster must support the value. #### `errors.deadletterqueue.context.headers.enable` Adds `__connect.errors.*` context headers to DLQ records. * **Type**: `boolean` * **Default**: `false` * **Importance**: Medium * **Valid values / Notes**: Relevant only when a DLQ is configured. Headers can contain runtime metadata and must be handled according to data governance requirements. ## Best Practices ### Use Stable Record Identity to Control Write Results After Recovery Applicable scenario: The Connector is already writing continuously, and the business requires the same Kafka record to target the same MongoDB document after a Worker restart or offset replay, rather than creating another document because of the default random ObjectId. This strategy is suitable when records are stored according to Kafka record identity and different events do not need to be merged into the same business entity. Use the following complete Connector configuration based on the Quick Start configuration: ```properties theme={null} connector.class=com.mongodb.kafka.connect.MongoSinkConnector topics=mongodb-sink-input connection.uri=mongodb://:27017 database=inventory collection=events value.converter=org.apache.kafka.connect.json.JsonConverter value.converter.schemas.enable=false document.id.strategy=com.mongodb.kafka.connect.sink.processor.id.strategy.KafkaMetaDataStrategy ``` `KafkaMetaDataStrategy` generates a stable `_id` from the topic, partition, and offset. Together with the default replacement-and-upsert write model, this allows a replay of the same record to target the same document. It does not provide end-to-end exactly-once semantics: there is no atomic transaction between MongoDB writes and Kafka offset commits, and triggers, validation, and other external side effects can still run again. ### Scale Throughput by Partition Count and Write Pressure Applicable scenario: The basic pipeline is running and must use multiple Kafka partitions to increase parallelism while limiting the number of records in each MongoDB bulk write to balance throughput, request size, latency, and the scope of failures. Use the following complete Connector configuration based on the Quick Start configuration, and adjust the example values according to the actual topic partition count and MongoDB capacity: ```properties theme={null} connector.class=com.mongodb.kafka.connect.MongoSinkConnector topics=mongodb-sink-input connection.uri=mongodb://:27017 database=inventory collection=events value.converter=org.apache.kafka.connect.json.JsonConverter value.converter.schemas.enable=false tasks.max=4 max.batch.size=1000 ``` `tasks.max` is only the maximum allowed number of tasks; actual parallelism is limited by topic partition assignment, and multiple tasks can write to the same collection concurrently. `max.batch.size` splits batches by record count rather than BSON byte size. Increasing the value can usually reduce request count, but it can also increase per-batch latency and the scope of errors. No global ordering or atomicity is provided across tasks, batches, or namespaces. ### Send Tolerated Errors to a Dead Letter Queue Applicable scenario: The pipeline has entered stable operations. Individual malformed records or failed writes should not immediately stop the entire task, while operators need to retain the erroneous records and context for investigation, correction, and replay. Use the following complete Connector configuration based on the Quick Start configuration, and create a separate DLQ topic in advance: ```properties theme={null} connector.class=com.mongodb.kafka.connect.MongoSinkConnector topics=mongodb-sink-input connection.uri=mongodb://:27017 database=inventory collection=events value.converter=org.apache.kafka.connect.json.JsonConverter value.converter.schemas.enable=false errors.tolerance=all mongo.errors.tolerance=all errors.log.enable=true errors.deadletterqueue.topic.name=mongodb-sink-dlq errors.deadletterqueue.context.headers.enable=true ``` The DLQ topic cannot also be an input topic. Tolerated records are excluded from MongoDB writes and allow current processing to continue; this is not an automatic repair or retry mechanism. Continuously monitor the DLQ, verify that it does not contain sensitive context, and establish a replay process after correction. The outcome of a write that reports a Write Concern error can be uncertain, so a DLQ record alone does not prove that the target was not written. ## Monitoring ### What to Monitor Monitor Kafka Connect health, Connector and task status, throughput, latency, offset commits, errors, retries, and Worker JVM signals. Monitor DLQ activity only when the corresponding error handling is enabled. ### Import the Grafana Dashboard Confirm that Connect metrics are available in a Grafana data source and that the collected labels satisfy the dashboard filters. Download the [Kafka Connect Dashboard](https://automq-download-center.oss-cn-hangzhou.aliyuncs.com/connect-dashboard/automq-connect-cluster-dashboard.json), import the JSON into Grafana, and select the corresponding data source. ## Limitations * There is no atomic transaction between MongoDB writes and Kafka offset commits. If a Worker stops after a write succeeds but before the offset is persisted, it can process the same record again after recovery. Therefore, this behavior cannot be used to claim exactly-once processing, no duplicates, or no data loss. * Writes do not preserve atomicity or global ordering across batches, namespaces, or tasks. Increasing `tasks.max` can cause multiple tasks to write to the same collection concurrently. * Enabling `change.data.capture.handler` bypasses the standard post-processing chain, document ID strategy, standard WriteModel strategy, and tombstone deletion configuration. These paths cannot be combined to compose behavior. * `InsertOne` has no upsert behavior. Replaying a stable `_id` can cause a duplicate-key error, while replaying a random `_id` can create additional documents. * Tolerated error records are not automatically retried by the Connector. Without an available Errant Record Reporter or a configured DLQ, these records can be skipped without being copied to a DLQ. * Time-series mode and the Stable API require MongoDB 5.0 or later, and a time-series collection's time field must be a BSON date-time or a value that can be converted successfully. ## FAQ ### The Connector Reports That a Topic Must Be Configured During Startup Validation fails when both `topics` and `topics.regex` are empty or when both are non-empty. Keep only one selection method: use `topics` to list topics explicitly, or configure `topics.regex` with a valid Java regular expression for dynamic matching. Also confirm that the DLQ topic is outside the input range. ### Records Are Written to the Wrong Database or Collection The default mapper uses `database` and uses the Kafka topic name when `collection` is empty. Check whether `topic.override..` or `FieldPathNamespaceMapper` is configured. Field routing values must be strings, and the key and value cannot both provide fields for the same namespace component. To fail immediately when a field is invalid, set `namespace.mapper.error.if.invalid=true`. ### Additional Documents Appear in MongoDB After a Restart The default `BsonOidStrategy` generates a new ObjectId each time a record is processed, so offset replay can create a new document. Select a stable ID strategy based on business identity, such as generating an ID from the Kafka topic, partition, and offset or extracting an ID from a stable message key or value, and evaluate replay results together with the replacement or update WriteModel. A stable ID controls only target document selection and does not provide exactly-once processing. ### A Record with a Null Value Does Not Delete the Document By default, `delete.on.null.values=false`. After it is enabled, the default deletion strategy also requires `FullKeyStrategy`, `PartialKeyStrategy`, or `ProvidedInKeyStrategy`, and the message key must form a valid deletion condition. When a CDC Handler is configured, this setting is ignored; inspect the message according to the deletion event format of the corresponding CDC Handler. ### Validation Fails When errors.tolerance=data Is Configured The MongoDB Connector ConfigDef accepts `data`, but the Kafka Connect 3.9.1 framework configuration accepts only `none` or `all`. To tolerate only data-processing errors inside the Connector, configure `mongo.errors.tolerance=data` in the Connector-specific setting. Depending on whether framework-level continued processing or the DLQ is required, keep `errors.tolerance` as `none` or set it to `all`. `mongo.errors.tolerance` does not control errors in the key or value converter stage; Kafka Connect handles those errors according to the framework-level `errors.tolerance` setting. ### No Error Records Appear in the DLQ After Fault Tolerance Is Configured Check that `errors.deadletterqueue.topic.name` is non-empty, that the DLQ topic is separate from the input topics, that `errors.tolerance` allows the framework to continue processing, and whether `mongo.errors.tolerance` overrides the Connector's internal fault tolerance. Also confirm that the runtime provides an available Errant Record Reporter. Otherwise, the Connector can use an empty Reporter and will not write error records to the DLQ. # Neo4j Sink Connector Source: https://docs.automq.com/automq-cloud/kafka-connect/sink-connectors/neo4j-sink-connector Configure and operate the Neo4j Sink Connector in AutoMQ Connect, including Cypher and pattern strategies, delivery behavior, security, monitoring, and troubleshooting. ## Overview The Neo4j Sink Connector consumes records from Kafka topics and converts them into writes of nodes, relationships, and properties to Neo4j or Aura databases. The connector sits between Kafka and the graph database and supports selecting a Cypher, Pattern, CUD, CDC Schema, or CDC Source Id strategy for each topic. Each topic must be associated with exactly one strategy. The Cypher strategy is suitable when custom statements are needed to control graph writes. The Pattern strategy is suitable for declaratively mapping fields to nodes or relationships. The CUD and CDC strategies consume their corresponding operation or change event formats. Typical uses include building knowledge graphs from business events, continuously updating entity relationships, and transferring CDC events between Neo4j databases. ## License Licensed under the Apache License 2.0. ## Quick Start Prepare a Connect Cluster, Kafka, and a target Neo4j database, and confirm network connectivity and access permissions. For preparation and management procedures, see [Manage Connectors](../manage-connectors). ```properties theme={null} connector.class=org.neo4j.connectors.kafka.sink.Neo4jConnector topics=people neo4j.uri=neo4j://:7687 neo4j.database= neo4j.authentication.type=BASIC neo4j.authentication.basic.username= neo4j.authentication.basic.password= neo4j.cypher.topic.people=MERGE (p:Person {id: __value.id}) SET p.name = __value.name, p.surname = __value.surname ``` Replace the Neo4j address, database, and credential placeholders. The example requires message values in the `people` topic to provide the `id`, `name`, and `surname` fields. The connector executes Cypher using the default `__value` binding and merges by `id` into `Person` nodes. In production, provide the password through a secure credential management mechanism. ## Configuration ### Connector Identity and Topic Subscription #### `connector.class` The Neo4j Sink Connector implementation class to load. * **Type**: `string` * **Default**: None * **Importance**: High * **Valid values / Notes**: Use `org.neo4j.connectors.kafka.sink.Neo4jConnector`. * **Required**: Yes #### `topics` The list of Kafka topics to consume. * **Type**: `list` * **Default**: Empty list * **Importance**: High * **Valid values / Notes**: Use a comma-separated list of literal topic names. Each name must be handled by exactly one sink strategy. Neo4j 5.5.1 cannot use `topics.regex` to establish the required per-topic strategy mapping. * **Required**: Yes ### Neo4j Connection #### `neo4j.uri` One or more Neo4j connection URIs. * **Type**: `list` * **Default**: None * **Importance**: High * **Valid values / Notes**: The URI scheme must be `neo4j`, `neo4j+s`, `neo4j+ssc`, `bolt`, `bolt+s`, or `bolt+ssc`. Multiple URIs are used for custom address resolution. If the port is omitted, `7687` is used. * **Required**: Yes #### `neo4j.database` The name of the Neo4j database to write to. * **Type**: `string` * **Default**: `""` * **Importance**: High * **Valid values / Notes**: An empty string lets the Neo4j driver or server select the database. Explicitly specifying the target database is recommended. ### Authentication #### `neo4j.authentication.type` The authentication type used to connect to Neo4j. * **Type**: `string` * **Default**: `BASIC` * **Importance**: High * **Valid values / Notes**: Valid values are `NONE`, `BASIC`, `KERBEROS`, `BEARER`, and `CUSTOM`. The selected type determines which credential settings must be provided. #### `neo4j.authentication.basic.username` The Basic authentication username. * **Type**: `string` * **Default**: `""` * **Importance**: High * **Valid values / Notes**: Must be non-empty when `neo4j.authentication.type=BASIC`. * **Required**: `conditional` (required when using Basic authentication) #### `neo4j.authentication.basic.password` The Basic authentication password. * **Type**: `password` * **Default**: `""` * **Importance**: High * **Valid values / Notes**: Must be non-empty when `neo4j.authentication.type=BASIC`. Provide it through a Config Provider or an equivalent secret management mechanism. * **Required**: `conditional` (required when using Basic authentication) #### `neo4j.authentication.basic.realm` The Basic authentication realm. * **Type**: `string` * **Default**: `""` * **Importance**: Low * **Valid values / Notes**: Used only for Basic authentication. An empty string selects the default realm. #### `neo4j.authentication.kerberos.ticket` The Kerberos authentication ticket. * **Type**: `password` * **Default**: `""` * **Importance**: High * **Valid values / Notes**: Must be non-empty when `neo4j.authentication.type=KERBEROS` and should be provided through a secure credential management mechanism. * **Required**: `conditional` (required when using Kerberos authentication) #### `neo4j.authentication.bearer.token` The Bearer authentication token. * **Type**: `password` * **Default**: `""` * **Importance**: High * **Valid values / Notes**: Must be non-empty when `neo4j.authentication.type=BEARER` and should be provided through a secure credential management mechanism. * **Required**: `conditional` (required when using Bearer authentication) #### `neo4j.authentication.custom.scheme` The custom authentication scheme. * **Type**: `string` * **Default**: `""` * **Importance**: High * **Valid values / Notes**: Must be non-empty when `neo4j.authentication.type=CUSTOM`. * **Required**: `conditional` (required when using custom authentication) #### `neo4j.authentication.custom.principal` The custom authentication principal. * **Type**: `string` * **Default**: `""` * **Importance**: High * **Valid values / Notes**: Must be non-empty when `neo4j.authentication.type=CUSTOM`. * **Required**: `conditional` (required when using custom authentication) #### `neo4j.authentication.custom.credentials` The custom authentication credentials. * **Type**: `password` * **Default**: `""` * **Importance**: High * **Valid values / Notes**: Must be non-empty when `neo4j.authentication.type=CUSTOM` and should be provided through a secure credential management mechanism. * **Required**: `conditional` (required when using custom authentication) #### `neo4j.authentication.custom.realm` The realm passed to the custom Neo4j Auth Token. * **Type**: `string` * **Default**: `""` * **Importance**: High * **Valid values / Notes**: Used only for custom authentication. Whether it is required depends on the authentication provider. ### TLS #### `neo4j.security.encrypted` Whether to enable plugin-managed encryption for plain `bolt` or `neo4j` URIs. * **Type**: `string` (logical type: boolean) * **Default**: `false` * **Importance**: Low * **Valid values / Notes**: Use only `true` or `false`. Encryption for `+s` and `+ssc` URIs is controlled by the URI itself and does not use this setting. #### `neo4j.security.trust-strategy` The certificate trust strategy used with plugin-managed TLS. * **Type**: `string` * **Default**: `TRUST_SYSTEM_CA_SIGNED_CERTIFICATES` * **Importance**: Low * **Valid values / Notes**: Valid values are `TRUST_ALL_CERTIFICATES`, `TRUST_CUSTOM_CA_SIGNED_CERTIFICATES`, and `TRUST_SYSTEM_CA_SIGNED_CERTIFICATES`. This setting applies only when plugin-managed encryption is enabled for a plain URI. * **Required**: `conditional` (must be non-empty when plugin-managed encryption is enabled) #### `neo4j.security.hostname-verification-enabled` Whether to verify the certificate hostname during the TLS handshake. * **Type**: `string` (logical type: boolean) * **Default**: `true` * **Importance**: Low * **Valid values / Notes**: Use only `true` or `false`. This setting applies only to plugin-managed encryption enabled for a plain URI. * **Required**: `conditional` (must be non-empty when plugin-managed encryption is enabled) #### `neo4j.security.cert-files` The list of custom CA certificate files. * **Type**: `list` * **Default**: Empty list * **Importance**: Low * **Valid values / Notes**: Each entry must be an absolute path to a regular file readable by the worker. The list must not be empty when `TRUST_CUSTOM_CA_SIGNED_CERTIFICATES` is selected. * **Required**: `conditional` (required when using the custom CA trust strategy) ### Connection Pool and Transaction Retries #### `neo4j.connection-timeout` The timeout for establishing a Neo4j TCP connection. * **Type**: `string` (logical type: duration) * **Default**: `30s` * **Importance**: Low * **Valid values / Notes**: Must be a non-negative compound duration using `ms`, `s`, `m`, `h`, or `d`. #### `neo4j.pool.max-connection-pool-size` The maximum number of connections retained by the Neo4j driver connection pool. * **Type**: `int` * **Default**: `100` * **Importance**: Low * **Valid values / Notes**: Must be at least `1`. Adjust it based on task parallelism and target database capacity. #### `neo4j.pool.connection-acquisition-timeout` The maximum time to wait for a connection from the connection pool. * **Type**: `string` (logical type: duration) * **Default**: `1m` * **Importance**: Low * **Valid values / Notes**: Must be a non-negative compound duration using `ms`, `s`, `m`, `h`, or `d`. #### `neo4j.pool.max-connection-lifetime` The maximum lifetime of a connection in the pool. * **Type**: `string` (logical type: duration) * **Default**: `1h` * **Importance**: Low * **Valid values / Notes**: Must be a non-negative compound duration using `ms`, `s`, `m`, `h`, or `d`. #### `neo4j.pool.idle-time-before-connection-test` The amount of time an idle connection may remain idle before a liveness check is performed. * **Type**: `string` (logical type: duration) * **Default**: `""` * **Importance**: Low * **Valid values / Notes**: May be empty or a non-negative compound duration. Leaving it empty preserves the driver's disabled or default liveness-check semantics. #### `neo4j.max-retry-time` The maximum time the Neo4j driver retries retryable transactions. * **Type**: `string` (logical type: duration) * **Default**: `30s` * **Importance**: Low * **Valid values / Notes**: Must be a non-negative compound duration using `ms`, `s`, `m`, `h`, or `d`. It does not control Kafka Connect framework error tolerance or DLQ behavior. ### Write Strategies and Topic Routing #### `neo4j.cypher.topic.` The Cypher statement executed for the specified topic. * **Type**: `string` * **Default**: None * **Importance**: N/A * **Valid values / Notes**: Replace `` with the exact topic name from `topics`. Each topic can use only one strategy. Cypher is parsed and executed at task runtime. * **Required**: `conditional` (required when the topic uses the Cypher strategy) #### `neo4j.pattern.topic.` The node or relationship Pattern mapping for the specified topic. * **Type**: `string` * **Default**: None * **Importance**: N/A * **Valid values / Notes**: Replace `` with the exact topic name from `topics`. The Pattern must parse as a node or relationship mapping, and the topic cannot use another strategy. * **Required**: `conditional` (required when the topic uses the Pattern strategy) #### `neo4j.cud.topics` The list of topics that use the CUD operation format. * **Type**: `list` * **Default**: Empty list * **Importance**: Medium * **Valid values / Notes**: Topics in the list must also appear in `topics` and cannot be assigned to another strategy. Message values must conform to the connector's CUD structure. #### `neo4j.cdc.schema.topics` The list of topics that use the CDC Schema strategy. * **Type**: `list` * **Default**: Empty list * **Importance**: Medium * **Valid values / Notes**: Topics in the list must also appear in `topics` and cannot be assigned to another strategy. Messages must use a supported Neo4j CDC Schema or a compatible legacy Streams event structure. #### `neo4j.cdc.source-id.topics` The list of topics that use the CDC Source Id strategy. * **Type**: `list` * **Default**: Empty list * **Importance**: Medium * **Valid values / Notes**: Topics in the list must also appear in `topics` and cannot be assigned to another strategy. Events must contain a source element ID. #### `neo4j.cdc.source-id.label-name` The identity label used for target nodes by the CDC Source Id strategy. * **Type**: `string` * **Default**: `SourceEvent` * **Importance**: Low * **Valid values / Notes**: Used only when `neo4j.cdc.source-id.topics` is non-empty. Keep it stable for the source to avoid collisions between element IDs from different sources. #### `neo4j.cdc.source-id.property-name` The property name used by the CDC Source Id strategy to store the source element ID. * **Type**: `string` * **Default**: `sourceId` * **Importance**: Low * **Valid values / Notes**: Used only when `neo4j.cdc.source-id.topics` is non-empty. Changing the property name changes how target identities are matched. ### Cypher Record Bindings #### `neo4j.cypher.bind-timestamp-as` The variable name that exposes the Kafka record timestamp in Cypher. * **Type**: `string` * **Default**: `__timestamp` * **Importance**: Medium * **Valid values / Notes**: An empty string disables the binding. The timestamp is converted to a UTC Offset Date-Time. At least one valid Cypher binding must remain when a binding is disabled. #### `neo4j.cypher.bind-header-as` The variable name that exposes Kafka headers in Cypher. * **Type**: `string` * **Default**: `__header` * **Importance**: Low * **Valid values / Notes**: An empty string disables the binding. At least one valid Cypher binding must remain when a binding is disabled. #### `neo4j.cypher.bind-key-as` The variable name that exposes the Kafka record key in Cypher. * **Type**: `string` * **Default**: `__key` * **Importance**: Low * **Valid values / Notes**: An empty string disables the binding. At least one valid Cypher binding must remain when a binding is disabled. #### `neo4j.cypher.bind-value-as` The variable name that exposes the Kafka record value in Cypher. * **Type**: `string` * **Default**: `__value` * **Importance**: Low * **Valid values / Notes**: An empty string disables the binding. At least one valid Cypher binding must remain when a binding is disabled. #### `neo4j.cypher.bind-value-as-event` Whether to also bind the record value using the legacy `event` variable name. * **Type**: `string` (logical type: boolean) * **Default**: `true` * **Importance**: Low * **Valid values / Notes**: Use only `true` or `false`. When set to `false`, at least one explicit Cypher binding must remain non-empty. ### Pattern Record Bindings and Property Writes #### `neo4j.pattern.bind-timestamp-as` The Kafka record timestamp alias used in Pattern expressions. * **Type**: `string` * **Default**: `__timestamp` * **Importance**: Low * **Valid values / Notes**: An empty string disables the alias. #### `neo4j.pattern.bind-header-as` The Kafka header alias used in Pattern expressions. * **Type**: `string` * **Default**: `__header` * **Importance**: Low * **Valid values / Notes**: An empty string disables the alias. #### `neo4j.pattern.bind-key-as` The Kafka record key alias used in Pattern expressions. * **Type**: `string` * **Default**: `__key` * **Importance**: Low * **Valid values / Notes**: An empty string disables the alias. #### `neo4j.pattern.bind-value-as` The Kafka record value alias used in Pattern expressions. * **Type**: `string` * **Default**: `__value` * **Importance**: Low * **Valid values / Notes**: An empty string disables the alias. The value of a non-tombstone message must be convertible to a Map. #### `neo4j.pattern.merge-node-properties` Whether the Pattern strategy includes incoming properties in node `MERGE` matching conditions. * **Type**: `string` (logical type: boolean) * **Default**: `false` * **Importance**: Low * **Valid values / Notes**: Use only `true` or `false`. This setting applies only to node and relationship Pattern strategies. When enabled, property changes may affect node matching results. #### `neo4j.pattern.merge-relationship-properties` Whether the relationship Pattern strategy includes incoming properties in relationship `MERGE` matching conditions. * **Type**: `string` (logical type: boolean) * **Default**: `false` * **Importance**: Low * **Valid values / Notes**: Use only `true` or `false`. This setting applies only to the relationship Pattern strategy. When enabled, property changes may affect relationship matching results. ### Batching and Target-side Offsets #### `neo4j.batch-size` The maximum number of events included when generating a batch of write statements for each topic. * **Type**: `int` * **Default**: `1000` * **Importance**: Medium * **Valid values / Notes**: Must be at least `1`. When APOC is available, it is used to split write transaction batches. On the native path, it limits the number of events in each generated statement, but multiple statements for the same topic group may still be in one Neo4j managed transaction. #### `neo4j.batch-timeout` The publicly registered batch duration setting. * **Type**: `string` (logical type: duration) * **Default**: `0s` * **Importance**: Medium * **Valid values / Notes**: Accepts non-negative compound durations using `ms`, `s`, `m`, `h`, or `d`. The main sink execution path in Neo4j Connector 5.5.1 does not read this setting, so it cannot be relied on to limit batch or transaction execution time. #### `neo4j.max-batched-queries` The maximum number of distinct statement shapes that can be combined in a batch on the native batching path. * **Type**: `int` * **Default**: `50` * **Importance**: Low * **Valid values / Notes**: Must be at least `1`. When the limit is reached, the native path splits the generated work. The APOC path does not read this setting. #### `neo4j.eos-offset-label` The Neo4j label used for target-side offset nodes. * **Type**: `string` * **Default**: `""` * **Importance**: High * **Valid values / Notes**: An empty string disables target-side offset nodes. When non-empty, the connector stores written offsets by strategy, topic, and partition, and requires the corresponding constraint in the target database. This mechanism only filters offsets committed to Neo4j within the same identity scope and does not provide an end-to-end or global exactly-once guarantee. Do not rely on this mechanism when the same task processes records from multiple partitions of the same topic in one operation. ### Tasks and Converters #### `tasks.max` The maximum number of tasks the connector requests to create. * **Type**: `int` * **Default**: `1` * **Importance**: High * **Valid values / Notes**: Must be at least `1`. Actual parallelism is limited by Kafka partition assignment and Neo4j concurrency capacity. There is no global ordering across tasks, topics, or partitions. #### `tasks.max.enforce` Whether to enforce that the number of tasks returned by the connector does not exceed `tasks.max`. * **Type**: `boolean` * **Default**: `true` * **Importance**: Low * **Valid values / Notes**: Kafka Connect 3.9.1 has deprecated this setting and plans to remove it in a future major release. No replacement is provided. Keep it set to `true`. * **Deprecated**: Yes #### `key.converter` The connector-level Kafka record key converter class. * **Type**: `class` * **Default**: `null` * **Importance**: Low * **Valid values / Notes**: When omitted, the worker's key converter is inherited. An explicit value must be an instantiable Kafka Connect `Converter` implementation. Converter-specific settings are defined by the corresponding plugin. #### `value.converter` The connector-level Kafka record value converter class. * **Type**: `class` * **Default**: `null` * **Importance**: Low * **Valid values / Notes**: When omitted, the worker's value converter is inherited. An explicit value must be an instantiable Kafka Connect `Converter` implementation. All sink strategies use the converted value. ### Error Handling and DLQ #### `errors.tolerance` The Kafka Connect tolerance policy for record errors. * **Type**: `string` * **Default**: `none` * **Importance**: Medium * **Valid values / Notes**: Valid values are `none` and `all`. `all` allows the Errant Record Reporter to isolate records that cannot be processed, but setting this option alone does not configure a DLQ. This mechanism is separate from the database transaction retries controlled by `neo4j.max-retry-time`. #### `errors.deadletterqueue.topic.name` The name of the DLQ topic for records that cannot be processed. * **Type**: `string` * **Default**: `""` * **Importance**: Medium * **Valid values / Notes**: An empty string disables the DLQ. A non-empty topic must not be the same as a subscribed business topic. Use it with `errors.tolerance=all`. #### `errors.deadletterqueue.topic.replication.factor` The replication factor used when Kafka Connect creates the DLQ topic. * **Type**: `short` * **Default**: `3` * **Importance**: Medium * **Valid values / Notes**: Must be suitable for the number of brokers in the Kafka cluster. It is not used to create a topic when no DLQ is configured or the topic already exists. #### `errors.deadletterqueue.context.headers.enable` Whether to add error context headers to DLQ records. * **Type**: `boolean` * **Default**: `false` * **Importance**: Medium * **Valid values / Notes**: Applies only when a record is actually written to the DLQ. Set it to `true` to retain the connector error context needed for troubleshooting. ## Best Practices ### Declare Field-to-Graph Mappings During Initial Integration Applicable scenario: You are writing structurally stable entity events to Neo4j for the first time, want to avoid maintaining custom Cypher, and need to define which fields identify nodes and which fields become node properties. The following configuration uses the Pattern strategy, with `id` as the matching key for `Person` nodes and `name` and `surname` written as properties. ```properties theme={null} connector.class=org.neo4j.connectors.kafka.sink.Neo4jConnector topics=people neo4j.uri=neo4j://:7687 neo4j.database= neo4j.authentication.type=BASIC neo4j.authentication.basic.username= neo4j.authentication.basic.password= neo4j.pattern.topic.people=(:Person{!id,name,surname}) ``` Key considerations: First ensure that the message value can be converted to a Map containing `id`, `name`, and `surname`, and create an appropriate constraint for the business unique key in the target database. In the Pattern, `!id` marks `id` as the node matching key, while `name` and `surname` are written as properties. Without valid uniqueness, the connector may match or create unintended entities. Do not configure Cypher, CUD, or CDC strategies for the same `people` topic. ### Scale Tasks by Partition for Continuous Writes Applicable scenario: The connector is continuously writing to Neo4j, a single task cannot meet throughput or latency requirements, and the business topic has multiple partitions available for parallel assignment. The following configuration raises the task limit to `4` based on the Quick Start configuration. ```properties theme={null} connector.class=org.neo4j.connectors.kafka.sink.Neo4jConnector tasks.max=4 topics=people neo4j.uri=neo4j://:7687 neo4j.database= neo4j.authentication.type=BASIC neo4j.authentication.basic.username= neo4j.authentication.basic.password= neo4j.cypher.topic.people=MERGE (p:Person {id: __value.id}) SET p.name = __value.name, p.surname = __value.surname ``` Key considerations: `tasks.max=4` is only the requested task limit and does not guarantee that four tasks will run. Effective parallelism cannot exceed the number of assignable partitions and is also limited by the Neo4j connection pool and database write capacity. Observe task assignments, throughput, latency, and database load before and after scaling. Rely only on ordering within a single topic partition; do not assume global ordering across tasks or partitions. ### Isolate Bad Records with a DLQ During Routine Operation Applicable scenario: During continuous writes, a small number of records may fail conversion, violate a strategy's structure, or cause Neo4j writes to fail. You want to retain these records for investigation while allowing processable records to continue. The following configuration enables error tolerance, a DLQ, and context headers. ```properties theme={null} connector.class=org.neo4j.connectors.kafka.sink.Neo4jConnector topics=people neo4j.uri=neo4j://:7687 neo4j.database= neo4j.authentication.type=BASIC neo4j.authentication.basic.username= neo4j.authentication.basic.password= neo4j.cypher.topic.people=MERGE (p:Person {id: __value.id}) SET p.name = __value.name, p.surname = __value.surname errors.tolerance=all errors.deadletterqueue.topic.name= errors.deadletterqueue.topic.replication.factor=3 errors.deadletterqueue.context.headers.enable=true ``` Key considerations: The DLQ topic must not overlap with `people`, and the replication factor must be suitable for the Kafka cluster. After a batch fails, the connector attempts to isolate individual records. Successful records may already have been committed, while records accepted by the reporter and written to the DLQ are not written to Neo4j. In that case, `put` can return successfully and later Kafka offset commits may advance past those records. Continuously monitor the DLQ, correct the data or mapping, and replay records separately according to business requirements. This configuration does not provide transaction retries or an exactly-once guarantee. ## Monitoring ### What to Monitor Monitor Kafka Connect health, connector and task status, throughput, latency, offset commits, errors, retries, and worker JVM signals. Monitor DLQ activity only when the corresponding error handling is enabled. ### Import the Grafana Dashboard Confirm that Connect metrics are available in a Grafana data source and that collected labels satisfy the dashboard filters. Download the [Kafka Connect Dashboard](https://automq-download-center.oss-cn-hangzhou.aliyuncs.com/connect-dashboard/automq-connect-cluster-dashboard.json), import the JSON into Grafana, and select the corresponding data source. ## Limitations * Sink strategies in Neo4j Connector 5.5.1 depend on exact topic names in `topics`; `topics.regex` cannot replace the literal topic list. * Each topic must be assigned to exactly one of the Cypher, Pattern, CUD, CDC Schema, or CDC Source Id strategies. The connector does not support selecting a strategy dynamically per record or using a fallback strategy. * Although `neo4j.batch-timeout` passes configuration validation, the main sink execution path in 5.5.1 does not read it, so it cannot limit batch or transaction execution time. * The connector does not provide global write ordering across tasks, topics, or Kafka partitions. CDC transaction IDs and sequence numbers also do not reconstruct source transaction boundaries. * `neo4j.eos-offset-label` filters offsets committed to Neo4j only within a stable strategy, topic, partition, target database, and label identity. It does not provide an end-to-end or global exactly-once guarantee, and should not be relied on when records from multiple partitions of the same topic enter one task batch. ## FAQ ### A Task Reports That a Topic Has No Strategy or Has Multiple Strategies at Startup An inconsistency between `topics` and the strategy settings prevents the task from starting. Check that each literal topic appears in exactly one place: its corresponding `neo4j.cypher.topic.` or `neo4j.pattern.topic.`, or one of `neo4j.cud.topics`, `neo4j.cdc.schema.topics`, and `neo4j.cdc.source-id.topics`. Remove duplicate assignments and extra strategy topics not listed in `topics`, then restart the connector. ### The Connector Cannot Connect to or Authenticate with Neo4j A mismatch in the URI scheme, database name, authentication type, or credentials can cause connection failures. First confirm that `neo4j.uri` is reachable from the worker, then verify the non-empty credentials required by the selected authentication type. When using TLS, also check the URI scheme, trust strategy, hostname verification, and the absolute paths and read permissions of custom CA files. ### Duplicate Nodes or Relationships Appear After a Restart Kafka offset commits may occur after Neo4j transactions have already committed, so non-idempotent Cypher or CUD `CREATE` operations may produce duplicate results during replay. Prefer idempotent writes designed with stable business keys, constraints, and `MERGE`. If you evaluate using `neo4j.eos-offset-label`, you must also keep the strategy, topic, partition, target database, and label unchanged. The mechanism is not globally exactly-once and should not be used as a replay-filtering guarantee when one task processes records from multiple partitions of the same topic in a single operation. ### Bad Records Do Not Enter the DLQ or the Task Still Fails Setting only the DLQ topic does not enable error tolerance. Confirm that `errors.tolerance=all` is also set, that the DLQ topic does not overlap with business subscriptions, and that Kafka Connect can access or create the topic. Then check the DLQ replication factor, reporter errors, and Neo4j exceptions. Errors that the reporter cannot accept still cause `put` to fail. # New Relic Sink Connector Source: https://docs.automq.com/automq-cloud/kafka-connect/sink-connectors/new-relic-sink-connector Configure and operate the New Relic Sink Connector in AutoMQ Connect, including prerequisites, configuration, monitoring, and troubleshooting. ## Overview The New Relic Sink Connector consumes records from Kafka topics, converts them into New Relic telemetry data, and sends them to New Relic. A Connector instance processes only one telemetry type. The same plugin provides three deployable concrete classes. `com.newrelic.telemetry.events.EventsSinkConnector` converts each record into an Event. The record value must contain a string field named `eventType`. The optional `timestamp` uses a Unix timestamp in milliseconds, and the remaining supported fields become event attributes. `com.newrelic.telemetry.logs.LogsSinkConnector` converts each record into a Log. A string field named `message` is recommended. The optional `timestamp` uses a Unix timestamp in milliseconds, and the remaining supported fields become log attributes. `com.newrelic.telemetry.metrics.MetricsSinkConnector` converts each record into a Gauge, Count, or Summary. The record value must contain `name` and the case-sensitive `type`. `gauge` and `count` use the numeric field `value`; `summary` uses the top-level fields `aggregated_summary.count`, `aggregated_summary.sum`, `aggregated_summary.min`, and `aggregated_summary.max`; and `dimensions` provides string dimensions. When using schemaless JSON, the record value should be converted to a Map. When using data with a schema, the record value should be converted to a Struct. With a schema, `timestamp` must be `INT64`, and the `value` for Gauge and Count must be `FLOAT64`; for Summary, `aggregated_summary.count` must be `INT32`, and the other three aggregate fields must be `FLOAT64`. Complex fields are not recursively expanded, and schemaless Event values such as booleans, objects, arrays, and `null` are not written as attributes. The Connector adds Kafka topic, partition, and offset metadata to telemetry data, but it does not automatically map the Kafka key, headers, or record timestamp to business fields. ## Prerequisites * Prepare a New Relic account and API key that can receive telemetry data, and confirm whether the account's region is `US` or `EU`. ## License Uses Apache License 2.0. ## Quick Start Prepare a Connect Cluster, Kafka, a topic containing Event records, and a New Relic account, and confirm network connectivity and access permissions. For preparation and management, see [Manage connectors](../manage-connectors). ```properties theme={null} name=new-relic-events connector.class=com.newrelic.telemetry.events.EventsSinkConnector topics=telemetry-events api.key= nr.region=US value.converter=org.apache.kafka.connect.json.JsonConverter value.converter.schemas.enable=false ``` Replace `` with the New Relic API key. If the account is in the European Union region, change `nr.region` to `EU`. The example explicitly uses schemaless JSON, so message values in the `telemetry-events` topic can use the following structure: ```json theme={null} { "eventType": "OrderCreated", "timestamp": 1789747200000, "orderId": "A-1001", "amount": 42.5 } ``` `eventType` must be a non-empty string. If `timestamp` is omitted, the Connector uses the current time when converting the record. ## Configuration ### Instance and Telemetry Type #### `name` The unique name of the Connector instance. * **Type**: `string` * **Default**: None * **Importance**: High * **Valid Values / Notes**: Use a non-empty name without control characters and ensure that it is unique within the Connect Cluster. * **Required**: Yes #### `connector.class` The New Relic telemetry Connector implementation class to load. * **Type**: `string` * **Default**: None * **Importance**: High * **Valid Values / Notes**: Use `com.newrelic.telemetry.events.EventsSinkConnector` for Events, `com.newrelic.telemetry.logs.LogsSinkConnector` for Logs, or `com.newrelic.telemetry.metrics.MetricsSinkConnector` for Metrics. An instance can select only one of these concrete classes. * **Required**: Yes ### Kafka Input #### `topics` The list of Kafka topics to consume. * **Type**: `list` * **Default**: `[]` * **Importance**: High * **Valid Values / Notes**: Separate multiple topics with commas. Exactly one of `topics` and `topics.regex` must be configured. * **Required**: Conditionally required #### `topics.regex` The Java regular expression used to dynamically match input topics. * **Type**: `string` * **Default**: Empty string * **Importance**: High * **Valid Values / Notes**: Must be a valid Java regular expression. Exactly one of `topics` and `topics.regex` must be configured. * **Required**: Conditionally required ### Task Parallelism #### `tasks.max` The maximum number of Tasks allowed to start. * **Type**: `int` * **Default**: `1` * **Importance**: High * **Valid Values / Notes**: The minimum value is `1`. Actual parallelism is limited by the number of input topic partitions. Each Task uses an independent send queue and New Relic client. ### Authentication and Region #### `api.key` The New Relic API key used to send telemetry data. * **Type**: `password` * **Default**: None * **Importance**: High * **Valid Values / Notes**: Must be a valid, non-empty credential. Manage it as sensitive information and do not write it to logs or commit it to a repository. * **Required**: Yes #### `nr.region` The data region where the New Relic account is located. * **Type**: `string` * **Default**: `US` * **Importance**: Low * **Valid Values / Notes**: Only the case-sensitive values `US` and `EU` are supported. Explicitly configuring this value is recommended to ensure that Tasks use the intended region. ### Network Connection #### `nr.client.timeout` The call timeout for New Relic HTTP requests, in milliseconds. * **Type**: `int` * **Default**: `2000` * **Importance**: Low * **Valid Values / Notes**: Use a positive integer. The Connector does not validate the value range. #### `nr.client.proxy.host` The HTTP proxy hostname or address. * **Type**: `string` * **Default**: Not set (`null`) * **Importance**: Low * **Valid Values / Notes**: The proxy is enabled only when both `nr.client.proxy.host` and `nr.client.proxy.port` are configured. #### `nr.client.proxy.port` The HTTP proxy port. * **Type**: `int` * **Default**: Not set (`null`) * **Importance**: Low * **Valid Values / Notes**: The proxy is enabled only when both `nr.client.proxy.host` and `nr.client.proxy.port` are configured. Use a valid TCP port in the range `1` to `65535`. ### Batching #### `nr.flush.max.records` The maximum number of records in a single telemetry batch. * **Type**: `int` * **Default**: `1000` * **Importance**: Low * **Valid Values / Notes**: Use a positive integer. The Connector forms a batch immediately when this number is reached. This limit is based on the number of records, not the request size in bytes. #### `nr.flush.max.interval.ms` The maximum time to wait before forming a non-empty telemetry batch when the maximum record count has not been reached, in milliseconds. * **Type**: `int` * **Default**: `5000` * **Importance**: Low * **Valid Values / Notes**: Use a positive integer. A smaller value usually reduces waiting time in low-traffic scenarios but increases request frequency. ### Data Conversion and Processing #### `key.converter` The Converter class that deserializes Kafka message keys into Connect data. * **Type**: `class` * **Default**: Not set (`null`) * **Importance**: Low * **Valid Values / Notes**: When not set, this configuration inherits the Worker-level setting. The New Relic Connector does not map the key to telemetry business fields. #### `value.converter` The Converter that deserializes Kafka message values into Connect data that the Connector can process. * **Type**: `class` * **Default**: Not set (`null`) * **Importance**: Low * **Valid Values / Notes**: When not set, this configuration inherits the Worker-level setting. The converted result must be a Struct with a schema or a Map without a schema. Schemaless JSON can use `org.apache.kafka.connect.json.JsonConverter` with `value.converter.schemas.enable=false`. #### `transforms` The list of single message transform (SMT) aliases to apply to records in order. * **Type**: `list` * **Default**: `[]` * **Importance**: Low * **Valid Values / Notes**: Aliases must be unique. Define each transform through `transforms..type` and the other settings for that SMT. Transforms can add or organize required fields before records enter New Relic type conversion. ## Best Practices ### Separate Instances by Telemetry Type During Initial Onboarding **Applicable business scenario:** An organization has event, log, and metric streams in the same Kafka environment. Each data type must enter New Relic using its own field structure, and an invalid record of one type should not affect the other types. Create a separate Connector instance for each telemetry type and subscribe it to the corresponding topic. **Configuration example:** The following instance accepts schemaless JSON logs: ```properties theme={null} name=new-relic-logs connector.class=com.newrelic.telemetry.logs.LogsSinkConnector topics=telemetry-logs api.key= nr.region=US value.converter=org.apache.kafka.connect.json.JsonConverter value.converter.schemas.enable=false ``` Log message values can use the following structure: ```json theme={null} { "message": "Order accepted", "timestamp": 1789747200000, "service": "checkout", "severity": "INFO" } ``` The metric stream should use a separate instance and `MetricsSinkConnector`: ```properties theme={null} name=new-relic-metrics connector.class=com.newrelic.telemetry.metrics.MetricsSinkConnector topics=telemetry-metrics api.key= nr.region=US value.converter=org.apache.kafka.connect.json.JsonConverter value.converter.schemas.enable=false ``` Gauge or Count message values can use the following structure: ```json theme={null} { "name": "checkout.queue.depth", "type": "gauge", "value": 42.5, "timestamp": 1789747200000, "dimensions": { "service": "checkout", "region": "us-east" } } ``` **Key considerations:** Do not mix the three record structures in one instance. Metric `type` recognizes only `gauge`, `count`, and `summary`; Summary uses the four top-level dotted fields `aggregated_summary.count`, `aggregated_summary.sum`, `aggregated_summary.min`, and `aggregated_summary.max`, not a nested object. Manage the topic, Converter, and message producer's data contract together to avoid mismatches between the concrete class and record structure. ### Tune Batches for Runtime Latency Requirements **Applicable business scenario:** The Connector is sending data reliably, but telemetry from a low-traffic topic takes too long to become visible, or the number of records in each batch needs to be limited. Use both the record count and waiting time to define the batch trigger conditions. **Configuration example:** Adjust the two batching thresholds in the Quick Start configuration: ```properties theme={null} name=new-relic-events connector.class=com.newrelic.telemetry.events.EventsSinkConnector topics=telemetry-events api.key= nr.region=US value.converter=org.apache.kafka.connect.json.JsonConverter value.converter.schemas.enable=false nr.flush.max.records=500 nr.flush.max.interval.ms=2000 ``` **Key considerations:** A batch can be sent immediately when it reaches `500` records. If it does not reach that size, a non-empty batch waits at most `2000` milliseconds. These example values are not universally optimal. Monitor and tune them based on the input rate, acceptable latency, request frequency, and Worker memory. The Kafka Connect offset commit interval is not a New Relic batch trigger condition. ### Scale Tasks by Partition When Backlog Grows **Applicable business scenario:** The input topic has multiple partitions, one Task cannot consume fast enough, and New Relic still has available ingestion capacity. Increase consumer parallelism to process the backlog. **Configuration example:** The following configuration allows up to three Tasks to start: ```properties theme={null} name=new-relic-events connector.class=com.newrelic.telemetry.events.EventsSinkConnector topics=telemetry-events tasks.max=3 api.key= nr.region=US value.converter=org.apache.kafka.connect.json.JsonConverter value.converter.schemas.enable=false ``` **Key considerations:** Effective parallelism cannot exceed the number of assignable topic partitions. Adding Tasks creates independent send queues and clients and may increase concurrent requests to New Relic. Confirm the partition count and target capacity before gradually increasing `tasks.max`. Tasks do not provide global record ordering across one another. ## Monitoring ### What to Monitor Monitor Kafka Connect health, Connector and Task status, input and send throughput, processing and target visibility latency, consumer group offset commits and backlog, conversion or HTTP errors, SDK retries, and Worker JVM heap, GC, and thread signals. Monitor DLQ activity caused by Converter or SMT errors only when the deployment has enabled the corresponding Kafka Connect error handling. ### Import the Grafana Dashboard Ensure that Connect metrics are available in a Grafana data source and that the collected labels match the dashboard filters; download the [Kafka Connect Dashboard](https://automq-download-center.oss-cn-hangzhou.aliyuncs.com/connect-dashboard/automq-connect-cluster-dashboard.json), import the JSON into Grafana, and select the corresponding data source. ## Limitations * Events, Logs, and Metrics must use their corresponding concrete Connector classes in separate deployments. An instance cannot switch telemetry types at runtime based on record content. * The Connector sends telemetry data asynchronously, and Kafka offsets may be committed before New Relic confirms receipt. It does not provide end-to-end exactly-once guarantees and cannot unconditionally guarantee at-least-once delivery, so records may be lost or duplicated during failure or restart windows. * Record conversion exceptions inside the Connector are logged and skipped and do not enter the Kafka Connect DLQ. `errors.tolerance` affects only applicable errors thrown by a Converter or SMT before the record enters the Connector. * Complex objects and arrays are not recursively expanded as general nested structures. Producers should provide supported attributes, a Metric `dimensions` map, or top-level dotted fields for Summary data, as appropriate for the selected telemetry type. * Asynchronous retries and concurrency across multiple Tasks can change the order in which records arrive at New Relic. Do not rely on global ordering across batches or partitions. ## FAQ ### The Connector Is Running, but No Data Appears in New Relic First confirm that `connector.class` matches the message value structure and that `api.key` and `nr.region` are correct. Check the Task logs for conversion errors, HTTP responses, and retry information. Then verify that the topic continues to receive new records, that the consumer group offset advances, and that the batch waiting time meets expectations. After correcting field types or credentials, send a new correctly formatted record to verify the result. ### The Metrics Connector Reports That the Class Cannot Be Found The valid class name for Metrics is `com.newrelic.telemetry.metrics.MetricsSinkConnector`. Change `connector.class` to this fully qualified class name, resubmit the configuration, and confirm that the Task starts. ### Schemaless JSON Records Produce Type Conversion Errors Confirm that `value.converter` uses `org.apache.kafka.connect.json.JsonConverter`, that `value.converter.schemas.enable=false`, and that the message value is a JSON object rather than stringified JSON. Event `eventType` and Log `message` should be strings. Metric `name` and `type` must be present, and the `value` for Gauge or Count must be parseable as a number. ### Why Did an Invalid Record Not Enter the DLQ? New Relic type conversion occurs inside the Connector's `put` processing. This path logs and skips an invalid record instead of passing it to the Kafka Connect DLQ handler. Check the Task logs to identify the specific field and type error, then correct the record at the producer, Converter, or SMT. The DLQ can be used only for applicable Converter or SMT errors that Kafka Connect catches before invoking the Connector. ### Why Does the Runtime Display 2.3.0 When Version 2.3.3 Is Installed? The runtime version strings for the Connector and Task in this release still return `2.3.0`, so plugin information or the New Relic `collector.version` attribute may display this value. Confirm the deployed version from the plugin artifact that is actually installed. Do not downgrade or reinstall solely because of the runtime string. # Redis Sink Connector Source: https://docs.automq.com/automq-cloud/kafka-connect/sink-connectors/redis-sink-connector Configure and operate the Redis Sink Connector in AutoMQ Connect, including prerequisites, configuration, monitoring, and troubleshooting. ## Overview Redis Sink Connector consumes records from a Kafka topic and writes them to Redis according to the configuration. It can write records to strings, hashes, JSON documents, Streams, Lists, Sets, Sorted Sets, or RedisTimeSeries. `redis.command` determines the target data structure and how record keys and values are mapped, while `redis.key` determines the Redis keyspace; collection types use the topic-expanded keyspace, while non-collection types such as strings, hashes, and JSON usually also append the Kafka record key. This Sink is suitable for synchronizing events, state, or metrics from Kafka to Redis for low-latency queries, caching, collection operations, stream consumption, or time-series use cases. Its delivery semantic is at least once; when choosing Redis commands that append data, design the target keys and business deduplication strategy with possible replays in mind. ## Prerequisites * When using `JSONSET`, the target Redis deployment must provide RedisJSON; when using `TSADD`, it must provide RedisTimeSeries. * When using TLS, ACL, or mutual TLS, the Connect Worker must be able to read the configured credentials, CA certificate, client certificate, and private-key files. ## License Uses Apache License 2.0. ## Quick Start Prepare the Connect Cluster, Kafka, and Redis in advance, and confirm that the Worker can access the target Redis, consume the specified topic, and use the target Redis commands. For preparation and management operations, see [Manage Connectors](../manage-connectors). ```properties theme={null} connector.class=com.redis.kafka.connect.RedisSinkConnector topics=orders key.converter=org.apache.kafka.connect.storage.StringConverter value.converter=org.apache.kafka.connect.storage.StringConverter redis.host= redis.port=6379 redis.command=SET redis.key=${topic} ``` Replace `orders` with the Kafka topic to consume and `` with the Redis address. This example writes string record values to a Redis String; a non-empty record key generates a target key in the form `:`. After submitting the configuration to the Connect Cluster, check the Connector and Task status and confirm that the expected key and value appear in the target Redis. ## Configuration ### Redis Connection #### `redis.uri` URI used to create the Redis connection, supporting the `redis://` and `rediss://` schemes. * **Type**: `string` * **Default**: `""` * **Importance**: Medium * **Valid values / notes**: Takes precedence over `redis.host` and `redis.port` when non-empty; when empty, creates the connection using the host and port. #### `redis.host` Redis host address. * **Type**: `string` * **Default**: `localhost` * **Importance**: High * **Valid values / notes**: Used only when `redis.uri` is empty; specify a hostname or address accessible to the Worker. #### `redis.port` Redis TCP port. * **Type**: `int` * **Default**: `6379` * **Importance**: High * **Valid values / notes**: Used together with `redis.host` only when `redis.uri` is empty; specify a valid Redis TCP port. #### `redis.cluster` Whether to use the Redis Cluster client. * **Type**: `boolean` * **Default**: `false` * **Importance**: Medium * **Valid values / notes**: `true` uses the Cluster client and `false` uses the regular Redis client; do not choose the Cluster client when using `redis.multiexec=true`. #### `redis.timeout` Redis command timeout, in seconds. * **Type**: `long` * **Default**: `60` * **Importance**: Medium * **Valid values / notes**: Used for the Redis client and batch-write waiting; adjust it according to Redis response time and business latency requirements. #### `redis.pool` Maximum connection-pool size used by the Redis Writer. * **Type**: `int` * **Default**: `8` * **Importance**: Medium * **Valid values / notes**: The pool size affects concurrent write capacity; adjust it based on the number of Tasks, Redis connection limits, and Worker resources. ### Authentication and TLS #### `redis.username` Username used for Redis ACL authentication. * **Type**: `string` * **Default**: `""` * **Importance**: Medium * **Valid values / notes**: Use with a non-empty `redis.password`. #### `redis.password` Redis password. * **Type**: `password` * **Default**: `""` * **Importance**: Medium * **Valid values / notes**: Applied to the Redis URI when non-empty; do not write a real password to documentation or logs. #### `redis.tls` Whether to enable Redis TLS. * **Type**: `boolean` * **Default**: `false` * **Importance**: Medium * **Valid values / notes**: `true` enables TLS; configure a trusted CA or client certificate according to the server certificate. #### `redis.insecure` Whether to disable peer certificate verification for TLS connections. * **Type**: `boolean` * **Default**: `false` * **Importance**: Medium * **Valid values / notes**: Effective only when `redis.tls=true`; `true` disables peer verification and is suitable only for environments whose risks have been assessed. #### `redis.cacert` X.509 CA certificate file used to verify the Redis server. * **Type**: `string` * **Default**: `""` * **Importance**: Medium * **Valid values / notes**: Specify a CA certificate file path readable by the Worker; when empty, the default trust configuration is used. #### `redis.key.file` PKCS#8 private-key PEM file used for mutual TLS. * **Type**: `string` * **Default**: `""` * **Importance**: Medium * **Valid values / notes**: Specify a private-key file path readable by the Worker; after setting it, also set the corresponding `redis.key.cert`. #### `redis.key.cert` X.509 client certificate-chain PEM file paired with `redis.key.file`. * **Type**: `string` * **Default**: `""` * **Importance**: Medium * **Valid values / notes**: Provide the corresponding certificate-chain file when setting `redis.key.file`. #### `redis.key.password` Password for the `redis.key.file` private key. * **Type**: `password` * **Default**: `""` * **Importance**: Medium * **Valid values / notes**: Specify the private-key password when the key is encrypted; use an empty value for an unencrypted private key. ### Target Data Mapping #### `redis.command` Selects the Redis data structure or operation to write. * **Type**: `string` * **Default**: `XADD` * **Importance**: High * **Valid values / notes**: Can be `HSET`, `JSONSET`, `TSADD`, `SET`, `XADD`, `LPUSH`, `RPUSH`, `SADD`, `ZADD`, or `DEL`; case must match. `HSET` and `XADD` require Struct or Map values; `ZADD` uses a numeric score as its value; `TSADD` uses the record key as a timestamp in milliseconds and the record value as a numeric sample. #### `redis.key` Format string for the target Redis keyspace. * **Type**: `string` * **Default**: `${topic}` * **Importance**: Medium * **Valid values / notes**: `${topic}` is replaced with the source Kafka topic. Collection types use only the expanded keyspace; other types usually also append the record key using `redis.separator`. When empty, non-collection types can use the Kafka record key directly as the target key. #### `redis.separator` Separator between the keyspace and Kafka record key for non-collection targets. * **Type**: `string` * **Default**: `:` * **Importance**: Medium * **Valid values / notes**: Applied to non-collection targets; leading and trailing whitespace is removed from the configured value first. #### `redis.charset` Character set used to encode Redis key and value strings. * **Type**: `string` * **Default**: The character set returned by `Charset.defaultCharset().name()` * **Importance**: High * **Valid values / notes**: Must be a character-set name recognized by the JVM; conversion of Kafka record keys and values also depends on the Converter configuration. ### Write Delivery #### `redis.multiexec` Whether to use Redis MULTI/EXEC transactions for batch writes. * **Type**: `boolean` * **Default**: `false` * **Importance**: Medium * **Valid values / notes**: Supports only `XADD`, `LPUSH`, `RPUSH`, `SADD`, and `ZADD`; it cannot be used with `HSET`, `JSONSET`, `TSADD`, `SET`, or `DEL`. #### `redis.wait.replicas` Number of Redis replicas to wait for confirmation after a write. * **Type**: `int` * **Default**: `0` * **Importance**: Medium * **Valid values / notes**: `0` means not to wait for replicas; values greater than `0` execute Redis WAIT and are subject to `redis.wait.timeout`. #### `redis.wait.timeout` Timeout for the Redis WAIT command, in milliseconds. * **Type**: `long` * **Default**: `1000` * **Importance**: Medium * **Valid values / notes**: Used with `redis.wait.replicas`; waiting occurs only when a replica count is configured. ### Kafka Consumption and Tasks #### `topics` List of Kafka topics consumed by this Sink. * **Type**: `list` * **Default**: `""` * **Importance**: High * **Valid values / notes**: Mutually exclusive with `topics.regex`; exactly one of the two must be non-empty. #### `topics.regex` Java regular expression used to match Kafka topics. * **Type**: `string` * **Default**: `""` * **Importance**: High * **Valid values / notes**: Mutually exclusive with `topics`; the expression must be a valid Java regular expression and must not match the DLQ topic. #### `tasks.max` Maximum number of Sink Tasks allowed to start. * **Type**: `int` * **Default**: `1` * **Importance**: High * **Valid values / notes**: Must be at least `1`; actual parallelism is also affected by the number of Kafka partitions and assignment results, and adding Tasks does not provide global ordering across partitions. #### `key.converter` Converter that deserializes Kafka message keys into Connect data. * **Type**: `class` * **Default**: None * **Importance**: Low * **Valid values / notes**: Use an instantiable Kafka Connect Converter; use `org.apache.kafka.connect.storage.StringConverter` or `org.apache.kafka.connect.converters.ByteArrayConverter` for string or byte keys, respectively. #### `value.converter` Converter that deserializes Kafka message values into Connect data. * **Type**: `class` * **Default**: None * **Importance**: Low * **Valid values / notes**: Use an instantiable Kafka Connect Converter; the value type required by the target command must match the Converter and SMT output. ### Error Handling #### `errors.tolerance` Controls whether Kafka Connect tolerates record-processing errors. * **Type**: `string` * **Default**: `none` * **Importance**: Medium * **Valid values / notes**: Can be `none` or `all`; this is a Kafka Connect error-handling setting and does not change the data-mapping requirements of Redis commands. #### `errors.retry.timeout` Total duration of Kafka Connect error retries, in milliseconds. * **Type**: `long` * **Default**: `0` * **Importance**: Medium * **Valid values / notes**: `0` means no Connect error retries, `-1` means unlimited retries, and other values specify the retry duration; this differs from the Redis command timeout configured by `redis.timeout`. #### `errors.retry.delay.max.ms` Maximum delay between Kafka Connect error retries, in milliseconds. * **Type**: `long` * **Default**: `60000` * **Importance**: Medium * **Valid values / notes**: Effective only when Connect error retries are enabled; the actual delay may include jitter. #### `errors.deadletterqueue.topic.name` Name of the DLQ topic used to store error records. * **Type**: `string` * **Default**: `""` * **Importance**: Medium * **Valid values / notes**: An empty value disables the DLQ; the configured DLQ topic must not be consumed by `topics` or matched by `topics.regex`. ## Best Practices ### Write to a Redis String for the Initial Integration Applicable business scenario: You need to first write string or byte values from Kafka to Redis, verify the topic, connection, and keyspace, and then gradually expand to other Redis data structures. ```properties theme={null} connector.class=com.redis.kafka.connect.RedisSinkConnector topics=orders key.converter=org.apache.kafka.connect.storage.StringConverter value.converter=org.apache.kafka.connect.storage.StringConverter redis.host= redis.port=6379 redis.command=SET redis.key=${topic} ``` Key points: With `SET`, a non-empty record key participates in generating the target key; subsequent writes to the same target key overwrite the existing value. This configuration is the same as the Quick Start and is suitable as the minimum verification path for an initial integration. ### Write Structured Records to a Hash Applicable business scenario: Kafka values have already been converted by an Avro or JSON Converter into a Struct or Map, and you need to write the fields to a Redis Hash for field-level reads. ```properties theme={null} connector.class=com.redis.kafka.connect.RedisSinkConnector topics=orders key.converter=org.apache.kafka.connect.storage.StringConverter value.converter=org.apache.kafka.connect.json.JsonConverter value.converter.schemas.enable=false redis.host= redis.port=6379 redis.command=HSET redis.key=${topic} ``` Key points: `HSET` requires a Struct or Map value, with field names used as Hash fields; a non-empty `redis.key` is combined with the record key to generate a non-collection target key. When using the JSON Converter, ensure that the input JSON structure can be converted to a Map; for schemaful data, use the corresponding structured Converter instead. ### Append Events to a Redis Stream Applicable business scenario: You need to append Kafka events to a Redis Stream for continued processing by Redis Stream consumers, rather than retaining only the latest state for a key. ```properties theme={null} connector.class=com.redis.kafka.connect.RedisSinkConnector topics=orders value.converter=org.apache.kafka.connect.json.JsonConverter value.converter.schemas.enable=false redis.host= redis.port=6379 redis.command=XADD redis.key=orders-stream redis.multiexec=true ``` Key points: `XADD` uses the fields of a Struct or Map as the Stream message body; `redis.multiexec=true` applies only to the command set that supports MULTI/EXEC, which includes `XADD`. This mode appends writes, so at-least-once delivery or replay may create duplicate Stream messages; the task count, Kafka partitions, and restarts do not provide a global order across partitions, and this mode cannot serve as an exactly-once guarantee. ## Monitoring ### What to Monitor Monitor Kafka Connect health, Connector and Task status, throughput, latency, offset commits, errors, retries, and Worker JVM signals; observe Redis connection errors, command timeouts, and batch-write latency together with Task errors and retries; monitor DLQ activity only when the corresponding error handling is enabled. ### Import the Grafana Dashboard Confirm that Connect metrics are connected to a Grafana data source and that the collected labels satisfy the dashboard filters; download the [Kafka Connect Dashboard](https://automq-download-center.oss-cn-hangzhou.aliyuncs.com/connect-dashboard/automq-connect-cluster-dashboard.json), import the JSON in Grafana, and select the corresponding data source. ## Limitations * `redis.multiexec=true` supports only `XADD`, `LPUSH`, `RPUSH`, `SADD`, and `ZADD`, and cannot be used with the Redis Cluster client. * The Connector does not provide a general Schema-to-Redis-data-structure mapping; `HSET` and `XADD` require Struct or Map values, while `ZADD` and `TSADD` require numeric input. * The Connector uses at-least-once delivery semantics and does not provide exactly-once processing, Connector-level idempotency, or duplicate suppression; append commands such as List and Stream commands may append again during replay. * The Connector has no native batch-size configuration; each set of records delivered by Kafka Connect to a Task is processed as one Writer batch, and an oversized Worker batch may be affected by Redis timeouts and server capacity. * `topics` and `topics.regex` are mutually exclusive, and the Sink must configure exactly one of them as non-empty; the DLQ topic cannot also be consumed by this Sink. ## FAQ ### The Task Cannot Connect to Redis After Starting Check whether `redis.uri` is empty and whether `redis.host` and `redis.port` are correct; a non-empty URI takes precedence over the host and port. When TLS is enabled, check that `redis.tls`, the CA file, client certificate, and private-key path are readable by the Worker; when ACL is enabled, check that `redis.username` and `redis.password` match. After correcting the connection configuration, confirm that the Task resumes running and observe whether Redis receives the connection. ### A Value-Type Error Occurs When Writing to a Hash or Stream `HSET` and `XADD` require Struct or Map values. Check `value.converter` and the SMT output to confirm that the record value is not an ordinary string or an unsupported object; the JSON Converter should output a structure that can be converted to a Map. If the business data is itself a string, use `SET` or `JSONSET` instead of relying on the Connector to parse the string automatically into Hash fields. ### The Redis Key Written for a Record Is Not as Expected Check `redis.key`, `redis.separator`, and the Kafka record key. `${topic}` is replaced with the source topic; collection types use only the expanded `redis.key`, while non-collection types usually also append the record key. The record key must be convertible to a string or bytes; an empty or unsupported record key may cause conversion to fail before the write. ### Duplicate Events Appear in Redis After a Restart This Sink uses at-least-once delivery. If a failure occurs after the target write completes but before the offset is persisted, the record may be replayed after a restart. `SET`, `HSET`, `JSONSET`, and `DEL` usually overwrite or delete the same target key, while `LPUSH`, `RPUSH`, and `XADD` may append again; when duplicates must be avoided, design idempotency keys or deduplication logic at the business layer. ### The Configuration Is Invalid After Enabling `redis.multiexec` Confirm that `redis.command` is `XADD`, `LPUSH`, `RPUSH`, `SADD`, or `ZADD`, and confirm that `redis.cluster=true` is not set. Other commands are rejected by configuration validation; the Redis Cluster client also does not support this transaction path. # ScyllaDB Sink Connector Source: https://docs.automq.com/automq-cloud/kafka-connect/sink-connectors/scylladb-sink-connector Configure and operate the ScyllaDB Sink Connector in AutoMQ Connect, including prerequisites, configuration, monitoring, and troubleshooting. ## Overview The ScyllaDB Sink Connector writes records from Kafka topics to ScyllaDB. The Connector uses the Kafka record key and value to form the target table's primary key and columns, and derives the table name from the topic name: periods and hyphens in the topic are replaced with underscores. By default, the Connector can create or extend the table schema from the Connect Schema, and can also configure column mappings, consistency levels, TTL, and delete handling for each topic. The record key and value should be object-shaped (Connect Struct or Map). A non-null value is written; when delete handling is enabled, a null value can delete the target table row by record key. Kafka Connect manages topic subscription, task assignment, and offset commits, while the Connector manages the ScyllaDB session, table schema handling, and write requests. ## Prerequisites * Prepare a ScyllaDB cluster, target keyspace, and, when automatic keyspace creation is disabled, a pre-created keyspace that the Connect Worker can access. * Use structured Kafka keys and values; Schema-less Map data requires a compatible ScyllaDB table to be created in advance because the Connector does not infer or modify the table schema from Schema-less data. * When enabling TLS, prepare readable truststore or keystore files and their passwords; when enabling authentication, also provide a username and password. ## License Licensed under Apache License 2.0. ## Quick Start Prepare Connect Cluster, Kafka, and ScyllaDB in advance, and confirm network connectivity and access permissions. For preparation and management instructions, see [Manage Connectors](../manage-connectors). ```properties theme={null} connector.class=io.connect.scylladb.ScyllaDbSinkConnector topics= scylladb.contact.points= scylladb.keyspace= ``` Replace ``, ``, and `` with the actual Kafka topic, ScyllaDB address, and keyspace. Do not set `topics.regex` at the same time. The Worker Converter should convert record keys and values to Struct or Map. By default, the Connector creates the keyspace and tables, uses LOCAL QUORUM, enables delete handling, and enables the ScyllaDB Offset table. ## Configuration ### ScyllaDB Connection #### `scylladb.contact.points` ScyllaDB contact points. You can provide a comma-separated address list or JSON containing address mappings. * **Type**: `string` * **Default**: `localhost` * **Importance**: High * **Valid values / notes**: Addresses must be accessible to the Connect Worker; Connector validation attempts to establish a ScyllaDB session. #### `scylladb.port` ScyllaDB port used for public contact points. * **Type**: `int` * **Default**: `9042` * **Importance**: Medium * **Valid values / notes**: `1` to `65535`; JSON private-address mappings can specify a separate port for each address. #### `scylladb.loadbalancing.localdc` Local data center name used by the ScyllaDB driver. * **Type**: `string` * **Default**: Empty string * **Importance**: High * **Valid values / notes**: Case-sensitive; when empty, no local data center is explicitly specified. #### `scylladb.security.enabled` Whether to enable ScyllaDB username and password authentication. * **Type**: `boolean` * **Default**: `false` * **Importance**: High * **Valid values / notes**: When set to `true`, `scylladb.username` and `scylladb.password` must both be set. #### `scylladb.username` ScyllaDB authentication username. * **Type**: `string` * **Default**: `null` * **Importance**: High * **Valid values / notes**: Must be set together with `scylladb.password`; required when authentication is enabled. #### `scylladb.password` ScyllaDB authentication password. * **Type**: `password` * **Default**: `null` * **Importance**: High * **Valid values / notes**: Must be set together with `scylladb.username`; do not write it to logs or documentation examples. #### `scylladb.compression` Protocol compression method used by the ScyllaDB driver. * **Type**: `string` * **Default**: `none` * **Importance**: Low * **Valid values / notes**: `none`, `lz4`, or `snappy`, in lowercase. ### TLS #### `scylladb.ssl.enabled` Whether to enable the ScyllaDB TLS connection. * **Type**: `boolean` * **Default**: `false` * **Importance**: High * **Valid values / notes**: After setting to `true`, set truststore, keystore, passwords, cipher suites, and hostname verification options as needed. #### `scylladb.ssl.truststore.path` Path to the TLS truststore file. * **Type**: `string` * **Default**: `null` * **Importance**: Medium * **Valid values / notes**: Used only when `scylladb.ssl.enabled=true`; when set, the file must be readable. #### `scylladb.ssl.truststore.password` TLS truststore password. * **Type**: `password` * **Default**: `null` * **Importance**: Medium * **Valid values / notes**: Used only when `scylladb.ssl.enabled=true`; this is a sensitive value. #### `scylladb.ssl.keystore.path` Path to the TLS keystore file. * **Type**: `string` * **Default**: `null` * **Importance**: Medium * **Valid values / notes**: Used only when `scylladb.ssl.enabled=true`; when set, the file must be readable. #### `scylladb.ssl.keystore.password` TLS keystore password. * **Type**: `password` * **Default**: `null` * **Importance**: Medium * **Valid values / notes**: Used only when `scylladb.ssl.enabled=true`; this is a sensitive value. #### `scylladb.ssl.cipherSuites` List of cipher suites allowed for TLS. * **Type**: `list` * **Default**: Empty list * **Importance**: High * **Valid values / notes**: Used only when `scylladb.ssl.enabled=true`; an empty list leaves the driver's cipher-suite selection unchanged. #### `scylladb.ssl.hostname.verification` Whether to enable TLS hostname verification. * **Type**: `boolean` * **Default**: `false` * **Importance**: Medium * **Valid values / notes**: Used only when `scylladb.ssl.enabled=true`. ### Write Behavior #### `scylladb.consistency.level` Consistency level used when writing to ScyllaDB. * **Type**: `string` * **Default**: `LOCAL_QUORUM` * **Importance**: High * **Valid values / notes**: `ANY`, `ONE`, `TWO`, `THREE`, `QUORUM`, `ALL`, `LOCAL_QUORUM`, `EACH_QUORUM`, `SERIAL`, `LOCAL_SERIAL`, or `LOCAL_ONE`; a matching topic-level configuration overrides this value. #### `scylladb.deletes.enabled` Whether to treat null values as delete candidates and delete the target row by record key. * **Type**: `boolean` * **Default**: `true` * **Importance**: High * **Valid values / notes**: Deletion requires the record key to contain all primary-key fields of the target table; a matching topic-level configuration overrides this value. #### `scylladb.execute.timeout.ms` Timeout for waiting for asynchronous ScyllaDB operations to complete. * **Type**: `long` * **Default**: `30000` * **Importance**: Low * **Valid values / notes**: In milliseconds; must be greater than or equal to `0`; `0` is also accepted. #### `scylladb.ttl` Default TTL for insert statements. * **Type**: `int` * **Default**: `null` * **Importance**: Medium * **Valid values / notes**: When `null`, no `USING TTL` is added; a matching topic-level `ttlSeconds` overrides this value. #### `behavior.on.error` How to handle `DataException` or `NullPointerException` during record validation or statement construction. * **Type**: `string` * **Default**: `FAIL` * **Importance**: Medium * **Valid values / notes**: `FAIL` throws a Connect exception, `LOG` records and continues, and `IGNORE` records at trace level and continues; this does not replace Kafka Connect's `errors.tolerance`. ### Keyspace and Tables #### `scylladb.keyspace` Target keyspace used by the Connector. * **Type**: `string` * **Default**: None * **Importance**: High * **Valid values / notes**: Required; used to create the keyspace when automatic creation is enabled, and must already exist when automatic creation is disabled. * **Required**: Yes #### `scylladb.keyspace.create.enabled` Whether to automatically create the keyspace when it does not exist. * **Type**: `boolean` * **Default**: `true` * **Importance**: High * **Valid values / notes**: When set to `false`, the configured keyspace must already exist. #### `scylladb.keyspace.replication.factor` Replication factor used when automatically creating the keyspace. * **Type**: `int` * **Default**: `3` * **Importance**: High * **Valid values / notes**: Must be greater than or equal to `1`; effective only when `scylladb.keyspace.create.enabled=true`. #### `scylladb.table.manage.enabled` Whether the Connector creates or alters the target table schema. * **Type**: `boolean` * **Default**: `true` * **Importance**: High * **Valid values / notes**: When disabled, the target table and required columns must be prepared in advance; DDL is not generated from Schema-less data. #### `scylladb.table.create.compression.algorithm` Compression algorithm used when creating or altering a table. * **Type**: `string` * **Default**: `none` * **Importance**: Medium * **Valid values / notes**: `SnappyCompressor`, `LZ4Compressor`, `DeflateCompressor`, or `none`; affects creation or alteration only when table management is enabled. #### `scylladb.offset.storage.table` Name of the table that stores Connector ScyllaDB offsets. * **Type**: `string` * **Default**: `kafka_connect_offsets` * **Importance**: Low * **Valid values / notes**: Used only when `scylladb.offset.storage.table.enable=true`. #### `scylladb.offset.storage.table.enable` Whether to create, read, and write the Offset table in ScyllaDB. * **Type**: `boolean` * **Default**: `true` * **Importance**: Medium * **Valid values / notes**: When disabled, the ScyllaDB Offset table is skipped; Kafka Connect still manages Kafka offsets according to its Worker mechanism. ### Topic-to-Table Mapping #### `topic....mapping` Configures column mappings for the table derived from the specified topic. * **Type**: `string` * **Default**: `null` * **Importance**: Not declared * **Valid values / notes**: Use comma-separated `column=key.`, `value.`, or `header.` entries; the special targets `__ttl` and `__timestamp` can also be mapped. The topic, keyspace, and table segments must follow the dynamic configuration-name format. #### `topic...
.consistencyLevel` Overrides the write consistency level for the table derived from the specified topic. * **Type**: `string` * **Default**: Inherits `scylladb.consistency.level` * **Importance**: Not declared * **Valid values / notes**: Use a consistency level supported by ScyllaDB; affects only the matching topic configuration. #### `topic...
.ttlSeconds` Overrides the default TTL for the table derived from the specified topic. * **Type**: `int` * **Default**: Inherits `scylladb.ttl` * **Importance**: Not declared * **Valid values / notes**: Parsed as an integer; an empty value inherits the Connector-level TTL. Set it according to the business retention period. #### `topic...
.deletesEnabled` Overrides delete handling for the table derived from the specified topic. * **Type**: `boolean` * **Default**: Inherits `scylladb.deletes.enabled` * **Importance**: Not declared * **Valid values / notes**: Accepts only `true` or `false`, case-insensitively. ### Kafka Connect Sink Framework #### `connector.class` Specifies the Connector implementation class to load. * **Type**: `string` * **Default**: None * **Importance**: High * **Valid values / notes**: Use `io.connect.scylladb.ScyllaDbSinkConnector`. * **Required**: Yes #### `tasks.max` Maximum number of Tasks that the Connector may create. * **Type**: `int` * **Default**: `1` * **Importance**: High * **Valid values / notes**: Must be greater than or equal to `1`; actual parallelism also depends on Kafka partition assignment and Worker scheduling. #### `topics` List of Kafka topics to consume. * **Type**: `list` * **Default**: Empty string * **Importance**: High * **Valid values / notes**: Mutually exclusive with `topics.regex`; exactly one must be selected; must not contain the DLQ topic. #### `topics.regex` Kafka topics to consume, matched using Java Pattern syntax. * **Type**: `string` * **Default**: Empty string * **Importance**: High * **Valid values / notes**: Mutually exclusive with `topics`; exactly one must be selected; must not match the DLQ topic. #### `transforms` List of Kafka Connect SMTs to execute in order. * **Type**: `list` * **Default**: Empty list * **Importance**: Low * **Valid values / notes**: Each alias requires a corresponding `transforms..type`; the transformed topic name is used when looking up the topic-to-table mapping. #### `predicates` List of Predicate aliases used by SMT conditions. * **Type**: `list` * **Default**: Empty list * **Importance**: Low * **Valid values / notes**: Used only when a configured SMT references a Predicate; aliases must be unique. #### `errors.tolerance` Range of errors tolerated by the Kafka Connect framework. * **Type**: `string` * **Default**: `none` * **Importance**: Medium * **Valid values / notes**: `none` or `all`; takes effect separately from `behavior.on.error` and primarily affects conversion, SMT, and error-reporting stages. #### `errors.retry.timeout` Total time for the Kafka Connect framework to retry failed operations. * **Type**: `long` * **Default**: `0` * **Importance**: Medium * **Valid values / notes**: In milliseconds; `-1` means retry continuously. It does not change `scylladb.execute.timeout.ms`. #### `errors.deadletterqueue.topic.name` DLQ topic name used by the error-record reporter. * **Type**: `string` * **Default**: Empty string * **Importance**: Medium * **Valid values / notes**: When non-empty, enables the Sink error-record reporting path; this topic must not be consumed by `topics` or matched by `topics.regex`. #### `errors.log.enable` Whether to enable Kafka Connect framework-level error logging. * **Type**: `boolean` * **Default**: `false` * **Importance**: Medium * **Valid values / notes**: Independent of `behavior.on.error=LOG`; controls only framework-level error logging. ## Best Practices ### Onboard a Structured Topic and Automatically Manage Tables **Applicable business scenario**: You are writing a Kafka topic containing structured keys and values to a new ScyllaDB keyspace for the first time and want the Connector to create the keyspace and tables. When ordinary columns are added later, you can schedule a Connector task restart so the Connector checks and extends the table schema. **Configuration example**: ```properties theme={null} connector.class=io.connect.scylladb.ScyllaDbSinkConnector topics= scylladb.contact.points= scylladb.keyspace= scylladb.keyspace.create.enabled=true scylladb.table.manage.enabled=true ``` **Key notes**: Fields in the record key participate in primary-key generation, while the value provides the remaining columns; periods and hyphens in the actual Kafka topic are replaced with underscores before determining the table name. Confirm that key fields are stable and uniquely identify target rows before allowing the Connector to initialize the table schema. Schema changes are suitable for adding ordinary columns; do not use this mechanism to change an existing primary key. For ScyllaDB Sink Connector 1.1.9, the first table creation within the same Task lifetime populates the schema cache, and new ordinary columns in later records do not trigger another check; to make the Connector check and add new ordinary columns, restart the Task processing the topic partitions, then process records containing the new columns. Restarting the Connector is not the necessary boundary here; the relevant condition is rebuilding the cache of the Task that processes the records. ### Derive Tables by Topic and Use Explicit Column Mappings **Applicable business scenario**: Multiple Kafka topics write to different derived tables in the same keyspace, and you need to write only selected fields or map key, value, and header fields to explicit ScyllaDB columns. **Configuration example**: ```properties theme={null} connector.class=io.connect.scylladb.ScyllaDbSinkConnector topics= scylladb.contact.points= scylladb.keyspace= topic...
.mapping=id=key.id,name=value.name,source=header.source ``` **Key notes**: When mapping is enabled, fields not listed are not written; referenced key and value fields must exist in the record Schema, and header mappings require primitive types. The `` segment in the dynamic configuration key must use the Connector's normalized name for the actual Kafka topic: periods and hyphens become underscores, and that result is used to look up topic-level settings. The `` and `
` segments must still follow the dynamic configuration-name format; they are not independent runtime routing values. ### Set Retention and Delete Policies per Topic **Applicable business scenario**: Different business data requires different retention periods, or only some topics should convert tombstones into primary-key deletes. **Configuration example**: ```properties theme={null} connector.class=io.connect.scylladb.ScyllaDbSinkConnector topics= scylladb.contact.points= scylladb.keyspace= scylladb.ttl=86400 scylladb.deletes.enabled=false topic...
.ttlSeconds=3600 topic...
.deletesEnabled=true ``` **Key notes**: Topic-level TTL and delete settings override Connector-level values. The topic segment in the dynamic configuration key must use the normalized topic name. TTL applies to the ScyllaDB `INSERT` statement; when delete handling is enabled and the target table exists, a tombstone results in a `DELETE` using all primary-key fields from the record key. Neither changes Kafka offsets or event-time semantics. Set them according to business retention policies and verify how tombstones are produced upstream. ## Monitoring ### What to Monitor Monitor Kafka Connect health, Connector and Task status, throughput, latency, offset commits, errors, retries, and Worker JVM signals; monitor DLQ activity only when the corresponding error handling is enabled. ### Import the Grafana Dashboard Confirm that Connect metrics are connected to the Grafana data source and that collected labels meet the dashboard's filtering requirements; download the [Kafka Connect Dashboard](https://automq-download-center.oss-cn-hangzhou.aliyuncs.com/connect-dashboard/automq-connect-cluster-dashboard.json), import the JSON in Grafana, and select the corresponding data source. ## Limitations * `topics` and `topics.regex` are mutually exclusive, and at least one non-empty subscription selector must be configured; the configured DLQ topic must not be subscribed to. * Periods and hyphens in the actual Kafka topic name are normalized to underscores; this normalized name is used both for the derived table name and for topic-level dynamic configuration lookup. Topics that collide after normalization point to the same derived table. * Schema-less keys or values are not used to generate or alter DDL; a compatible target table must be created in advance before using Schema-less data. * Table schema management supports adding ordinary columns only; the primary-key shape of an existing table cannot be changed through mapping. * After the schema cache is hit during the same task lifetime, new ordinary columns in records are not checked again; restart the task to check and add new ordinary columns. * Kafka offset commits and ScyllaDB business writes are not part of the same transaction; process failures or retries may process records again, so cross-system atomic commits or duplicate-free processing cannot be inferred. ## FAQ ### How do I troubleshoot a connection failure to ScyllaDB? Check `scylladb.contact.points`, `scylladb.port`, and network access. When authentication is enabled, confirm that the username and password are both set; when TLS is enabled, confirm that the relevant file paths are readable and the certificate configuration matches. After correcting the connection configuration, redeploy or restart the Connector and observe whether the Task resumes running. ### Why does the Connector still fail to start after `topics` is configured? Check whether `topics.regex` is also configured or both configurations are empty. A Sink must select exactly one non-empty `topics` or `topics.regex`; when `errors.deadletterqueue.topic.name` is configured, also ensure that the DLQ topic is not in the subscription list or matched by the regular expression. ### Why do writes fail with an unsupported key or value type? Confirm that the Worker Converter outputs a Struct or Map rather than a top-level primitive, null key, or unsupported nested Struct. Check that the record key contains the target table's primary-key fields and that value field types are compatible with ScyllaDB column types. For Schema-less Map scenarios, also confirm that the target table was created in advance. ### What should I do if a tombstone does not delete the target row? Confirm that `scylladb.deletes.enabled` or the matching topic's `deletesEnabled` is `true`, and check that the tombstone key contains all primary-key fields of the target table. If the target table does not exist or the key is incomplete, the Connector cannot construct a valid primary-key delete statement. Also confirm that the topic segment in the dynamic configuration key matches the normalized topic name and that the keyspace and table segments follow the dynamic configuration-name format. # Shell Sink Connector Source: https://docs.automq.com/automq-cloud/kafka-connect/sink-connectors/shell-sink-connector Configure and operate the Shell Sink Connector in AutoMQ Connect, including prerequisites, configuration, monitoring, and troubleshooting. ## Overview The Shell Sink Connector consumes records from Kafka topics and starts a local shell process for each record on the Connect Worker hosting the Task. In `shell.command`, the Connector replaces `${key}`, `${topic}`, and `${value}` with the current record's key, topic, and value, then executes the complete substituted command through `sh -c`. If the key or value is `null`, the corresponding placeholder is replaced with an empty string. A single Task executes commands one record at a time in the order received within each batch, processing the next record only after the previous command exits. Multiple Tasks can execute concurrently across different partitions. This Connector is suitable for lightweight automation that uses controlled commands and controlled inputs. Placeholder substitution does not perform shell escaping, and the complete substituted command is written to the INFO log, so the Connector is not suitable for directly interpolating untrusted messages or sensitive data. ## Prerequisites * Every Connect Worker host or container that may run a Task must provide `sh` and have the executables, fixed scripts, file paths, and permissions required by the command. Local files and other side effects produced by the command reside on the Worker where the Task actually runs. ## License Uses Apache License 2.0. ## Quick Start Prepare a Connect Cluster, Kafka, and an input topic, and confirm that the Connect Worker hosting the Task can write to `/tmp`. For preparation and management, see [Manage Connectors](../manage-connectors). ```properties theme={null} connector.class=uk.co.threefi.connect.shell.ShellSinkConnector topics= shell.command=printf '%s\\n' processed >> /tmp/shell-sink-events.log ``` Replace `` with the Kafka topic to consume. This fixed command does not interpolate the message key or value. For each consumed record, it appends a line to `/tmp/shell-sink-events.log` on the Worker hosting the current Task; each line contains `processed`, which can be used to confirm the basic execution path. The complete substituted command is written to the Worker's INFO log. For production use, replace it with a pre-deployed, permission-restricted fixed program or script that has an explicit execution timeout; do not directly interpolate untrusted or sensitive message content. ## Configuration ### Command Execution #### `shell.command` The shell command template executed for each Kafka record. * **Type**: `string` * **Default**: Empty string * **Importance**: High * **Valid Values / Notes**: Supports `${key}`, `${topic}`, and `${value}`. The Connector first performs text substitution and then runs the complete command through `sh -c`. Placeholder values are neither quoted nor escaped, and the complete substituted result is written to the INFO log. An empty string passes configuration parsing but produces no useful business side effect. The command runs in the environment, current directory, file system, and permission context of the Worker hosting the Task. Each record starts a separate process, and the Connector does not provide an execution timeout. ### Failure Retries #### `max.retries` The number of Connector-managed retries allowed after a shell command fails. * **Type**: `int` * **Default**: `0` * **Importance**: Medium * **Valid Values / Notes**: The minimum value is `0`. `0` causes the Task to fail immediately after the first command failure. A positive integer `N` allows at most `N` retries in addition to the initial attempt. A retry re-executes the entire Worker batch, not only the failed record. After a batch succeeds, the Task's retry budget resets to the configured value. #### `retry.backoff.ms` The upper bound, in milliseconds, passed to Kafka Connect for the next `consumer.poll` after a retryable command failure. * **Type**: `int` * **Default**: `3000` * **Importance**: Medium * **Valid Values / Notes**: The minimum value is `0`. This setting is used only when `max.retries` is greater than `0` and retry budget remains. In Kafka Connect 3.9.1, the value is the maximum time the next `consumer.poll` may block. It may be shortened further by the remaining time until the next offset commit, and the poll may also return early, so it does not guarantee waiting at least this long before the actual retry. This setting is not a shell command execution timeout. ### Connector and Tasks #### `connector.class` The Shell Sink Connector implementation class to load. * **Type**: `string` * **Default**: None * **Importance**: High * **Valid Values / Notes**: Use `uk.co.threefi.connect.shell.ShellSinkConnector`. * **Required**: Yes #### `tasks.max` The maximum number of Sink Tasks allowed to start. * **Type**: `int` * **Default**: `1` * **Importance**: High * **Valid Values / Notes**: The minimum value is `1`. Actual parallelism is also limited by the number of input topic partitions and Worker assignment. Different Tasks can execute commands concurrently, so the target script and external system must support concurrent calls. The Connector does not provide global execution ordering across partitions or Tasks. ### Kafka Input #### `topics` The list of Kafka topics to consume. * **Type**: `list` * **Default**: `[]` * **Importance**: High * **Valid Values / Notes**: Separate multiple topics with commas. Configure exactly one of `topics` and `topics.regex`. * **Required**: Conditionally required #### `topics.regex` A Java regular expression that dynamically matches input topics. * **Type**: `string` * **Default**: Empty string * **Importance**: High * **Valid Values / Notes**: Must be a valid Java regular expression. Configure exactly one of `topics.regex` and `topics`. * **Required**: Conditionally required ### Record Conversion #### `key.converter` The Converter class that deserializes the Kafka message key before `${key}` is substituted. * **Type**: `class` * **Default**: Not set (`null`) * **Importance**: Low * **Valid Values / Notes**: When not set, this setting inherits the Worker-level key Converter. The Connector calls Java `toString()` on the converted key, and a `null` key is replaced with an empty string. The Connector does not automatically shell-escape Converter output. #### `value.converter` The Converter class that deserializes the Kafka message value before `${value}` is substituted. * **Type**: `class` * **Default**: Not set (`null`) * **Importance**: Low * **Valid Values / Notes**: When not set, this setting inherits the Worker-level value Converter. The Connector calls Java `toString()` on the converted value, and the `null` value of a tombstone record is replaced with an empty string. Structured values such as maps, structs, arrays, and byte arrays use the string form of their corresponding Java objects. They are not guaranteed to preserve the original JSON, CSV, or binary representation and are not automatically shell-escaped. ## Best Practices ### Use Bounded Retries for Transient Failures **Applicable scenario:** Initial integration is complete, but a fixed script occasionally returns a nonzero exit code because of temporary resource contention or target service unavailability. The external operation performed by the command must be safe to repeat, and the Task should retry automatically a limited number of times instead of stopping after the first failure. **Configuration example:** ```properties theme={null} connector.class=uk.co.threefi.connect.shell.ShellSinkConnector topics= shell.command=/opt/connect/bin/process-shell-event max.retries=3 retry.backoff.ms=5000 ``` **Key notes:** Deploy `/opt/connect/bin/process-shell-event` as a permission-restricted fixed script on every candidate Worker, and have the script enforce an explicit execution timeout. `max.retries=3` allows at most three retries in addition to the initial attempt; the Task fails when the budget is exhausted. `retry.backoff.ms=5000` requests a maximum blocking timeout of 5000 milliseconds for the next poll, but does not guarantee waiting at least 5000 milliseconds before the actual retry. Retries operate on the entire Worker batch: if records at the start of a batch have already completed successfully and a later record fails, the successful prefix is executed again. Enable retries only when the script and target system provide idempotency or deduplication. This configuration does not provide exactly-once guarantees. ### Scale Tasks by Partition When Backlog Grows **Applicable scenario:** The Connector is running reliably, the input topic has multiple partitions, serial command execution by a single Task causes a sustained backlog, and the fixed script and target system can handle concurrent calls. Gradually increase the Task limit to process records in parallel across partitions. **Configuration example:** ```properties theme={null} connector.class=uk.co.threefi.connect.shell.ShellSinkConnector topics= tasks.max=4 shell.command=/opt/connect/bin/process-shell-event ``` **Key notes:** `tasks.max=4` is only an upper limit on the number of Tasks; effective parallelism cannot exceed the number of input partitions. Each Task still executes records one at a time in batch order, but different Tasks can run concurrently on the same or different Workers, with no global ordering guarantee across partitions. Before scaling, confirm that the script is consistently available on every candidate Worker and that target files, locks, and external services support concurrency. Adjust the value gradually based on backlog, command duration, and target capacity instead of treating the example value as a fixed optimum. ## Monitoring ### What to Monitor Monitor Kafka Connect health, Connector and Task status, throughput, latency, offset commits, errors, retries, and Worker JVM signals. Also monitor Tasks that make no progress for extended periods and external command duration to prevent commands without timeouts from blocking consumption indefinitely. Monitor DLQ activity only when the corresponding error handling is enabled. ### Import the Grafana Dashboard Ensure that Connect metrics are available in a Grafana data source and that the collected labels match the dashboard filters; download the [Kafka Connect Dashboard](https://automq-download-center.oss-cn-hangzhou.aliyuncs.com/connect-dashboard/automq-connect-cluster-dashboard.json), import the JSON into Grafana, and select the corresponding data source. ## Limitations * `${key}`, `${topic}`, and `${value}` are unescaped text substitutions that are subsequently parsed by `sh -c`. Directly placing untrusted record content in a command can change command syntax and cause command injection. * The complete substituted command is written to the Worker's INFO log. Command templates and placeholder content must not contain passwords, tokens, credentials, or other sensitive data. * The Connector does not provide a shell command execution timeout and cannot actively terminate a running child process when a Task stops. A command that does not exit blocks the Task indefinitely. * The Connector does not support exactly-once semantics and does not include shell side effects and Kafka offset commits in the same transaction. Whole-batch retries and failures after a command succeeds but before the offset is committed can both cause duplicate execution. * Each record starts a separate process. Commands execute serially within a single Task, so long-running commands and process startup overhead directly limit throughput. * `${key}` and `${value}` use the Java string form of the object produced by the Converter. The Connector does not provide JSON, CSV, or binary encoding, or field-path templates. * Kafka Connect's `errors.tolerance` and DLQ mechanisms cannot skip or receive shell command failures that occur inside `SinkTask.put`. The Connector only uses `max.retries` and `retry.backoff.ms` to perform bounded retries of the entire batch, and the Task fails when the retry budget is exhausted. ## FAQ ### Why Does the Task Stop After a Command Returns a Nonzero Exit Code? The default value of `max.retries` is `0`, so the first command failure immediately produces an unrecoverable Task error. Check the Worker log for the Task, the command exit code, script path, execution permissions, and required programs, then reproduce the command using the same user and environment as the Worker. Configure bounded `max.retries` and `retry.backoff.ms` only when the failure is genuinely transient and the external operation can be repeated safely. After correcting the problem, restart the failed Task through the Connect management process. ### Why Does the Target System Show Duplicate Operations? A retry after a command failure resubmits the entire Worker batch, so records that already completed successfully within the batch may execute again. Even when the entire batch succeeds, records can be replayed if the Worker fails before committing the Kafka offset. Do not treat a Kafka offset commit as transactional confirmation of shell side effects. Prefer idempotent commands and target-side deduplication, and ensure that deduplication identifiers come from controlled input that has been strictly validated, cannot alter shell syntax, and does not expose sensitive information. ### Why Is the Task Still Running but Not Making Consumption Progress? A command may run for a long time, wait for input, or block on output, while the Connector provides no command timeout or active termination mechanism. First inspect the corresponding child process and script logs on the Worker hosting the Task. Then correct the fixed program or script so that it does not depend on interactive input, limits its output, and enforces explicit connection and execution timeouts. After handling any remaining processes, restart the Task and continue monitoring consumption latency and offset progress. ### Can Quoting Make Message Values Safe? Adding single or double quotes around a placeholder in the template is not a general safeguard. Placeholders are substituted verbatim before execution, so quotes, command substitutions, redirection operators, newlines, or other shell metacharacters in a message can still break out of the intended syntax. Do not directly interpolate untrusted keys or values. If record content must be used, restrict input to a strictly defined set of allowed characters before it reaches the Connector, avoid sensitive data, and use a fixed command boundary that has undergone a security review. # SingleStore Sink Connector Source: https://docs.automq.com/automq-cloud/kafka-connect/sink-connectors/singlestore-sink-connector Configure and operate the SingleStore Sink Connector in AutoMQ Connect, including prerequisites, configuration, monitoring, and troubleshooting. ## Overview The SingleStore Sink Connector consumes records from Kafka topics and writes record values to SingleStore tables in batches through `LOAD DATA LOCAL INFILE`. It sits between Kafka event streams and SingleStore databases used for real-time analytics or transaction processing, making it suitable for continuously ingesting business events, application logs, and state updates. For a single-topic input, the connector uses the topic name as the destination table name by default, or it can map that topic to a fixed table. With record field routing enabled, it can also group records from the same batch into multiple destination tables based on field values. Fields in Struct records with a Connect schema usually map to columns with the same names, while scalar records with a Connect schema are written to the `data` column. Schemaless Maps can be written to existing tables with compatible structures. The connector can create a missing table from a record with a Connect schema, but it does not perform schema evolution for existing tables. ## Prerequisites * The destination database must already exist. The database account must be able to query table metadata and execute `LOAD DATA LOCAL INFILE`. It also needs permission to create tables when automatic table creation is used, and permission to create, read, and write the metadata table when the default metadata feature is retained. * The SingleStore server and JDBC connection must allow `LOAD DATA LOCAL INFILE` and support the selected GZip, LZ4, or uncompressed transfer mode. * Destination tables must be created in advance for schema-less records. The column names, types, nullability, and primary or unique keys of existing tables must accept the rows generated by the Connector. Subsequent Schema changes must be maintained on the database side. ## License Licensed under the Apache License 2.0. ## Quick Start Prepare a Connect Cluster, Kafka topic, SingleStore database, and a database account with the required permissions, and verify network connectivity and access permissions. For preparation and management instructions, see [Manage Connectors](../manage-connectors). The following minimal practical configuration reads string records through a SingleStore Helios workspace endpoint and writes them to a table with the same name as the topic. ```properties theme={null} connector.class=com.singlestore.kafka.SingleStoreSinkConnector topics= value.converter=org.apache.kafka.connect.storage.StringConverter connection.clientEndpoint= connection.database= connection.user= connection.password= ``` Replace the placeholders with actual resources. Specify the endpoint in the `host:port` format accepted by the JDBC driver. Create the destination table in advance with the same name as the topic and a `data` column that can accept strings. Supply the password through a secure credential management method, and do not commit actual credentials to version control. ## Configuration ### Connector Identity and Input Subscription #### `connector.class` Selects the SingleStore Sink Connector implementation class. * **Type**: `string` * **Default**: None * **Importance**: High * **Required**: Yes * **Valid values / Notes**: Use `com.singlestore.kafka.SingleStoreSinkConnector`. #### `tasks.max` Sets the maximum number of Sink Tasks that Kafka Connect can create. * **Type**: `int` * **Default**: `1` * **Importance**: High * **Valid values / Notes**: Must be at least `1`. Actual effective parallelism is limited by the number of input topic partitions and partition assignment. Multiple Tasks do not provide write ordering across Tasks or serialization for the same key. #### `topics` Specifies the list of Kafka topics consumed by the Connector. * **Type**: `list` * **Default**: Empty list * **Importance**: High * **Required**: Mutually exclusive with `topics.regex` * **Valid values / Notes**: Use comma-separated topic names. Exactly one of this setting and a non-empty `topics.regex` must be configured. Validation fails if both are set or both are empty. #### `topics.regex` Selects the Kafka topics consumed by the Connector through a Java regular expression. * **Type**: `string` * **Default**: Empty string * **Importance**: High * **Required**: Mutually exclusive with `topics` * **Valid values / Notes**: Must be a valid, non-empty Java regular expression and must be mutually exclusive with `topics`. When a new matching topic is added, also verify its destination table routing and table structure. ### Record Conversion #### `key.converter` Overrides the Kafka key converter that this connector would otherwise inherit from the worker. * **Type**: `class` * **Default**: `null` * **Importance**: Low * **Valid values / Notes**: `null` means that the Worker configuration is inherited. An explicit value must be a Converter class with a public no-argument constructor. The Connector does not use the Kafka Key to generate destination columns or row identifiers. #### `value.converter` Overrides the Kafka value converter that this connector would otherwise inherit from the worker. * **Type**: `class` * **Default**: `null` * **Importance**: Low * **Valid values / Notes**: `null` means that the Worker configuration is inherited. An explicit value must be a Converter class with a public no-argument constructor. The Schema and value produced by the Converter determine automatic table creation, field mapping, and row serialization behavior. ### SingleStore Connection and Authentication #### `connection.ddlEndpoint` Sets the DDL endpoint used for table discovery, table creation, and queries in self-managed deployments. * **Type**: `string` * **Default**: `null` * **Importance**: High * **Required**: Mutually exclusive with `connection.clientEndpoint` * **Valid values / Notes**: Mutually exclusive with `connection.clientEndpoint`. When a non-empty `connection.dmlEndpoints` is not configured, this endpoint is also used for DML writes. The JDBC driver validates the address format and connectivity. #### `connection.clientEndpoint` Sets a SingleStore Helios workspace endpoint used for both DDL and DML. * **Type**: `string` * **Default**: `null` * **Importance**: High * **Required**: Mutually exclusive with `connection.ddlEndpoint` * **Valid values / Notes**: Mutually exclusive with `connection.ddlEndpoint` and a non-empty `connection.dmlEndpoints`. When selected, this endpoint is used for all database operations. #### `connection.database` Sets the SingleStore database used for data and metadata writes. * **Type**: `string` * **Default**: None * **Importance**: High * **Required**: Yes * **Valid values / Notes**: The database name is added to the JDBC URL. The configuration definition does not reject an empty string, but the database must exist and be accessible to the account or the Task cannot start. #### `connection.user` Sets the SingleStore user used by the JDBC connection. * **Type**: `string` * **Default**: `root` * **Importance**: High * **Valid values / Notes**: Use a least-privilege account that satisfies the table discovery, table creation, and write requirements. The credentials are validated when the Task establishes the JDBC connection during startup. #### `connection.password` Sets the password for the SingleStore user. * **Type**: `password` * **Default**: `null` * **Importance**: High * **Valid values / Notes**: Supply the actual password through a secure configuration injection method. Do not expose credentials in logs, documentation, or version control. #### `connection.dmlEndpoints` Sets the list of SingleStore Aggregator endpoints used for DML writes. * **Type**: `list` * **Default**: `null` * **Importance**: Medium * **Valid values / Notes**: Use comma-separated endpoints. This setting can only be combined with `connection.ddlEndpoint` and conflicts with `connection.clientEndpoint`. When omitted or set to an empty list, DML uses the selected DDL or Client endpoint. #### `params.` Passes dynamic connection parameters to the SingleStore JDBC driver. * **Type**: `string` * **Default**: `null` * **Importance**: Low * **Valid values / Notes**: Specify an actual parameter as `params.=`. The connector removes the `params.` prefix before passing the parameter to the driver. Parameter names and values follow the JDBC driver bundled with the connector. Some parameters might contain keys or certificate passwords. Do not set `params.allowLocalInfile` to a value that disables local file streaming. ### Table Structure and Field Mapping #### `tableKey.[.]` Adds a key definition to tables automatically created by the Connector. * **Type**: `list` * **Default**: `null` * **Importance**: Low * **Valid values / Notes**: Index types are case-insensitive and can be `PRIMARY`, `COLUMNSTORE`, `UNIQUE`, `SHARD`, or `KEY`, optionally followed by a key name. The value is a comma-separated list of column names. This setting applies only when missing tables are created, does not modify existing tables, and uses the same set of key configurations for all automatically created tables. #### `fields.whitelist` Retains only the listed top-level record fields for subsequent routing and writing. * **Type**: `list` * **Default**: `null` * **Importance**: Medium * **Valid values / Notes**: Use comma-separated, case-sensitive field names. This setting applies to Structs and schema-less Maps. `null` or an empty list means that fields are not restricted. When used with the blacklist, the whitelist is applied first. #### `fields.blacklist` Excludes the listed top-level fields from records. * **Type**: `list` * **Default**: `null` * **Importance**: Medium * **Valid values / Notes**: Use comma-separated, case-sensitive field names. This setting applies to Structs and schema-less Maps. `null` or an empty list means that no fields are excluded. If the same field appears in both the whitelist and blacklist, the blacklist ultimately removes it. #### `singlestore.columnToField..` Maps a destination table column to a field path in the Kafka record. * **Type**: `string` * **Default**: `null` * **Importance**: Low * **Valid values / Notes**: The table name and column name in the property name must each occupy exactly one dot-separated segment and cannot contain additional dots. The property value can use a dot-separated nested field path. The mapping applies only when the parsed destination table name matches exactly. For an existing table, a missing path produces SQL `NULL`. If the connector must create the table from a schema but cannot resolve the mapped field schema, table creation fails. ### Destination Table Routing #### `singlestore.tableName.` Maps a Kafka topic to a fixed SingleStore table. * **Type**: `string` * **Default**: `null` * **Importance**: Low * **Valid values / Notes**: Replace `` with the actual topic name and set the value to the destination table name. When no mapping matches, the topic name is used as the table name. This setting cannot be used with `singlestore.recordToTable.mappingField`. #### `singlestore.recordToTable.mappingField` Specifies the field path used to select the destination table for each record. * **Type**: `string` * **Default**: `null` * **Importance**: Low * **Valid values / Notes**: You can use a dot-separated Struct field or Map key path and must configure the corresponding `singlestore.recordToTable.mapping.`. This setting cannot be used with any topic-to-table mapping. Records are skipped when the field path does not exist, the field value is `null`, or no mapping matches the value. #### `singlestore.recordToTable.mapping.` Maps a routing field value to a SingleStore table. * **Type**: `string` * **Default**: `null` * **Importance**: Low * **Valid values / Notes**: Replace `` with the actual routing value and set the property value to the destination table name. At least one concrete mapping requires `singlestore.recordToTable.mappingField` to be set as well. Only records that match a mapping are written. ### Writes, Deduplication, and Compression #### `singlestore.filter` Adds a `WHERE` filter expression to the generated `LOAD DATA` statement. * **Type**: `string` * **Default**: `null` * **Importance**: Low * **Valid values / Notes**: The expression is appended directly to the SQL without Connector parsing or parameterization. Use only trusted expressions that apply to all destination tables, and do not place external input directly in this setting. #### `singlestore.upsert` Enables `REPLACE` behavior for `LOAD DATA`. * **Type**: `boolean` * **Default**: `false` * **Importance**: Low * **Valid values / Notes**: `true` or `false`. Existing rows are replaced only when a PRIMARY or UNIQUE key conflict occurs in the destination table. This is a full-row replacement, not a partial field merge, and it does not provide a transactional guarantee between Kafka offsets and the database. #### `singlestore.metadata.allow` Enables the metadata table and duplicate-batch suppression based on the first record identifier in a batch. * **Type**: `boolean` * **Default**: `true` * **Importance**: Medium * **Valid values / Notes**: When enabled, the Connector creates or uses the metadata table, checks the batch identifier before writing, and places the metadata write and the table writes for that batch in the same database transaction. This mechanism only covers batch replays with the same first Kafka coordinate and must not be treated as end-to-end exactly-once delivery. #### `singlestore.metadata.table` Sets the name of the metadata table used by the Connector. * **Type**: `string` * **Default**: `kafka_connect_transaction_metadata` * **Importance**: Low * **Valid values / Notes**: Applies when `singlestore.metadata.allow=true`. Use a table name that can be created, queried, and written in the current database. The configuration does not validate whether the identifier is legal. #### `singlestore.loadDataCompression` Selects the compression method for the `LOAD DATA LOCAL INFILE` data stream. * **Type**: `string` * **Default**: `GZip` * **Importance**: Low * **Valid values / Notes**: Case-insensitive. Valid values are `GZip`, `LZ4`, and `Skip`. `Skip` disables compression. The driver and server must support the corresponding file extension and transfer method. ### Retries and Metric Tags #### `max.retries` Sets the maximum number of Connector-level retries after an SQL exception. * **Type**: `int` * **Default**: `10` * **Importance**: Medium * **Valid values / Notes**: Must be greater than or equal to `0`. `0` means that the first SQL exception causes failure. The retry budget resets after a successful write and is independent of Kafka Connect's general error-handling configuration. #### `retry.backoff.ms` Sets the requested wait time before retrying an SQL write. * **Type**: `int` * **Default**: `3000` * **Importance**: Medium * **Valid values / Notes**: Must be greater than or equal to `0`, in milliseconds. This setting is used only while `max.retries` still has remaining attempts. There is no exponential backoff or jitter. #### `custom.metric.tags` Adds custom tags to the JMX ObjectName for each Task. * **Type**: `list` * **Default**: `null` * **Importance**: Low * **Valid values / Notes**: Use comma-separated `key=value` entries. Each entry must contain exactly one `=`, and a later entry takes precedence for a duplicate Key. Values are sanitized for JMX, but Keys are added to the ObjectName as written, so avoid invalid JMX characters. ## Best Practices ### Map a Business Topic to a Stable Destination Table Name **Applicable business scenario**: During initial onboarding, the Kafka topic name contains an environment, version, or organizational prefix, but the database needs a stable, concise business table name. The destination table should remain unchanged if the topic naming convention changes later. **Configuration example**: ```properties theme={null} connector.class=com.singlestore.kafka.SingleStoreSinkConnector topics=orders.events.v1 value.converter=org.apache.kafka.connect.storage.StringConverter connection.clientEndpoint= connection.database= connection.user= connection.password= singlestore.tableName.orders.events.v1=orders_events ``` Replace the connection placeholders with actual resources. Create `orders_events` in advance or grant the account permission to create the table automatically from the input schema. **Key considerations**: An explicit mapping decouples Kafka resource naming from database table naming, which simplifies permission, Schema, and downstream query maintenance. Topic mappings and record field routing are mutually exclusive. To split records by content, use `singlestore.recordToTable.*` instead and configure a destination table for every valid routing value. ### Replace Duplicate State Rows Using a Destination Table Business Key **Applicable business scenario**: The destination table stores the current state of customers, orders, or devices. Updates for the same business entity already have the required ordering within Kafka partitions, but replayed or duplicate events might arrive again, and the existing full row should be replaced based on a database PRIMARY or UNIQUE key. **Configuration example**: ```properties theme={null} connector.class=com.singlestore.kafka.SingleStoreSinkConnector topics=customer-updates value.converter=org.apache.kafka.connect.json.JsonConverter connection.clientEndpoint= connection.database= connection.user= connection.password= singlestore.tableName.customer-updates=customers singlestore.upsert=true ``` Replace the connection placeholders with actual resources. Create the `customers` table in advance with a PRIMARY or UNIQUE key that uniquely identifies the business entity. Input records must use the schema-enabled JSON representation accepted by `JsonConverter`, contain fields compatible with the destination columns, and include the fields corresponding to the database key. **Key considerations**: `singlestore.upsert=true` uses SingleStore `LOAD DATA REPLACE`, which replaces the full row on conflict instead of updating only changed fields. Replacement follows processing order; it does not select the latest version by event time, and writes for the same business key across partitions are not coordinated across tasks. This setting can reduce the impact of duplicate writes, but Kafka offset commits and database transactions are not atomic. The metadata table also suppresses only some replays based on the first record in a batch, so these settings do not provide exactly-once delivery. ### Increase Write Parallelism Gradually by Kafka Partition **Applicable business scenario**: The Connector is running steadily, the input topic has multiple partitions, and consumer lag continues to grow. Additional Tasks are needed so multiple partitions can write to SingleStore concurrently. **Configuration example**: ```properties theme={null} connector.class=com.singlestore.kafka.SingleStoreSinkConnector topics= tasks.max=3 value.converter=org.apache.kafka.connect.storage.StringConverter connection.clientEndpoint= connection.database= connection.user= connection.password= ``` Replace the placeholders and verify that the input topic has multiple assignable partitions. Increase `tasks.max` in small increments while monitoring consumer lag, Task write latency, SQL retries, database load, and Worker JVM resources. **Key considerations**: `tasks.max` is an upper limit. Increasing it beyond the number of assignable partitions does not produce more effective work. There is no global ordering or same-key coordination across Tasks. If the same business key can be written concurrently from multiple partitions, first define the partition key, database key, and `REPLACE` semantics clearly. ## Monitoring ### What to Monitor Monitor Kafka Connect Worker health, Connector and Task status, input throughput, consumer lag, processing latency, offset commits, errors, SQL retries, and Worker JVM CPU, memory, and garbage collection signals. Also compare the actual number of rows written to SingleStore and database errors. Monitor DLQ activity only when the deployment enables the corresponding Kafka Connect error handling. Internal routing, serialization, and write errors from the Connector do not necessarily enter the DLQ. ### Import the Grafana Dashboard Verify that Kafka Connect metrics are available in a Grafana data source and that the collected labels meet the dashboard filtering requirements. Download the [Kafka Connect Dashboard](https://automq-download-center.oss-cn-hangzhou.aliyuncs.com/connect-dashboard/automq-connect-cluster-dashboard.json), import the JSON into Grafana, and select the corresponding data source. ## Limitations * SingleStore data writes and Kafka offset commits are not part of the same transaction. A failure after the database commit but before the offset commit can replay records. The default metadata table only suppresses some duplicates based on the first record identifier in a batch and cannot provide end-to-end exactly-once delivery. * Schema-less records cannot be used to create missing tables automatically. Existing tables do not receive automatic Schema evolution. Fields that are added, removed, renamed, or changed to a different type must first be handled on the database side. * Kafka record keys and headers are not written to destination columns and do not automatically become table primary keys or update identifiers. Kafka tombstones do not delete destination rows. * `singlestore.upsert=true` depends on a PRIMARY or UNIQUE key in the destination table and performs a full-row `REPLACE`, not a partial field merge. * Record field routing writes only records that match a `singlestore.recordToTable.mapping.`. Records are skipped when the field path does not exist, the field value is `null`, or no mapping is configured, and there is no dedicated skipped-record metric or DLQ report. * The Connector applies `max.retries` and `retry.backoff.ms` only to SQL exceptions. Internal Task errors involving routing, Schema access, serialization, metric registration, or local file streaming do not use this retry budget and are not written to the Kafka Connect DLQ by the Connector. * The Connector does not provide an independent record-count or byte-count batch setting for an individual write. The effective batch is determined by the Kafka Connect Consumer Poll and routing results, and multiple destination tables are written serially within one Task. ## FAQ ### How do I resolve an endpoint configuration conflict or a SingleStore connection failure during Task startup? Verify that only one of `connection.ddlEndpoint` and `connection.clientEndpoint` is set. Remove `connection.dmlEndpoints` when using `connection.clientEndpoint`. Then check that `connection.database` exists, the account credentials are correct, and the account can access and query the destination database from every Worker running a Task. When a self-managed deployment requires multiple write endpoints, retain `connection.ddlEndpoint` and configure comma-separated `connection.dmlEndpoints`. ### Why was the destination table not created automatically, or why does the write report mismatched columns? Automatic table creation requires record values with a Connect Schema and a database account with table discovery and table creation permissions. Schema-less Maps and other schema-less values require a pre-created table. The Connector does not execute `ALTER TABLE` for an existing table. Check that the fields produced by the Value Converter, `fields.whitelist`, `fields.blacklist`, and `singlestore.columnToField.*` match the destination column names, types, and nullability, and complete the database Schema change first. ### Why are some messages not written after record field routing is enabled? Check whether the dot-separated field path in `singlestore.recordToTable.mappingField` can be resolved in the Struct or Map, and verify that every actual field value has a corresponding `singlestore.recordToTable.mapping.`. A record is skipped if the path does not exist, the field value is `null`, or the value has no mapping. Also verify that a conflicting `singlestore.tableName.` is not configured at the same time. ### Why do SQL errors repeat before the Task eventually fails? The connector retries the entire write batch for every SQL exception, up to `max.retries` times, and waits for `retry.backoff.ms` before each retry. After those retries are exhausted, another SQL exception for the batch causes the task to fail. Check the worker logs and SingleStore errors to distinguish transient problems such as connection interruptions from permanent problems involving permissions, SQL expressions, table structure, or duplicate keys. Correct the root cause before resuming the task instead of only increasing the retry count to mask an unrecoverable error. ### Why do duplicate rows appear after failure recovery? After a database write succeeds, Kafka Connect must still commit the Kafka offset separately. A failure between those operations causes the same batch of records to be delivered again. Keeping `singlestore.metadata.allow=true` can suppress batch replays with the same first Kafka coordinate. Tables that store the latest state can also use a stable PRIMARY or UNIQUE key with `singlestore.upsert=true`, but both mechanisms have applicability boundaries. Audit duplicate data with a business-unique identifier and design the pipeline to allow for replay. # Snowflake Sink Connector Source: https://docs.automq.com/automq-cloud/kafka-connect/sink-connectors/snowflake-kafka-sink-connector Configure and operate the Snowflake Sink Connector in AutoMQ Connect, including prerequisites, configuration, monitoring, and troubleshooting. ## Overview The Snowflake Sink Connector continuously writes records from Kafka topics to Snowflake tables. It sits in the data-writing path between Kafka and Snowflake. It uses Snowpipe Streaming to write data from each topic partition to the corresponding Snowflake ingestion channel. It can determine target tables from topic names or route topics to specified tables through mappings. The Connector can expand structured records into Snowflake columns or write records to the `RECORD_CONTENT` and `RECORD_METADATA` columns. It is suitable for continuously writing business events, logs, and change data. ## Prerequisites * The target Snowflake database, schema, user, and role must exist and have permission to access the target objects, create or write tables, and use Snowpipe Streaming. * JWT authentication requires an RSA private key. OAuth authentication requires a client ID, client secret, and the tokens or endpoints required by the selected flow. * When using an existing table, its structure must be compatible with the record conversion and metadata settings. Managed Iceberg tables also require external volume and catalog configuration. ## License Uses Apache License 2.0. ## Quick Start Prepare a Connect Cluster, Kafka topic, and target Snowflake database and schema in advance. Confirm that the Connect Worker can access Kafka and Snowflake and has the required permissions. For creating and managing the Connector, see AutoMQ's [Manage Connectors](../manage-connectors). ```properties theme={null} connector.class=com.snowflake.kafka.connector.SnowflakeStreamingSinkConnector tasks.max=1 topics=orders snowflake.url.name=https:// snowflake.user.name= snowflake.private.key= snowflake.database.name= snowflake.schema.name= snowflake.role.name= snowflake.authenticator=snowflake_jwt snowflake.streaming.validate.compatibility.with.classic=false snowflake.enable.schematization=false snowflake.autocreate.table.type=snowflake value.converter=org.apache.kafka.connect.json.JsonConverter ``` Replace the values in angle brackets with actual values. This example subscribes to the `orders` topic, automatically creates the missing Snowflake table in the target schema, and writes records to the `RECORD_CONTENT` and `RECORD_METADATA` columns. ## Configuration ### Connection and Authentication #### `snowflake.url.name` Snowflake account URL. This property has no usable runtime default. * **Type**: `STRING` * **Default**: None * **Importance**: High * **Required**: Yes #### `snowflake.user.name` User for JWT or OAuth Snowflake sessions. * **Type**: `STRING` * **Default**: None * **Importance**: High * **Required**: Yes #### `snowflake.private.key` Required by the default `snowflake_jwt` authenticator. A Kafka Config Provider reference can be used. * **Type**: `PASSWORD` * **Default**: empty string * **Importance**: High * **Required**: Conditionally required #### `snowflake.private.key.passphrase` Set only for an encrypted RSA private key. A Config Provider reference can be used. * **Type**: `PASSWORD` * **Default**: empty string * **Importance**: Low * **Required**: No #### `snowflake.database.name` The target Snowflake database must exist and be accessible to the configured role. * **Type**: `STRING` * **Default**: None * **Importance**: High * **Required**: Yes #### `snowflake.schema.name` The target schema must exist and be accessible to the configured role. * **Type**: `STRING` * **Default**: None * **Importance**: High * **Required**: Yes #### `snowflake.role.name` Specifies the Snowflake session role. When OAuth scope inclusion is enabled without an explicit scope, it is also used to derive `session:role:`. * **Type**: `STRING` * **Default**: None * **Importance**: High * **Required**: Yes #### `snowflake.authenticator` Selects JWT or OAuth authentication, which have mutually exclusive credential requirements. Valid values are `snowflake_jwt` and `oauth`. * **Type**: `STRING` * **Default**: snowflake\_jwt * **Importance**: Low * **Required**: No #### `snowflake.oauth.client.id` Required for OAuth. A Config Provider reference defers live credential validation. * **Type**: `STRING` * **Default**: empty string * **Importance**: High * **Required**: Conditionally required #### `snowflake.oauth.client.secret` Required for OAuth. A Config Provider reference defers live credential validation. * **Type**: `PASSWORD` * **Default**: empty string * **Importance**: High * **Required**: Conditionally required #### `snowflake.oauth.refresh.token` An empty value selects the OAuth `client_credentials` flow; a nonempty value selects the refresh-token flow. * **Type**: `PASSWORD` * **Default**: empty string * **Importance**: High * **Required**: No #### `snowflake.oauth.token.endpoint` When unset, the token endpoint is derived from the Snowflake account URL. * **Type**: `STRING` * **Default**: None * **Importance**: High * **Required**: No #### `snowflake.oauth.include.scope` `false` sends no scope. `true` sends the explicit scope, or `session:role:` when no scope is set. * **Type**: `BOOLEAN` * **Default**: false * **Importance**: Low * **Required**: No #### `snowflake.oauth.scope` Used only when `snowflake.oauth.include.scope=true`. An empty value then derives the scope from the configured role. * **Type**: `STRING` * **Default**: empty string * **Importance**: Low * **Required**: No ### Network Proxy #### `jvm.proxy.host` A nonempty value sets process-wide HTTP and HTTPS JVM proxy properties. It must be configured together with `jvm.proxy.port`. * **Type**: `STRING` * **Default**: empty string * **Importance**: Low * **Required**: Conditionally required #### `jvm.proxy.port` Passed as the JVM proxy port string. It must be configured together with `jvm.proxy.host`. * **Type**: `STRING` * **Default**: empty string * **Importance**: Low * **Required**: Conditionally required #### `jvm.nonProxy.hosts` When the proxy host and port are active, this value is appended to the existing `http.nonProxyHosts` JVM property with `|`. * **Type**: `STRING` * **Default**: empty string * **Importance**: Low * **Required**: No #### `jvm.proxy.username` Used only when the proxy host and port are active. It must be configured together with `jvm.proxy.password`. * **Type**: `STRING` * **Default**: empty string * **Importance**: Low * **Required**: Conditionally required #### `jvm.proxy.password` Used only when the proxy host and port are active. It must be configured together with `jvm.proxy.username`. * **Type**: `PASSWORD` * **Default**: empty string * **Importance**: Low * **Required**: Conditionally required ### Tables and Data Model #### `snowflake.metadata.all` Master metadata switch. `false` discards record metadata regardless of the individual field switches. It must remain `true` for managed Iceberg tables. * **Type**: `BOOLEAN` * **Default**: true * **Importance**: Low * **Required**: No #### `snowflake.metadata.createtime` Controls creation-time metadata. It must remain `true` for managed Iceberg tables. * **Type**: `BOOLEAN` * **Default**: true * **Importance**: Low * **Required**: No #### `snowflake.metadata.topic` Controls topic metadata. It must remain `true` for managed Iceberg tables. * **Type**: `BOOLEAN` * **Default**: true * **Importance**: Low * **Required**: No #### `snowflake.metadata.offset.and.partition` Controls both Kafka offset and partition metadata. It must remain `true` for managed Iceberg tables. * **Type**: `BOOLEAN` * **Default**: true * **Importance**: Low * **Required**: No #### `snowflake.streaming.metadata.connectorPushTime` Controls Connector push-time metadata. It must remain `true` for managed Iceberg tables. * **Type**: `BOOLEAN` * **Default**: true * **Importance**: Low * **Required**: No #### `snowflake.feature.structured.headers` `true` preserves converted structured header types; `false` flattens header values to strings. Enabling it can break consumers that depend on the legacy metadata representation. * **Type**: `BOOLEAN` * **Default**: false * **Importance**: Low * **Required**: No ### Compatibility and Migration #### `snowflake.streaming.validate.compatibility.with.classic` The default `true` is a v3 migration safety gate. While enabled, set `snowflake.validation=client_side`, set both `snowflake.compatibility.*` normalization switches to `true`, and explicitly set `snowflake.enable.schematization` and `snowflake.streaming.classic.offset.migration`. When migration mode is `strict` or `best_effort`, also explicitly set `snowflake.streaming.classic.offset.migration.include.connector.name`. For a new v4 Connector that does not require v3 compatibility, explicitly set this property to `false`. * **Type**: `BOOLEAN` * **Default**: true * **Importance**: High * **Required**: No ### Topic Routing, Validation, and Migration #### `snowflake.topic2table.map` Comma-separated `topic:table` mappings. Quoted table names preserve case, while unquoted names are uppercased. An empty value derives table names from topic names. * **Type**: `STRING` * **Default**: empty string * **Importance**: Low * **Required**: No #### `snowflake.validation` Valid values are `server_side` and `client_side`. `server_side` requires error logging on the target table. Managed Iceberg tables do not support `client_side`. * **Type**: `STRING` * **Default**: server\_side * **Importance**: High * **Required**: No #### `snowflake.streaming.classic.offset.migration` Valid values are `skip`, `best_effort`, and `strict`. A v3 Classic channel is consulted only when the SSv2 channel has no committed offset. `strict` fails when the legacy channel is absent, `best_effort` falls back to the Kafka consumer-group offset, and `skip` does not consult legacy channels. * **Type**: `STRING` * **Default**: skip * **Importance**: High * **Required**: Conditionally required #### `snowflake.streaming.classic.offset.migration.include.connector.name` Used only with `strict` or `best_effort`. The value must match whether the v3 Connector included the Connector name in channel names. * **Type**: `BOOLEAN` * **Default**: false * **Importance**: High * **Required**: Conditionally required #### `behavior.on.null.values` Valid values are `default` and `ignore`. `ignore` filters Kafka tombstones. `default` retains the legacy behavior and writes empty JSON content to the target table. * **Type**: `STRING` * **Default**: default * **Importance**: Low * **Required**: No ### Logging, Metrics, and Advanced Options #### `jmx` Enables the Connector's custom Snowflake metrics MBeans. * **Type**: `BOOLEAN` * **Default**: true * **Importance**: High * **Required**: No #### `snowflake.streaming.client.provider.override.map` Advanced Snowpipe Streaming SDK overrides. Use only under guidance from Snowflake Support. * **Type**: `STRING` * **Default**: empty string * **Importance**: Low * **Required**: No ### Error Handling #### `errors.tolerance` Valid values are `all` and `none`. `all` tolerates Connector-side ingestion or validation record failures and can preserve them in a DLQ. `none` fails the Task. * **Type**: `STRING` * **Default**: none * **Importance**: Low * **Required**: No #### `errors.log.enable` Logs tolerated record failures. Consider record sensitivity before enabling detailed framework message logging. * **Type**: `BOOLEAN` * **Default**: false * **Importance**: Low * **Required**: No #### `errors.deadletterqueue.topic.name` Preserves tolerated failures when `errors.tolerance=all`. An empty value disables DLQ output. * **Type**: `STRING` * **Default**: empty string * **Importance**: Low * **Required**: No #### `enable.mdc.logging` Enables global MDC context for Connector logs. * **Type**: `BOOLEAN` * **Default**: false * **Importance**: Low * **Required**: No #### `enable.task.fail.on.authorization.errors` When `true`, a previously observed Snowflake authorization error causes the Task to fail during `preCommit`. * **Type**: `BOOLEAN` * **Default**: false * **Importance**: Low * **Required**: No #### `snowflake.compatibility.enable.autogenerated.table.name.sanitization` `true` sanitizes and uppercases automatically generated table names for v3 compatibility. `false` passes topic names through. Use an explicit `snowflake.topic2table.map` for special names. * **Type**: `BOOLEAN` * **Default**: false * **Importance**: Low * **Required**: Conditionally required #### `snowflake.compatibility.enable.column.identifier.normalization` `true` normalizes column identifiers to uppercase for v3 compatibility. * **Type**: `BOOLEAN` * **Default**: false * **Importance**: Low * **Required**: Conditionally required #### `snowflake.enable.schematization` `true` maps records to individual columns. `false` writes the v3-compatible `RECORD_CONTENT` and `RECORD_METADATA` VARIANT columns. * **Type**: `BOOLEAN` * **Default**: true * **Importance**: Medium * **Required**: Conditionally required #### `snowflake.autocreate.table.type` Valid values are `snowflake`, `iceberg`, and `none`. The first two automatically create a missing table of that type; `none` fails when the table is missing. Existing tables are always used with their current type and schema. * **Type**: `STRING` * **Default**: snowflake * **Importance**: Medium * **Required**: No #### `snowflake.iceberg.create.table.options` SQL clauses appended to the `CREATE` statement for an automatically created managed Iceberg table. Do not include `CATALOG`, `ENABLE_SCHEMA_EVOLUTION`, or `ERROR_LOGGING`. Existing tables ignore this property. * **Type**: `STRING` * **Default**: empty string * **Importance**: Low * **Required**: No #### `snowflake.cache.table.exists` Enables caching of target-table existence checks. * **Type**: `BOOLEAN` * **Default**: true * **Importance**: Low * **Required**: No #### `snowflake.cache.table.exists.expire.ms` Table-existence cache expiration in milliseconds. The minimum value is `1`. * **Type**: `LONG` * **Default**: 300000 * **Importance**: Low * **Required**: No #### `snowflake.cache.pipe.exists` Enables caching of Pipe existence checks. * **Type**: `BOOLEAN` * **Default**: true * **Importance**: Low * **Required**: No #### `snowflake.cache.pipe.exists.expire.ms` Pipe-existence cache expiration in milliseconds. The minimum value is `1`. * **Type**: `LONG` * **Default**: 300000 * **Importance**: Low * **Required**: No #### `snowflake.topic2table.map.regex.replacement` `true` enables Java regex capture-group replacement in mapped table-name templates. `false` preserves literal `$` characters and the legacy no-substitution behavior. * **Type**: `BOOLEAN` * **Default**: false * **Importance**: Low * **Required**: No ### Concurrency and Conversion #### `connector.class` Use `com.snowflake.kafka.connector.SnowflakeStreamingSinkConnector`. This is a Kafka Connect framework property, not part of the Connector's own `ConfigDef`. * **Type**: `STRING` * **Default**: No fixed default * **Importance**: High * **Required**: Yes #### `tasks.max` Upper bound on the requested Task count. Effective parallelism is also bounded by the assigned topic partitions. * **Type**: `INT` * **Default**: 1 * **Importance**: High * **Required**: No #### `tasks.max.enforce` When `true`, Kafka Connect fails a Connector task set that exceeds `tasks.max`. * **Type**: `BOOLEAN` * **Default**: true * **Importance**: Low * **Required**: No * **Deprecated**: Yes * **Replacement**: None #### `topics` Comma-separated topic list. Exactly one of `topics` and `topics.regex` must be configured. * **Type**: `LIST` * **Default**: empty string * **Importance**: High * **Required**: Conditionally required #### `topics.regex` Full Java regular expression for topic subscription. Exactly one of `topics` and `topics.regex` must be configured. * **Type**: `STRING` * **Default**: empty string * **Importance**: High * **Required**: Conditionally required #### `key.converter` When unset, inherits the Worker key converter. Converter-specific subproperties depend on the selected plugin and have no universal default. * **Type**: `CLASS` * **Default**: `null` (inherits the Worker configuration) * **Importance**: Low * **Required**: No #### `value.converter` When unset, inherits the Worker value converter. Converter-specific properties such as `schemas.enable` depend on the selected Converter and have no universal default. * **Type**: `CLASS` * **Default**: `null` (inherits the Worker configuration) * **Importance**: Low * **Required**: No #### `errors.deadletterqueue.topic.replication.factor` Used only when Kafka Connect creates a missing DLQ topic. The value must be valid for the number of brokers in the target Kafka cluster. * **Type**: `SHORT` * **Default**: 3 * **Importance**: Medium * **Required**: No #### `errors.deadletterqueue.context.headers.enable` Adds `__connect.errors.*` context headers to DLQ records written by the framework. * **Type**: `BOOLEAN` * **Default**: false * **Importance**: Medium * **Required**: No ## Best Practices ### Route Multiple Topics to Explicit Target Tables Applicable business scenario: One Connector must write different topics to different Snowflake tables, or a topic name cannot be used directly as a target table name. Configuration example: Add explicit mappings to the base configuration. ```properties theme={null} connector.class=com.snowflake.kafka.connector.SnowflakeStreamingSinkConnector tasks.max=2 topics=orders,customers snowflake.url.name=https:// snowflake.user.name= snowflake.private.key= snowflake.database.name= snowflake.schema.name= snowflake.role.name= snowflake.authenticator=snowflake_jwt snowflake.streaming.validate.compatibility.with.classic=false snowflake.enable.schematization=false snowflake.topic2table.map=orders:ORDERS,customers:CUSTOMERS value.converter=org.apache.kafka.connect.json.JsonConverter ``` Key points: Exact topic matches take precedence, and duplicate or overlapping mappings are rejected. Unquoted table names are converted to uppercase. ### Tolerate Record Errors and Retain Failed Records Applicable business scenario: Individual records may fail in the Converter or Connector-side processing, but the continuous write task must keep running while failed records are retained for troubleshooting. Configuration example: Enable Connect error tolerance and a DLQ, and ensure that the DLQ topic is not matched by the current subscription. ```properties theme={null} connector.class=com.snowflake.kafka.connector.SnowflakeStreamingSinkConnector tasks.max=1 topics=orders snowflake.url.name=https:// snowflake.user.name= snowflake.private.key= snowflake.database.name= snowflake.schema.name= snowflake.role.name= snowflake.authenticator=snowflake_jwt snowflake.streaming.validate.compatibility.with.classic=false snowflake.enable.schematization=false errors.tolerance=all errors.deadletterqueue.topic.name=orders-dlq errors.deadletterqueue.context.headers.enable=true value.converter=org.apache.kafka.connect.json.JsonConverter ``` Key points: The DLQ handles tolerable Kafka Connect and Connector-side record errors; it does not receive records rejected by Snowflake server-side validation. Backend throttling, channel recovery failures, and unrecoverable ingestion errors can still cause the Task to fail. When Kafka Connect creates the DLQ topic, the default replication factor is `3`; if the cluster has fewer brokers, pre-create the topic or explicitly adjust `errors.deadletterqueue.topic.replication.factor`. ## Monitoring ### What to Monitor Monitor Kafka Connect Worker health, Connector and Task status, throughput, latency, offset commits, errors and retries, as well as Worker JVM heap, GC, threads, and CPU. After enabling error tolerance and a DLQ, also monitor DLQ write volume, failed-record growth, and delivery errors. ### Import the Grafana Dashboard Download the [AutoMQ Connect Cluster Dashboard](https://automq-download-center.oss-cn-hangzhou.aliyuncs.com/connect-dashboard/automq-connect-cluster-dashboard.json). In Grafana, select the data source that collects Kafka Connect metrics, confirm that the metric labels match the dashboard variables, and import the JSON file. ## Limitations * No global record ordering is provided across Tasks, topics, or Kafka partitions. * The committed Snowflake channel offset plus one is the recovery and Kafka commit boundary for an individual topic partition. If the committed channel status cannot be read, that partition is not reported as safe to commit. * Replayed records at offsets already known to be committed are skipped, but this mechanism is not an atomic exactly-once guarantee across Tasks, partitions, or tables. * When `snowflake.autocreate.table.type=none`, a missing target table causes task initialization to fail. * Managed Iceberg tables are incompatible with `snowflake.validation=client_side`. * Offset commits and recovery are bounded by topic partitions; atomic checkpoints across multiple partitions or tables are not provided. * Backend throttling, channel recovery failures, and unrecoverable ingestion errors can cause the task to fail. ## FAQ ### What should I do when the task reports missing required configuration at startup? Check the Snowflake URL, user, database, schema, and role. The default authenticator is `snowflake_jwt`, which also requires `snowflake.private.key`. When using OAuth, instead check the OAuth client ID and secret. ### Why are records not written to the target table after a topic is configured? Confirm that only one of `topics` and `topics.regex` is configured, and check whether the subscription matches the actual topic. Then check database, schema, and role permissions, as well as explicit mappings and automatic table-creation settings. ### Why does a Classic compatibility configuration error appear at startup? The default compatibility validation requires `snowflake.validation=client_side`, both v3 normalization switches set to `true`, and explicit schematization and Classic offset-migration settings. For a new 4.1.0 Connector that does not require v3 compatibility, set `snowflake.streaming.validate.compatibility.with.classic=false`. When migrating from v3, select `strict` or `best_effort` and set `snowflake.streaming.classic.offset.migration.include.connector.name` according to whether the previous Connector enabled `snowflake.streaming.channel.name.include.connector.name`. ### Why cannot structured data be converted? When schematization is enabled, the value must be convertible to a Map or Struct, and StringConverter or ByteArrayConverter cannot be used. Check the Converter, message structure, and target table permissions. ### Why do failed records not appear in the DLQ? Confirm that `errors.tolerance=all` is set, the DLQ topic is configured and is not matched by the current subscription, and the Worker provides ErrantRecordReporter and Kafka allows writes to that topic. # Splunk Sink Connector Source: https://docs.automq.com/automq-cloud/kafka-connect/sink-connectors/splunk-kafka-sink-connector Configure and operate the Splunk Sink Connector in AutoMQ Connect, including prerequisites, configuration, monitoring, and troubleshooting. ## Overview The Splunk Sink Connector consumes records from Kafka topics and writes them to Splunk through the Splunk HTTP Event Collector (HEC). It sits between Kafka and Splunk and can continuously deliver application logs, audit events, metric data, and business events for search, analysis, and alerting. By default, the connector uses the HEC `/event` endpoint, wraps record values as events, and can assign different indexes, sources, and sourcetypes to different topics. It can also use the `/raw` endpoint for raw content or override Splunk metadata dynamically through Kafka headers. Tasks send records in batches. With HEC acknowledgement disabled by default, a successful HTTP response marks a batch as complete; when acknowledgement is enabled, the connector waits for the corresponding Splunk indexer acknowledgement before advancing Kafka offsets. Recovery can still replay records whose offsets have not been committed, so downstream processing should tolerate duplicate events. ## Prerequisites * HEC is enabled in Splunk, a usable HEC URI and Token are available, and the Token has permission to write to the default or explicitly configured index. * When HTTPS certificate validation is enabled, every Worker that may run a Task can read a trust store file containing the required CA chain. * When HEC acknowledgement is enabled, indexer acknowledgement is enabled for the corresponding Token in Splunk. ## License Uses Apache License 2.0. ## Quick Start Prepare a Connect Cluster, Kafka input Topic, and Splunk HEC in advance. Confirm network connectivity, Token permissions, and Worker access to the trust store. For creation and management operations, see [Manage Connectors](../manage-connectors). The following configuration uses the HTTPS `/event` endpoint and relies on the HEC Token's defaults for the index, source, and sourcetype. ```properties theme={null} connector.class=com.splunk.kafka.connect.SplunkSinkConnector topics= splunk.hec.uri=https://:8088 splunk.hec.token= splunk.hec.ssl.trust.store.path= splunk.hec.ssl.trust.store.password= ``` Replace the input Topic, HEC address, Token, and Worker-local trust store information. The default trust store type is `JKS`; when using another JVM-supported type, add `splunk.hec.ssl.trust.store.type`. Supply the Token and trust store password through a controlled configuration management mechanism. This example inherits the Worker's Converters. Explicitly configure `key.converter` and `value.converter` when the actual record encoding does not match them. ## Configuration ### HEC Connection and Authentication #### `splunk.hec.token` The Token used to access Splunk HEC. * **Type**: `password` * **Default**: None, required * **Importance**: High * **Valid Values / Notes**: Use an enabled Token that is authorized to write to the target index. Manage it as a sensitive configuration value and do not include it in logs or shared examples. #### `splunk.hec.uri` The base URI for Splunk HEC. * **Type**: `string` * **Default**: None, required * **Importance**: High * **Valid Values / Notes**: Multiple HTTP or HTTPS URIs may be separated by commas. HTTPS is enforced by default. Avoid whitespace before or after each URI entry. #### `splunk.validation.disable` Whether to skip live requests to Splunk during Connector configuration validation. * **Type**: `boolean` * **Default**: `false` * **Importance**: Medium * **Valid Values / Notes**: `false` sends a validation event to the configured index through the first HEC URI. `true` skips only this remote validation; it does not skip required-field, URI, Kerberos, or Task configuration checks. #### `kerberos.user.principal` The Kerberos Principal used for HEC HTTP requests. * **Type**: `string` * **Default**: Empty string * **Importance**: Medium * **Valid Values / Notes**: When Kerberos is enabled, set this together with `kerberos.keytab.path`. Kerberos does not replace the HEC Token. #### `kerberos.keytab.path` The Worker-local path to the Kerberos Keytab. * **Type**: `string` * **Default**: Empty string * **Importance**: Medium * **Valid Values / Notes**: When Kerberos is enabled, set this together with `kerberos.user.principal`, and ensure that every Worker hosting a Task can read the file. ### TLS Security #### `splunk.hec.ssl.enforced` Whether HEC URIs must use HTTPS. * **Type**: `boolean` * **Default**: `true` * **Importance**: High * **Valid Values / Notes**: `true` rejects HTTP. When set to `false`, only HTTP or HTTPS is still accepted. HTTP transmits events and the Token in plaintext. #### `splunk.hec.ssl.validate.certs` Whether HTTPS connections validate certificates and hostnames. * **Type**: `boolean` * **Default**: `true` * **Importance**: Medium * **Valid Values / Notes**: When kept at `true`, a nonempty `splunk.hec.ssl.trust.store.path` must be configured. Disable validation only for controlled diagnostics or when the risk is explicitly accepted. #### `splunk.hec.ssl.trust.store.path` The path to the trust store file used to validate Splunk certificates. * **Type**: `string` * **Default**: Empty string * **Importance**: High * **Valid Values / Notes**: Required when HTTPS and certificate validation are enabled. The path must be visible and readable to every Task process. #### `splunk.hec.ssl.trust.store.type` The trust store type. * **Type**: `string` * **Default**: `JKS` * **Importance**: Low * **Valid Values / Notes**: Common values include `JKS` and `PKCS12`. Actual support depends on the JVM security providers. #### `splunk.hec.ssl.trust.store.password` The password required to load the trust store. * **Type**: `password` * **Default**: Empty string * **Importance**: High * **Valid Values / Notes**: Enter the password configured for the trust store and manage it as a sensitive configuration value. Empty string is the ConfigDef default. ### Endpoint and Event Format #### `splunk.hec.raw` Selects the HEC `/raw` or `/event` endpoint. * **Type**: `boolean` * **Default**: `false` * **Importance**: Medium * **Valid Values / Notes**: `false` uses the JSON `/event` endpoint. `true` uses `/raw`, where metadata applies to the entire request batch and event-field enrichment and custom Header fields do not apply. #### `splunk.hec.raw.line.breaker` Appends a delimiter to each record in `/raw` mode. * **Type**: `string` * **Default**: Empty string * **Importance**: Medium * **Valid Values / Notes**: Used only when `splunk.hec.raw=true`. It should match the line-breaking and event-segmentation rules of the Splunk sourcetype. #### `splunk.hec.json.event.formatted` Attempts to parse the record value as a complete HEC JSON Event object. * **Type**: `boolean` * **Default**: `false` * **Importance**: Low * **Valid Values / Notes**: Used only with `/event`. If parsing fails, the record value falls back to ordinary event content rather than retaining preformatted-object semantics. ### Splunk Metadata Routing #### `splunk.indexes` Specifies the Splunk index for explicitly subscribed Topics. * **Type**: `string` * **Default**: Empty string * **Importance**: Medium * **Valid Values / Notes**: An empty value uses the HEC Token's default index. Supply one value shared by all Topics, or the same number of comma-separated values in `topics` order. `topics.regex` does not support this positional mapping. #### `splunk.sources` Specifies the Splunk source for explicitly subscribed Topics. * **Type**: `string` * **Default**: Empty string * **Importance**: Medium * **Valid Values / Notes**: Supply one shared value, or the same number of comma-separated values in `topics` order. An empty value uses the HEC default, and `topics.regex` does not support positional mapping. #### `splunk.sourcetypes` Specifies the Splunk sourcetype for explicitly subscribed Topics. * **Type**: `string` * **Default**: Empty string * **Importance**: Medium * **Valid Values / Notes**: Supply one shared value, or the same number of comma-separated values in `topics` order. An empty value uses the HEC default, and `topics.regex` does not support positional mapping. ### Kafka Header Mapping #### `splunk.header.support` Enables mapping from Kafka Headers to Splunk metadata and fields. * **Type**: `boolean` * **Default**: `false` * **Importance**: Medium * **Valid Values / Notes**: When enabled, configured Headers can override the index, host, source, and sourcetype. `/raw` groups records by these four metadata categories. #### `splunk.header.custom` Specifies custom Kafka Header names to write as `/event` fields. * **Type**: `string` * **Default**: Empty string * **Importance**: Medium * **Valid Values / Notes**: Separate Header names with commas and also enable `splunk.header.support`. These Headers are not used as indexed fields with `/raw`. #### `splunk.header.index` Specifies the Kafka Header name that overrides the Splunk index. * **Type**: `string` * **Default**: `splunk.header.index` * **Importance**: Medium * **Valid Values / Notes**: Used only when `splunk.header.support=true`. If multiple Headers have the same name, the last value is used. #### `splunk.header.source` Specifies the Kafka Header name that overrides the Splunk source. * **Type**: `string` * **Default**: `splunk.header.source` * **Importance**: Medium * **Valid Values / Notes**: Used only when `splunk.header.support=true`. The Header value is converted to a string. #### `splunk.header.sourcetype` Specifies the Kafka Header name that overrides the Splunk sourcetype. * **Type**: `string` * **Default**: `splunk.header.sourcetype` * **Importance**: Medium * **Valid Values / Notes**: Used only when `splunk.header.support=true`. The Header value is converted to a string. #### `splunk.header.host` Specifies the Kafka Header name that overrides the Splunk host. * **Type**: `string` * **Default**: `splunk.header.host` * **Importance**: Medium * **Valid Values / Notes**: Used only when `splunk.header.support=true`. The Header value is converted to a string. ### Event Fields and Time #### `splunk.hec.json.event.enrichment` Adds fixed fields to `/event` records. * **Type**: `string` * **Default**: Empty string * **Importance**: Low * **Valid Values / Notes**: Use comma-separated `key=value` entries. Each entry must produce exactly one nonempty key and value; for duplicate keys, the last value wins. Does not apply to `/raw`. #### `splunk.hec.track.data` Adds Kafka position and record-tracking fields to `/event`. * **Type**: `boolean` * **Default**: `false` * **Importance**: Low * **Valid Values / Notes**: May include the Topic, partition, Offset, timestamp, record key, and Connect host information. Assess exposure of sensitive data before enabling it. #### `splunk.hec.use.record.timestamp` Uses the Kafka record timestamp as the event time for ordinary `/event` events. * **Type**: `boolean` * **Default**: `true` * **Importance**: Medium * **Valid Values / Notes**: Successful regular-expression time extraction can override this time. It is not used for `/raw` or successfully parsed preformatted events. #### `splunk.hec.auto.extract.timestamp` Whether to append the `auto_extract_timestamp` parameter to HEC requests. * **Type**: `boolean` * **Default**: `null` * **Importance**: Low * **Valid Values / Notes**: `null` means the parameter is not sent. Explicitly setting `true` or `false` passes that value to HEC. This is independent of the Connector's regular-expression time extraction. #### `enable.timestamp.extraction` Enables regular-expression event-time extraction in the Connector. * **Type**: `boolean` * **Default**: `false` * **Importance**: Medium * **Valid Values / Notes**: Used only for ordinary `/event` events. When enabled, `timestamp.regex` must contain a named group called `time`, and an applicable time format must be configured. #### `timestamp.regex` The Java regular expression used to extract a time value from event text. * **Type**: `string` * **Default**: Empty string * **Importance**: Medium * **Valid Values / Notes**: When extraction is enabled, the expression must contain a `(?
`; Depends on: `snapshot.mode` ### Field Masking #### `column.mask.hash.([^.]+).with.salt.(.+)` Hashes matching columns using the specified algorithm and salt. * **Type**: `STRING` * **Default**: None * **Importance**: Medium * **Valid Values / Notes**: dynamic key; regex column selector plus hash algorithm and salt #### `column.mask.with.(d+).chars` Replaces matching column values with a mask of the specified length. * **Type**: `STRING` * **Default**: None * **Importance**: Medium * **Valid Values / Notes**: dynamic key; integer mask length and column regex list #### `column.truncate.to.(d+).chars` Truncates matching column values to the specified character count. * **Type**: `INT` * **Default**: None * **Importance**: Medium * **Valid Values / Notes**: dynamic key; integer truncation length ### Schema Events #### `include.schema.changes` Whether to publish Schema change events. * **Type**: `BOOLEAN` * **Default**: `true` * **Importance**: Medium * **Valid Values / Notes**: boolean #### `include.schema.comments` Whether to include database comments in schemas; may increase memory use. * **Type**: `BOOLEAN` * **Default**: `false` * **Importance**: Medium * **Valid Values / Notes**: boolean; may increase memory usage #### `column.propagate.source.type` Adds source database type information for matching columns. * **Type**: `LIST` * **Default**: None * **Importance**: Medium * **Valid Values / Notes**: list of column regular expressions #### `datatype.propagate.source.type` Adds source type information for columns matching database type patterns. * **Type**: `LIST` * **Default**: None * **Importance**: Medium * **Valid Values / Notes**: list of database type regular expressions ### Snapshots #### `snapshot.tables.order.by.row.count` Orders snapshot tables by row count. * **Type**: `STRING` * **Default**: `disabled` * **Importance**: Medium * **Valid Values / Notes**: ascending, descending, disabled ### Heartbeat #### `heartbeat.action.query` Database query executed when sending a heartbeat. * **Type**: `STRING` * **Default**: None * **Importance**: Low * **Valid Values / Notes**: executed only when heartbeat interval is non-zero; Depends on: `heartbeat.interval.ms` ### Events #### `include.query` Whether to include original SQL in events; requires MySQL row-query logging and may expose filtered data. * **Type**: `BOOLEAN` * **Default**: `false` * **Importance**: Medium * **Valid Values / Notes**: boolean; requires MySQL binlog\_rows\_query\_log\_events=ON; may expose excluded data ### Filtering #### `table.ignore.builtin` Whether to ignore built-in database tables. * **Type**: `BOOLEAN` * **Default**: `true` * **Importance**: Low * **Valid Values / Notes**: boolean; Depends on: `database.include.list` #### `database.include.list` Captures only matching databases; the value is a comma-separated list of regular expressions. * **Type**: `LIST` * **Default**: None * **Importance**: High * **Valid Values / Notes**: list of regular expressions; mutually exclusive with database.exclude.list; Depends on: `database.exclude.list`, `table.include.list` #### `database.exclude.list` Excludes matching databases; cannot be configured together with database.include.list. * **Type**: `LIST` * **Default**: None * **Importance**: Medium * **Valid Values / Notes**: list of regular expressions; mutually exclusive with database.include.list; Depends on: `database.include.list` ### Throughput and Buffering #### `binlog.buffer.size` Binlog lookahead buffer size for identifying transaction commits or rollbacks. * **Type**: `INT` * **Default**: `0` * **Importance**: Medium * **Valid Values / Notes**: non-negative; 0 disables look-ahead buffering ### Error Handling #### `event.deserialization.failure.handling.mode` Handling policy for event deserialization failures; deprecated. * **Type**: `STRING` * **Default**: `fail` * **Importance**: Medium * **Valid Values / Notes**: fail, warn, ignore, skip; setting emits a deprecation warning; Deprecated; replacement is `event.processing.failure.handling.mode` #### `inconsistent.schema.handling.mode` Handling policy for events without a corresponding table schema. * **Type**: `STRING` * **Default**: `fail` * **Importance**: Medium * **Valid Values / Notes**: fail, warn, skip ### GTID #### `gtid.source.filter.dml.events` Whether GTID source filtering applies to row-change events. * **Type**: `BOOLEAN` * **Default**: `true` * **Importance**: Medium * **Valid Values / Notes**: boolean; Depends on: `gtid.source.includes`, `gtid.source.excludes` #### `gtid.source.includes` Limits the GTID source UUID range; cannot be configured together with gtid.source.excludes. * **Type**: `LIST` * **Default**: None * **Importance**: High * **Valid Values / Notes**: GTID source UUID patterns; mutually exclusive with gtid.source.excludes; Depends on: `gtid.source.excludes` #### `gtid.source.excludes` Excludes the specified GTID source UUIDs; cannot be configured together with gtid.source.includes. * **Type**: `STRING` * **Default**: None * **Importance**: Medium * **Valid Values / Notes**: GTID source UUID patterns; rejected when includes is set; Depends on: `gtid.source.includes` ### Metadata #### `sourceinfo.struct.maker` Implementation class producing event Source metadata structures. * **Type**: `CLASS` * **Default**: `io.debezium.connector.mysql.MySqlSourceInfoStructMaker` * **Importance**: Low * **Valid Values / Notes**: SourceInfoStructMaker implementation ### Schema History Backend #### `schema.history.internal.name` Logical name for the Schema History backend. * **Type**: `STRING` * **Default**: No declared default; runtime injects `-schemahistory` * **Importance**: Low * **Valid Values / Notes**: backend logical name; Depends on: `schema.history.internal` #### `schema.history.internal.kafka.topic` The Topic used by Kafka Schema History; it must be a dedicated single-partition Topic that retains the complete DDL history. * **Type**: `STRING` * **Default**: Not declared * **Importance**: High * **Valid Values / Notes**: required for KafkaSchemaHistory; Required; Depends on: `schema.history.internal=io.debezium.storage.kafka.history.KafkaSchemaHistory` #### `schema.history.internal.kafka.bootstrap.servers` The Kafka cluster address used to read and write Schema History; it should usually be the same cluster used by Connect. * **Type**: `STRING` * **Default**: Not declared * **Importance**: High * **Valid Values / Notes**: required for KafkaSchemaHistory; same Kafka cluster is expected; Required; Depends on: `schema.history.internal=io.debezium.storage.kafka.history.KafkaSchemaHistory` #### `schema.history.internal.kafka.recovery.poll.interval.ms` Kafka polling interval during Schema History recovery, in milliseconds. * **Type**: `INT` * **Default**: `100` * **Importance**: Low * **Valid Values / Notes**: non-negative integer; Depends on: `schema.history.internal=io.debezium.storage.kafka.history.KafkaSchemaHistory` #### `schema.history.internal.kafka.recovery.attempts` Allowed consecutive empty polls during Schema History recovery. * **Type**: `INT` * **Default**: `100` * **Importance**: Low * **Valid Values / Notes**: integer; total idle recovery wait is attempts times poll interval; Depends on: `schema.history.internal=io.debezium.storage.kafka.history.KafkaSchemaHistory` #### `schema.history.internal.kafka.query.timeout.ms` Timeout for querying Schema History Kafka cluster information, in milliseconds. * **Type**: `LONG` * **Default**: `3000` * **Importance**: Low * **Valid Values / Notes**: positive integer; Depends on: `schema.history.internal=io.debezium.storage.kafka.history.KafkaSchemaHistory` #### `schema.history.internal.kafka.create.timeout.ms` Schema History topic creation timeout in milliseconds. * **Type**: `LONG` * **Default**: `30000` * **Importance**: Low * **Valid Values / Notes**: positive integer; Depends on: `schema.history.internal=io.debezium.storage.kafka.history.KafkaSchemaHistory` #### `schema.history.internal.consumer.*` Client properties passed to the Schema History Kafka consumer. * **Type**: `MAP` * **Default**: Not declared * **Importance**: Low * **Valid Values / Notes**: Kafka consumer properties passed through after the prefix; Depends on: `schema.history.internal=io.debezium.storage.kafka.history.KafkaSchemaHistory` #### `schema.history.internal.producer.*` Client properties passed to the Schema History Kafka producer. * **Type**: `MAP` * **Default**: Not declared * **Importance**: Low * **Valid Values / Notes**: Kafka producer properties passed through after the prefix; Depends on: `schema.history.internal=io.debezium.storage.kafka.history.KafkaSchemaHistory` ### Signal Backend #### `signal.file` File path read by the file signal channel. * **Type**: `STRING` * **Default**: No declared default; runtime falls back to `file-signals.txt` * **Importance**: High * **Valid Values / Notes**: Used only when the file signal channel is enabled; defaults to file-signals.txt when omitted. Depends on: `signal.enabled.channels` #### `signal.kafka.topic` Topic read by the kafka signal channel. * **Type**: `STRING` * **Default**: No declared default; runtime falls back to `-signal` * **Importance**: High * **Valid Values / Notes**: Used only when the kafka signal channel is enabled; defaults to `-signal` when omitted. Depends on: `signal.enabled.channels` #### `signal.kafka.bootstrap.servers` Kafka bootstrap servers for the kafka signal channel. * **Type**: `STRING` * **Default**: Not declared * **Importance**: High * **Valid Values / Notes**: required when kafka signal channel is enabled; Required; Depends on: `signal.enabled.channels` #### `signal.kafka.poll.timeout.ms` Poll timeout for the kafka signal channel, in milliseconds. * **Type**: `INT` * **Default**: `0` * **Importance**: Low * **Valid Values / Notes**: non-negative integer; Depends on: `signal.enabled.channels` #### `signal.kafka.groupId` Consumer group ID for the kafka signal channel. * **Type**: `STRING` * **Default**: `kafka-signal` * **Importance**: Low * **Valid Values / Notes**: Depends on: `signal.enabled.channels` #### `signal.consumer.*` Client properties passed to the Kafka signal consumer. * **Type**: `MAP` * **Default**: Not declared * **Importance**: Low * **Valid Values / Notes**: Kafka consumer properties passed through after signal.consumer.; Depends on: `signal.enabled.channels` ### Kafka Connect Framework #### `name` The globally unique Connector name. * **Type**: `STRING` * **Default**: Not declared * **Importance**: High * **Valid Values / Notes**: non-empty connector name; Required #### `connector.class` The Connector implementation class; MySQL Source uses io.debezium.connector.mysql.MySqlConnector. * **Type**: `STRING` * **Default**: Not declared * **Importance**: High * **Valid Values / Notes**: Connector subclass; use io.debezium.connector.mysql.MySqlConnector; Required #### `tasks.max` The maximum number of Tasks this Connector can create; MySQL CDC actually processes only one Task. * **Type**: `INT` * **Default**: `1` * **Importance**: High * **Valid Values / Notes**: The framework accepts integers of at least 1, but this MySQL connector rejects values greater than 1 with an error when generating task configurations; only `1` is usable. #### `tasks.max.enforce` Whether to enforce tasks.max; disabling it does not bypass the MySQL connector single-task restriction. * **Type**: `BOOLEAN` * **Default**: `true` * **Importance**: Low * **Valid Values / Notes**: `true` or `false`; Deprecated; no replacement is defined. #### `key.converter` The Converter class for SourceRecord keys; uses the Worker configuration when not set at the Connector level. * **Type**: `CLASS` * **Default**: None * **Importance**: Low * **Valid Values / Notes**: Converter subclass and instantiable #### `value.converter` The Converter class for SourceRecord values; uses the Worker configuration when not set at the Connector level. * **Type**: `CLASS` * **Default**: None * **Importance**: Low * **Valid Values / Notes**: Converter subclass and instantiable #### `header.converter` Converter class for SourceRecord headers. * **Type**: `CLASS` * **Default**: None * **Importance**: Low * **Valid Values / Notes**: HeaderConverter subclass and instantiable #### `transforms` Single-message transformation aliases in application order. * **Type**: `LIST` * **Default**: empty list * **Importance**: Low * **Valid Values / Notes**: unique transformation aliases #### `predicates` Predicate aliases used by single-message transformations. * **Type**: `LIST` * **Default**: empty list * **Importance**: Low * **Valid Values / Notes**: unique predicate aliases; Depends on: `transforms` #### `config.action.reload` Whether to restart the connector when external configuration provider values change. * **Type**: `STRING` * **Default**: `restart` * **Importance**: Low * **Valid Values / Notes**: none, restart #### `errors.retry.timeout` Total framework retry duration for retriable errors, in milliseconds. * **Type**: `LONG` * **Default**: `0` * **Importance**: Medium * **Valid Values / Notes**: milliseconds; -1 means infinite #### `errors.retry.delay.max.ms` Maximum delay between framework retries, in milliseconds. * **Type**: `LONG` * **Default**: `60000` * **Importance**: Medium * **Valid Values / Notes**: milliseconds; Depends on: `errors.retry.timeout` #### `errors.tolerance` Whether framework processing stops or tolerates and skips errors; does not cover arbitrary binlog or startup errors. * **Type**: `STRING` * **Default**: `none` * **Importance**: Medium * **Valid Values / Notes**: none, all #### `errors.log.enable` Whether to log framework processing errors and context. * **Type**: `BOOLEAN` * **Default**: `false` * **Importance**: Medium * **Valid Values / Notes**: boolean #### `errors.log.include.messages` Whether error logs include record contents; enabling this may expose sensitive data. * **Type**: `BOOLEAN` * **Default**: `false` * **Importance**: Medium * **Valid Values / Notes**: boolean; false avoids writing record contents to logs; Depends on: `errors.log.enable` ### Snapshots #### `snapshot.locking.mode.custom.name` SnapshotLock implementation name used by custom locking mode. * **Type**: `STRING` * **Default**: Not declared * **Importance**: Medium * **Valid Values / Notes**: SnapshotLock implementation name for `snapshot.locking.mode=custom`; must match the implementation's `name()` result. #### `snapshot.select.statement.overrides..
` Custom SELECT query for the specified table snapshot. * **Type**: `STRING` * **Default**: Not declared * **Importance**: Medium * **Valid Values / Notes**: The table must be listed in `snapshot.select.statement.overrides`; a missing per-table query produces a warning and that override is skipped. ### Schema History Backend #### `schema.history.internal.file.filename` Local history file path for the file-based Schema History backend. * **Type**: `STRING` * **Default**: Not declared * **Importance**: Medium * **Valid Values / Notes**: Required when FileSchemaHistory is selected; valid local filesystem path.; Required; Depends on: `schema.history.internal=io.debezium.storage.file.history.FileSchemaHistory` ## Best Practices ### Limit the snapshot scope and continue streaming on first connection Applicable business scenario: Connect to an existing MySQL database for the first time, establish an initial baseline for selected tables only, and continue receiving new changes from those tables after the snapshot completes. Configuration example: Add these settings to Quick Start; remove any conflicting table exclusion list first. ```properties theme={null} snapshot.mode=initial snapshot.include.collection.list=\.,\. table.include.list=\.,\. ``` Key points: `snapshot.include.collection.list` controls which tables are read by this snapshot, while `table.include.list` also limits the subsequent streaming capture scope. Keep the two lists consistent so that the snapshot baseline and subsequent change scope do not diverge. Keep the Schema History topic dedicated and single-partition, retaining the complete DDL history; do not clean it up like a business topic or arbitrarily delete committed offsets. Normal restarts depend on the original logical identity, offsets, Schema History, and available binlogs. ### Capture only changes from Connector startup when existing data is already present Applicable business scenario: The MySQL database already contains data, but downstream consumers do not need a snapshot of those existing rows and only need INSERT, UPDATE, and DELETE changes captured from Connector startup onward. Configuration example: Add or override the following setting in Quick Start; keep `table.include.list` as needed to limit the subsequent capture scope. ```properties theme={null} snapshot.mode=no_data ``` Key points: `no_data` does not emit a data snapshot for existing rows, but it still reads table definitions and other required Schema information before continuing with binlog-based CDC. It does not automatically backfill historical changes that occurred before Connector startup; use the `initial` snapshot scenario or another data initialization process when downstream consumers need an existing-data baseline. Schema History and the required binlogs must still be available, and committed offsets should not be deleted. ### Control memory and publishing batches when synchronizing large tables Applicable business scenario: The ongoing change volume is high or downstream publishing speed fluctuates, requiring a controlled trade-off among memory usage, batch efficiency, and capture latency. Configuration example: Add or override these settings in Quick Start. ```properties theme={null} max.batch.size=2048 max.queue.size=8192 max.queue.size.in.bytes=67108864 query.fetch.size=1000 poll.interval.ms=500 ``` Key points: The queue absorbs short-term publishing fluctuations; it is not a durable checkpoint. Increasing the queue increases memory usage, and sustained slow publishing still increases capture latency and binlog retention pressure. `max.queue.size` must be greater than `max.batch.size`; adjust it gradually based on the Worker heap and downstream throughput. ## Monitoring ### What to Monitor Monitor the health and restart counts of the Worker, Connector, and Task; watch Source throughput, end-to-end latency, capture latency, offset commits, errors and retries, queue backlog, and Worker JVM heap and GC. If error tolerance or a dead-letter queue is enabled, also monitor skipped records and DLQ activity; avoid outputting message contents and credentials in error logs. ### Import the Grafana Dashboard Download the JSON from [Download the AutoMQ Connect Cluster Dashboard](https://automq-download-center.oss-cn-hangzhou.aliyuncs.com/connect-dashboard/automq-connect-cluster-dashboard.json), configure Grafana to use the corresponding metrics data source, ensure the labels match the Connect cluster, and then import the Dashboard in Grafana. ## Limitations * MySQL CDC is processed by a single Kafka Connect Task; `tasks.max>1` throws an error during task configuration generation and cannot scale CDC throughput in parallel, and snapshot threads do not create additional Tasks. * Include and exclude settings at the same level cannot be used together, such as `table.include.list` and `table.exclude.list`, or `gtid.source.includes` and `gtid.source.excludes`. * There is no global ordering across Topics for different tables or across Kafka partitions; transaction metadata links transaction information but does not form an atomic downstream transaction. * During failure recovery, events published after the last persisted offset may be duplicated; this Connector does not provide a confirmed end-to-end exactly-once guarantee. * A delete event and a tombstone are separate records; a primary-key change may be sent as a delete for the old key and a create for the new key to different partitions, so consumers must not assume an atomic cross-key update. * Schema History recovery depends on complete history; after binlogs are lost or cleaned up, a new snapshot can recover only current row state and cannot recover each lost intermediate update or delete. ## FAQ ### What should I do when the Connector reports a MySQL binlog configuration error at startup? Confirm that MySQL has binary logging enabled and check `binlog_format=ROW` and `binlog_row_image=FULL`. Also check the user replication privileges, whether `database.server.id` is unique, and Connector access to the MySQL port. ### Why does increasing `tasks.max` fail to start multiple Tasks? This is the Connector processing model: MySQL binlog CDC is processed by one Task. `tasks.max>1` is rejected when task configurations are generated, rather than ignored; tune filtering scope, batches, queues, and downstream publishing capacity instead. ### What should I do when a restart reports missing Schema or an unrecoverable position? First confirm that the Connector logical identity, offset Topic, Schema History Topic, and Kafka connection configuration have not changed, and that the history Topic was not cleaned up and remains single-partition. Missing Schema History and an expired binlog position are separate problems: `when_needed` does not handle Schema History errors, and rebuilding current schemas cannot restore missing binlogs or historical schema transitions. A new snapshot establishes current row state, not all intermediate events from expired logs. ### Why does the downstream receive a null-valued record after a delete record? When `tombstones.on.delete=true`, a same-key null-valued tombstone is sent after the delete event so downstream systems can clean up by key. The delete event itself still contains the change semantics for the deleted row; the two records must not be treated as one record. ### Why might an event that was already processed appear again after a restart? Persisting a Source offset and publishing an event are not one end-to-end atomic transaction. If an event was published before the Worker persisted its corresponding offset and the Worker then failed, recovery may read and publish that event again. Downstream consumers should implement idempotency using the business key and Source metadata, and retain the offset, Schema History, and required binlog together. # Debezium PostgreSQL Source Connector Source: https://docs.automq.com/automq-cloud/kafka-connect/source-connectors/debezium-postgresql-source-connector Configure and operate the Debezium PostgreSQL Source Connector in AutoMQ Connect, including prerequisites, configuration, monitoring, and troubleshooting. ## Overview Debezium PostgreSQL Source Connector sends existing data and committed row-level changes from PostgreSQL tables to Kafka. It supports incremental data synchronization, search index updates, cache refreshes, and change event consumption. The Connector handles data capture in the PostgreSQL-to-Kafka pipeline, establishing a baseline through a snapshot and then continuously capturing inserts, updates, and deletes through logical replication. One Connector captures one database. By default, events from each table are sent to a topic whose name combines the topic prefix, schema name, and table name; message keys typically come from the table's primary key. Events include the operation type, before and after data, and source position. The actual serialization format is determined by Kafka Connect converters. Snapshot records and subsequent changes together allow downstream consumers to reconstruct the current state, but consumers must still handle duplicates, deletes, and unavailable field values correctly. ## Prerequisites * PostgreSQL must have logical replication enabled with `wal_level=logical` and sufficient capacity in `max_replication_slots` and `max_wal_senders`. Server authentication rules must allow the capture account to establish database and logical replication connections. `pgoutput` uses PostgreSQL's built-in logical decoding plugin; `decoderbufs` requires the corresponding plugin to be installed on the server. * The capture account needs `LOGIN` and `REPLICATION` privileges, or the equivalent replication role provided by a managed PostgreSQL service. Snapshots and metadata reads also require `CONNECT` on the target database, `USAGE` on the target schemas, and `SELECT` on captured tables. Replication privileges do not automatically grant table read access. * With `pgoutput`, the publication's table set and published operations must cover the required changes. The Quick Start uses a table-specific publication created in advance by a DBA; the Connector does not create or modify it. With `filtered` automatic management, the account also needs the appropriate database `CREATE` privilege, publication ownership, and table ownership. Creating a `FOR ALL TABLES` publication requires superuser privileges; do not grant them to the capture account merely to start the Connector. * Tables whose updates and deletes must be synchronized need an appropriate `REPLICA IDENTITY`. Tables with a primary key can usually use `DEFAULT`; evaluate `FULL` and its WAL overhead only when complete old rows are needed. Configuring message keys does not automatically change the database replica identity. Without a usable replica identity, PostgreSQL may reject updates or deletes on published tables. ## License Licensed under Apache License 2.0. ## Quick Start Prepare a Connect Cluster, Kafka, the source PostgreSQL database, and the tables to capture. Confirm network connectivity and access permissions, and have a DBA prepare a publication for these tables. For Connector creation and management, see [Manage Connectors](../manage-connectors). ```properties theme={null} connector.class=io.debezium.connector.postgresql.PostgresConnector database.hostname= database.user= database.password= database.dbname= topic.prefix= plugin.name=pgoutput slot.name= publication.name= publication.autocreate.mode=disabled table.include.list= ``` Replace the placeholders for the database address, account, password, database name, and capture resources. Slot names must use lowercase letters, digits, and underscores, with a maximum of 63 characters. Choose a separate slot name for each independent Connector. Table filter expressions match the complete `schema.table` name. In properties, use `[.]` to match a literal dot, for example `public[.]orders`. The pre-created publication must contain the matching tables; otherwise, snapshots may work while subsequent changes are not captured. The password is only a placeholder. In an actual deployment, use a configured ConfigProvider reference to avoid storing plaintext credentials in configuration copies. The default snapshot mode is `initial`: when no saved offset exists or the first snapshot is incomplete, the Connector reads existing data and then continuously captures changes. The default database port is `5432`, and the task limit is `1`, so these defaults are omitted from the example. `pgoutput` is an explicit choice, not the default logical decoding plugin. If no Connector-level converters are configured, the Worker's serialization settings apply. ## Configuration ### Connector and Serialization #### `connector.class` Specifies the Source Connector implementation. * **Type**: `STRING` * **Default**: None * **Importance**: High * **Required**: Yes * **Valid Values / Notes**: Use `io.debezium.connector.postgresql.PostgresConnector`. #### `tasks.max` Sets the maximum number of tasks. * **Type**: `INT` * **Default**: `1` * **Importance**: High * **Valid Values / Notes**: Must be at least `1`. This Connector creates only one task; increasing the limit does not split tables or the replication stream for parallel processing. #### `key.converter` Specifies the converter for serializing message keys. * **Type**: `CLASS` * **Default**: `null` * **Importance**: Low * **Valid Values / Notes**: Uses the Worker converter when unset. The specified class must implement the Kafka Connect `Converter` interface. #### `value.converter` Specifies the converter for serializing message values. * **Type**: `CLASS` * **Default**: `null` * **Importance**: Low * **Valid Values / Notes**: Uses the Worker converter when unset. The specified class must implement the Kafka Connect `Converter` interface. Events are not necessarily JSON text. ### Database Connection and Security #### `database.hostname` The source database hostname or IP address. * **Type**: `STRING` * **Default**: `null` * **Importance**: High * **Required**: Yes * **Valid Values / Notes**: Use a resolvable database address. #### `database.port` The source database port. * **Type**: `INT` * **Default**: `5432` * **Importance**: High * **Valid Values / Notes**: Set to the actual PostgreSQL service port. #### `database.user` The database capture account. * **Type**: `STRING` * **Default**: `null` * **Importance**: High * **Required**: Yes * **Valid Values / Notes**: Must meet the privilege requirements for replication, snapshot reads, and the selected publication management mode. #### `database.password` The database account password. * **Type**: `PASSWORD` * **Default**: `null` * **Importance**: High * **Valid Values / Notes**: Whether a password is required depends on database authentication. Use a secret placeholder or ConfigProvider reference; do not retain real passwords in shared configurations or logs. #### `database.dbname` The name of the database to capture. * **Type**: `STRING` * **Default**: `null` * **Importance**: High * **Required**: Yes * **Valid Values / Notes**: One Connector connects to one database. Table filters use `schema.table`, without a database name prefix. #### `database.query.timeout.ms` The database query execution timeout, in milliseconds. * **Type**: `INT` * **Default**: `600000` * **Importance**: Low * **Valid Values / Notes**: `0` means no query duration limit. This is distinct from replication connection status updates and LSN flush timeouts. #### `database.initial.statements` Executes initialization statements when establishing a JDBC connection. * **Type**: `STRING` * **Default**: `null` * **Importance**: Low * **Valid Values / Notes**: Separate statements with semicolons and escape literal semicolons with double semicolons. Connections may be established multiple times; this setting is generally for session configuration, not business DML. #### `database.sslmode` Controls PostgreSQL TLS connections and certificate validation. * **Type**: `STRING` * **Default**: `prefer` * **Importance**: Medium * **Valid Values / Notes**: `disable`, `allow`, `prefer`, `require`, `verify-ca`, `verify-full`. `prefer` allows fallback to an unencrypted connection. `require` requires encryption but does not imply host identity verification; `verify-full` also validates the certificate hostname. #### `database.sslcert` The path to the client TLS certificate file. * **Type**: `STRING` * **Default**: `null` * **Importance**: Medium * **Valid Values / Notes**: Set when the database requires a client certificate. The file must be readable by the process executing the task. #### `database.sslkey` The path to the client TLS private key file. * **Type**: `STRING` * **Default**: `null` * **Importance**: Medium * **Valid Values / Notes**: Must meet PostgreSQL JDBC private key format requirements. Restrict file access and do not put private key contents in the configuration. #### `database.sslpassword` The password for accessing the client private key. * **Type**: `PASSWORD` * **Default**: `null` * **Importance**: Medium * **Valid Values / Notes**: Used with `database.sslkey`. Supply it only through secure credential management. #### `database.sslrootcert` The path to the root certificate file used to validate the server certificate. * **Type**: `STRING` * **Default**: `null` * **Importance**: Medium * **Valid Values / Notes**: Used with certificate validation modes. The process executing the task must be able to read the file. #### `database.sslfactory` Specifies the factory class that creates SSL sockets. * **Type**: `STRING` * **Default**: `null` * **Importance**: Medium * **Valid Values / Notes**: Use an installed factory class that meets PostgreSQL JDBC requirements. Do not use a factory that skips certificate validation to bypass identity verification in production. #### `database.tcpKeepAlive` Controls TCP keepalive probes. * **Type**: `BOOLEAN` * **Default**: `true` * **Importance**: Medium * **Valid Values / Notes**: `true` or `false`. Actual probe intervals depend on the operating system and connection environment. #### `connection.validation.timeout.ms` The maximum wait for connection validation, in milliseconds. * **Type**: `LONG` * **Default**: `60000` * **Importance**: Low * **Valid Values / Notes**: Successful connection validation does not mean that all snapshot, publication creation, or update operations are authorized. #### `driver.` Passes through PostgreSQL JDBC connection properties. * **Type**: `STRING` property passthrough * **Default**: No ConfigDef default * **Importance**: Not declared * **Valid Values / Notes**: Replace the placeholder in the name with the actual JDBC property name; the `driver.` prefix is removed. Types, defaults, and validation rules are defined by PostgreSQL JDBC. Do not embed plaintext credentials in connection properties. ### Logical Replication and Publications #### `plugin.name` Selects the server-side logical decoding plugin. * **Type**: `STRING` * **Default**: `decoderbufs` * **Importance**: Medium * **Valid Values / Notes**: `decoderbufs` or `pgoutput`. Set explicitly to use the built-in `pgoutput` plugin. #### `slot.name` Specifies the logical replication slot used to read changes. * **Type**: `STRING` * **Default**: `debezium` * **Importance**: Medium * **Valid Values / Notes**: Must match `[a-z0-9_]{1,63}`. Independent Connectors must use separate slots; two active replication connections cannot share one slot. #### `slot.drop.on.stop` Controls whether to drop the replication slot on a normal stop. * **Type**: `BOOLEAN` * **Default**: `false` * **Importance**: Medium * **Valid Values / Notes**: Retaining the slot supports recovery for long-running capture. Enabling this option may lose WAL needed during downtime. It does not mean that a temporary slot is created. #### `slot.failover` Controls whether to create a failover slot. * **Type**: `BOOLEAN` * **Default**: `false` * **Importance**: Medium * **Valid Values / Notes**: Creating a failover slot requires a connection to a PostgreSQL 17 or newer primary. Otherwise, a regular slot is created. This option does not automatically upgrade existing slots or configure standby synchronization and failover. #### `slot.stream.params` Supplies optional parameters to the logical decoding plugin. * **Type**: `STRING` * **Default**: `null` * **Importance**: Low * **Valid Values / Notes**: Separate parameters with semicolons. Use only parameters supported by the selected plugin; do not apply parameters from other decoding plugins to `pgoutput`. #### `slot.max.retries` The maximum number of retries when connecting to the replication slot. * **Type**: `INT` * **Default**: `6` * **Importance**: Low * **Valid Values / Notes**: Used with `slot.retry.delay.ms`. Retries cannot resolve insufficient privileges, incorrect slot-sharing designs, or lost WAL. #### `slot.retry.delay.ms` The interval between replication slot connection retries, in milliseconds. * **Type**: `LONG` * **Default**: `10000` * **Importance**: Low * **Valid Values / Notes**: Set an integer number of milliseconds. The runtime reads this value as an integer; avoid values outside the integer range. #### `publication.name` Specifies the publication used by `pgoutput`. * **Type**: `STRING` * **Default**: `dbz_publication` * **Importance**: Medium * **Valid Values / Notes**: Applies only to `pgoutput`. Coordinate the publication scope with the Connector filters. #### `publication.autocreate.mode` Controls publication creation and table set management. * **Type**: `STRING` * **Default**: `all_tables` * **Importance**: Medium * **Valid Values / Notes**: `disabled` requires a pre-created publication. `all_tables` creates an all-table publication if none exists. `filtered` creates or updates the table set of a table-specific publication. `no_tables` creates an empty publication if none exists. `filtered` rejects an existing `FOR ALL TABLES` publication and an empty matching table set. Updates may affect other users and require database-side privileges. #### `replica.identity.autoset.values` Automatically changes replica identities according to per-table rules. * **Type**: `STRING` * **Default**: `null` * **Importance**: Medium * **Valid Values / Notes**: A comma-separated mapping of table regular expressions to replica identities, in the form `schema.table:replica identity`. Supports `DEFAULT`, `INDEX index_name`, `FULL`, and `NOTHING`. Applies only to `pgoutput` and overrides existing database settings. A specified index must meet PostgreSQL replica identity index requirements, and the account must have permission to alter the table. #### `publish.via.partition.root` Controls whether changes are published through the partition root table. * **Type**: `BOOLEAN` * **Default**: `false` * **Importance**: Medium * **Valid Values / Notes**: Applies to `pgoutput`. `true` uses the partition root table identity; `false` publishes partition changes directly. Coordinate this setting with the database-side publication settings. #### `status.update.interval.ms` The interval for sending replication connection status to PostgreSQL, in milliseconds. * **Type**: `INT` * **Default**: `10000` * **Importance**: Medium * **Valid Values / Notes**: A positive integer. This is not the Kafka offset commit interval. #### `flush.lsn.source` Controls whether to acknowledge processed LSNs to PostgreSQL. * **Type**: `BOOLEAN` * **Default**: `true` * **Importance**: Low * **Valid Values / Notes**: When `false`, an external mechanism must manage LSN advancement and WAL reclamation. Connector heartbeats alone cannot replace it. #### `lsn.flush.timeout.ms` The maximum wait for an LSN flush operation, in milliseconds. * **Type**: `LONG` * **Default**: `30000` * **Importance**: Medium * **Valid Values / Notes**: A positive integer. `lsn.flush.timeout.action` determines how a timeout is handled. #### `lsn.flush.timeout.action` Controls how LSN flush timeouts are handled. * **Type**: `STRING` * **Default**: `fail` * **Importance**: Medium * **Valid Values / Notes**: `fail` stops the Connector, `warn` logs a warning and continues, and `ignore` ignores the timeout and continues. Continued operation does not mean that the source has acknowledged the consumed position. #### `xmin.fetch.interval.ms` The interval for querying the replication slot's `xmin`, in milliseconds. * **Type**: `LONG` * **Default**: `0` * **Importance**: Medium * **Valid Values / Notes**: `0` disables tracking. More frequent queries increase database overhead. ### Capture Scope and Field Processing #### `schema.include.list` Captures only matching schemas. * **Type**: `LIST` * **Default**: `null` * **Importance**: High * **Valid Values / Notes**: Comma-separated valid regular expressions. Cannot be set together with `schema.exclude.list`. Tables must also satisfy table filters and fall within the publication scope. #### `schema.exclude.list` Excludes matching schemas. * **Type**: `LIST` * **Default**: `null` * **Importance**: Medium * **Valid Values / Notes**: Comma-separated valid regular expressions. Cannot be set together with `schema.include.list`. #### `table.include.list` Captures only matching tables. * **Type**: `LIST` * **Default**: `null` * **Importance**: High * **Valid Values / Notes**: Comma-separated regular expressions matching the complete `schema.table` name. Cannot be set together with `table.exclude.list`. Does not automatically expand a pre-created publication. #### `table.exclude.list` Excludes matching tables. * **Type**: `LIST` * **Default**: `null` * **Importance**: Medium * **Valid Values / Notes**: Comma-separated regular expressions matching the complete `schema.table` name. Cannot be set together with `table.include.list`. #### `table.ignore.builtin` Controls whether to ignore built-in tables. * **Type**: `BOOLEAN` * **Default**: `true` * **Importance**: Low * **Valid Values / Notes**: When enabled, excludes `pg_catalog`, `information_schema`, schemas starting with `pg_temp`, and the `spatial_ref_sys` table. #### `column.include.list` Outputs only matching columns. * **Type**: `LIST` * **Default**: `null` * **Importance**: Medium * **Valid Values / Notes**: Regular expressions match `schema.table.column`. Cannot be set together with `column.exclude.list`. Column filtering does not replace database access isolation. #### `column.exclude.list` Excludes matching columns from event fields. * **Type**: `LIST` * **Default**: `null` * **Importance**: Medium * **Valid Values / Notes**: Regular expressions match `schema.table.column`. Cannot be set together with `column.include.list`. Do not infer that the database does not read these columns. #### `message.prefix.include.list` Captures only logical decoding messages with matching prefixes. * **Type**: `LIST` * **Default**: `null` * **Importance**: Medium * **Valid Values / Notes**: A list of valid regular expressions. Cannot be set together with `message.prefix.exclude.list`. Without filtering, all prefixes are captured. #### `message.prefix.exclude.list` Excludes logical decoding messages with matching prefixes. * **Type**: `LIST` * **Default**: `null` * **Importance**: Medium * **Valid Values / Notes**: A list of valid regular expressions. Cannot be set together with `message.prefix.include.list`. #### `skipped.operations` Specifies operations to skip during streaming. * **Type**: `LIST` * **Default**: `t` * **Importance**: Low * **Valid Values / Notes**: `c` for inserts, `u` for updates, `d` for deletes, `t` for table truncation, and `none` to skip no operations. Skipping operations changes the state that downstream consumers can reconstruct. #### `column.mask.hash.([^.]+).with.salt.(.+)` Masks matching columns with a salted hash. * **Type**: `STRING` * **Default**: `null` * **Importance**: Medium * **Valid Values / Notes**: The name is a parameterized pattern; replace the pattern portions with a hash algorithm and salt in the actual key. The value is a list of regular expressions matching fully qualified column names. Treat salts as sensitive configuration and do not use real salts in shared examples. #### `column.mask.with.(d+).chars` Replaces matching columns with the specified number of asterisks. * **Type**: `STRING` * **Default**: `null` * **Importance**: Medium * **Valid Values / Notes**: The actual key uses a numeric character count, for example `column.mask.with.8.chars`; its value specifies column matching rules. The pattern in the name is not a property name that can be submitted directly. #### `column.truncate.to.(d+).chars` Truncates matching columns to the specified number of characters. * **Type**: `INT` * **Default**: `null` * **Importance**: Medium * **Valid Values / Notes**: The actual key uses a numeric character count, for example `column.truncate.to.16.chars`. This is a parameterized key pattern: the character count is in the actual key name, and the corresponding matching rule selects columns. Truncation is irreversible; evaluate its impact on business fields. ### Snapshots and Initial Data Loading #### `snapshot.mode` Selects the startup strategy for snapshots and subsequent streaming. * **Type**: `STRING` * **Default**: `initial` * **Importance**: Medium * **Valid Values / Notes**: `initial` performs the first initialization and then captures changes continuously. `always` takes a new snapshot on every startup before capturing changes. `initial_only` performs initialization only. `no_data` does not scan existing rows. `when_needed` allows a new snapshot when the required log position is unavailable. `configuration_based` uses the associated switches. `custom` uses an installed extension. `never` is still accepted but deprecated; use `no_data` instead. A new snapshot restores the current state, not lost historical changes. #### `snapshot.isolation.mode` Sets the snapshot transaction isolation level. * **Type**: `STRING` * **Default**: `serializable` * **Importance**: Low * **Valid Values / Notes**: `serializable`, `repeatable_read`, `read_committed`, `read_uncommitted`. Different isolation levels do not provide equivalent consistency. Evaluate the impact of business writes during the snapshot before changing this setting. #### `snapshot.locking.mode` Controls the locking strategy used when reading snapshot metadata. * **Type**: `STRING` * **Default**: `none` * **Importance**: Low * **Valid Values / Notes**: `none`, `shared`, `custom`. `none` requires avoiding schema changes during the snapshot. `shared` acquires `ACCESS SHARE` locks, blocking conflicting DDL without blocking ordinary row writes. `custom` uses an installed locking strategy. #### `snapshot.lock.timeout.ms` The maximum wait to acquire table locks at the start of a snapshot, in milliseconds. * **Type**: `LONG` * **Default**: `10000` * **Importance**: Medium * **Valid Values / Notes**: Applies when the selected locking strategy requires locks. A lock acquisition timeout terminates the snapshot; first check for conflicting transactions or DDL. #### `snapshot.delay.ms` The delay before starting a snapshot, in milliseconds. * **Type**: `LONG` * **Default**: `0` * **Importance**: Low * **Valid Values / Notes**: Delaying startup does not replace resource capacity planning. #### `streaming.delay.ms` The delay between snapshot completion and the start of streaming, in milliseconds. * **Type**: `LONG` * **Default**: `0` * **Importance**: Low * **Valid Values / Notes**: Changes during the delay still depend on WAL retained by the replication slot. Account for log retention space. #### `snapshot.include.collection.list` Limits the set of tables included in the snapshot. * **Type**: `LIST` * **Default**: `null` * **Importance**: Medium * **Valid Values / Notes**: Specifies table matching rules; selected tables must be within the capture scope. Affects only the snapshot scope and does not replace streaming table filters. #### `snapshot.fetch.size` Controls the fetch size for snapshot reads. * **Type**: `INT` * **Default**: `null` * **Importance**: Medium * **Valid Values / Notes**: When unset, the PostgreSQL runtime falls back to `10240`. This fallback is not the default in the configuration definition. Consider row size and task memory when adjusting it. #### `snapshot.max.threads` Sets the maximum number of snapshot threads. * **Type**: `INT` * **Default**: `1` * **Importance**: Medium * **Valid Values / Notes**: Affects the snapshot phase, not the number of streaming tasks. Evaluate database read load before increasing parallelism. #### `snapshot.tables.order.by.row.count` Controls table processing order during the initial snapshot. * **Type**: `STRING` * **Default**: `disabled` * **Importance**: Medium * **Valid Values / Notes**: `disabled` does not sort by row count, `ascending` sorts by increasing row count, and `descending` sorts by decreasing row count. #### `snapshot.select.statement.overrides` Specifies tables whose snapshot queries are overridden. * **Type**: `STRING` * **Default**: `null` * **Importance**: Medium * **Valid Values / Notes**: A comma-separated list of `schema.table` names. Each table needs a corresponding dynamic query setting using the same table name. Changes only existing-data reads, not the scope of subsequent logical replication. #### `snapshot.select.statement.overrides..
` Supplies a snapshot SQL query for the specified table. * **Type**: `STRING` * **Default**: No ConfigDef default * **Importance**: Not declared * **Valid Values / Notes**: The actual table name must appear in `snapshot.select.statement.overrides`, and the value must be an SQL `SELECT`. The override is skipped if no value is provided. Filtering existing data changes the initial downstream baseline; it does not imply that subsequent changes are filtered by the same condition. #### `snapshot.query.mode` Selects how snapshot queries are built. * **Type**: `STRING` * **Default**: `select_all` * **Importance**: Low * **Valid Values / Notes**: `select_all` or `custom`. Custom mode requires the corresponding SPI implementation. #### `snapshot.query.mode.custom.name` Specifies the custom snapshot query implementation name. * **Type**: `STRING` * **Default**: `null` * **Importance**: Medium * **Valid Values / Notes**: With `snapshot.query.mode=custom`, use an installed `io.debezium.snapshot.spi.SnapshotQuery` implementation's `name()` value, not an arbitrary class name. #### `snapshot.locking.mode.custom.name` Specifies the custom snapshot locking implementation name. * **Type**: `STRING` * **Default**: `null` * **Importance**: Medium * **Valid Values / Notes**: With `snapshot.locking.mode=custom`, use an installed `io.debezium.snapshot.spi.SnapshotLock` implementation's `name()` value. #### `snapshot.mode.custom.name` Specifies the custom snapshot strategy name. * **Type**: `STRING` * **Default**: `null` * **Importance**: Medium * **Valid Values / Notes**: With `snapshot.mode=custom`, use an installed `Snapshotter` implementation's `name()` value. #### `snapshot.mode.configuration.based.snapshot.data` Controls whether the configuration-based strategy snapshots data. * **Type**: `BOOLEAN` * **Default**: `false` * **Importance**: Medium * **Valid Values / Notes**: Used only with `snapshot.mode=configuration_based`. #### `snapshot.mode.configuration.based.snapshot.schema` Controls whether the configuration-based strategy snapshots schemas. * **Type**: `BOOLEAN` * **Default**: `false` * **Importance**: Medium * **Valid Values / Notes**: Used only with `snapshot.mode=configuration_based`. #### `snapshot.mode.configuration.based.start.stream` Controls whether the configuration-based strategy starts streaming after the snapshot. * **Type**: `BOOLEAN` * **Default**: `false` * **Importance**: Medium * **Valid Values / Notes**: Used only with `snapshot.mode=configuration_based`. Do not assume that this mode automatically captures changes continuously. #### `snapshot.mode.configuration.based.snapshot.on.schema.error` Controls whether the configuration-based strategy takes a snapshot on a schema error. * **Type**: `BOOLEAN` * **Default**: `false` * **Importance**: Medium * **Valid Values / Notes**: Used only with `snapshot.mode=configuration_based`; it does not replace diagnosis of the specific error. #### `snapshot.mode.configuration.based.snapshot.on.data.error` Controls whether the configuration-based strategy takes a snapshot on a data position error. * **Type**: `BOOLEAN` * **Default**: `false` * **Importance**: Medium * **Valid Values / Notes**: Used only with `snapshot.mode=configuration_based`. Rereading current data does not recover lost historical events. ### Events, Message Keys, and Data Types #### `message.key.columns` Specifies custom message key columns per table. * **Type**: `STRING` * **Default**: `null` * **Importance**: Medium * **Valid Values / Notes**: Semicolon-separated mappings in the form `schema.table:column1,column2`. Unspecified tables typically use their primary keys. Custom message keys do not supply old key values missing from the database WAL or change replica identities. #### `tombstones.on.delete` Controls whether to send a null-valued record with the same key after a delete event. * **Type**: `BOOLEAN` * **Default**: `true` * **Importance**: Medium * **Valid Values / Notes**: `true` sends a delete event followed by a tombstone; `false` sends only the delete event. Tombstones support Kafka log compaction and do not guarantee automatic deletes in downstream databases. #### `provide.transaction.metadata` Controls the output of transaction metadata and event counts. * **Type**: `BOOLEAN` * **Default**: `false` * **Importance**: Low * **Valid Values / Notes**: Enabling this setting adds transaction context and metadata output. It does not imply atomic consumption across topics or end-to-end transaction guarantees. #### `transaction.metadata.factory` Specifies the factory for transaction context and structures. * **Type**: `CLASS` * **Default**: `io.debezium.pipeline.txmetadata.DefaultTransactionMetadataFactory` * **Importance**: Low * **Valid Values / Notes**: Custom implementations must be accessible to the plugin class loader and meet transaction metadata interface requirements. #### `extended.headers.enabled` Controls whether to add Debezium context headers. * **Type**: `BOOLEAN` * **Default**: `true` * **Importance**: Low * **Valid Values / Notes**: Headers provide event tracing and source identification information. They do not replace message keys or event positions. #### `decimal.handling.mode` Selects the representation of `DECIMAL` and `NUMERIC` values. * **Type**: `STRING` * **Default**: `precise` * **Importance**: Medium * **Valid Values / Notes**: `precise` uses Connect Decimal and exact numeric values, `string` uses strings, and `double` uses floating-point values that may lose precision. Coordinate this choice with the consumer's type model. #### `time.precision.mode` Selects the precision and representation of dates, times, and timestamps. * **Type**: `STRING` * **Default**: `adaptive` * **Importance**: Medium * **Valid Values / Notes**: `adaptive`, `adaptive_time_microseconds`, `isostring`, `microseconds`, `nanoseconds`, `connect`. `adaptive` converts according to source column precision. `connect` uses Connect millisecond-precision representations and may not preserve higher precision. #### `hstore.handling.mode` Selects the representation of `HSTORE` values. * **Type**: `STRING` * **Default**: `json` * **Importance**: Low * **Valid Values / Notes**: `json` uses JSON strings; `map` uses key-value maps. #### `binary.handling.mode` Selects the representation of binary columns. * **Type**: `STRING` * **Default**: `bytes` * **Importance**: Low * **Valid Values / Notes**: `bytes`, `base64`, `hex`, `base64-url-safe`. Final byte serialization also depends on the converter. #### `interval.handling.mode` Selects the representation of `INTERVAL` values. * **Type**: `STRING` * **Default**: `numeric` * **Importance**: Low * **Valid Values / Notes**: `numeric` approximately converts intervals to microseconds; `string` uses exact ISO-format strings. For intervals containing units such as months, do not assume that numeric conversion preserves the original interval semantics. #### `include.unknown.datatypes` Controls whether to output fields with unrecognized data types. * **Type**: `BOOLEAN` * **Default**: `false` * **Importance**: Medium * **Valid Values / Notes**: `false` omits unsupported fields. `true` uses an implementation-dependent binary representation and does not guarantee a corresponding business logical type for every custom type. #### `unavailable.value.placeholder` Represents TOAST field values not supplied by the database. * **Type**: `STRING` * **Default**: `__debezium_unavailable_value` * **Importance**: Medium * **Valid Values / Notes**: This is not SQL NULL or an actual business value. When the value starts with `hex:`, the remainder is parsed as hexadecimal bytes. Consumers must recognize unavailable values and avoid overwriting existing valid field values with the placeholder. #### `schema.refresh.mode` Controls when in-memory table schemas are refreshed. * **Type**: `STRING` * **Default**: `columns_diff` * **Importance**: Medium * **Valid Values / Notes**: `columns_diff` refreshes on column differences. `columns_diff_exclude_unchanged_toast` ignores differences caused by unchanged TOAST values, which may conceal dropped TOAST columns and leave the cache stale. #### `schema.name.adjustment.mode` Adjusts output schema names to suit the serialization format. * **Type**: `STRING` * **Default**: `none` * **Importance**: Low * **Valid Values / Notes**: `none`, `avro`, `avro_unicode`. Evaluate name collisions and downstream compatibility before conversion. This does not change actual database names. #### `include.schema.comments` Controls whether to include table and column comments in metadata. * **Type**: `BOOLEAN` * **Default**: `false` * **Importance**: Medium * **Valid Values / Notes**: Enabling this setting increases memory use. Evaluate comment size and whether comments contain information that should not be propagated. #### `column.propagate.source.type` Adds source type and length information to field schemas for matching columns. * **Type**: `LIST` * **Default**: `null` * **Importance**: Medium * **Valid Values / Notes**: Comma-separated regular expressions matching fully qualified column names. Propagates type metadata without changing field values. #### `datatype.propagate.source.type` Propagates source type and length information by database type name. * **Type**: `LIST` * **Default**: `null` * **Importance**: Medium * **Valid Values / Notes**: Comma-separated regular expressions matching database type names, not column names. #### `sourceinfo.struct.maker` Specifies the implementation that builds the event `source` schema and structure. * **Type**: `CLASS` * **Default**: `io.debezium.connector.postgresql.PostgresSourceInfoStructMaker` * **Importance**: Low * **Valid Values / Notes**: Custom implementations must conform to the `SourceInfoStructMaker` interface. Structural changes affect consumers that depend on source metadata. #### `converters` Registers Debezium custom field conversion extensions. * **Type**: `STRING` * **Default**: `null` * **Importance**: Low * **Valid Values / Notes**: Use extension aliases with their respective `别名.type` and `别名.选项` settings, where the alias denotes each extension. Required classes must be installed. This setting is distinct from Kafka Connect message serialization converters. #### `post.processors` Registers event post-processing extensions. * **Type**: `STRING` * **Default**: `null` * **Importance**: Low * **Valid Values / Notes**: Use processor aliases with their respective `别名.type` settings and configuration properties, where the alias denotes each processor. Install compatible implementations and evaluate processing overhead. ### Topic Naming #### `topic.prefix` Sets the topic namespace for the capture source. * **Type**: `STRING` * **Default**: `null` * **Importance**: High * **Required**: Yes * **Valid Values / Notes**: Allows only letters, digits, dots, underscores, and hyphens. Use separate prefixes for different capture sources. Retain the original prefix during maintenance to avoid unintentionally changing output identity. #### `topic.naming.strategy` Specifies the topic naming strategy. * **Type**: `CLASS` * **Default**: `io.debezium.schema.SchemaTopicNamingStrategy` * **Importance**: Medium * **Valid Values / Notes**: Default table topic names join the topic prefix, schema, and table name with a delimiter. The following four settings apply to the default strategy; custom strategies may use different settings. #### `topic.delimiter` Specifies the delimiter for the default naming strategy. * **Type**: `STRING` * **Default**: `.` * **Importance**: Low * **Valid Values / Notes**: Must meet topic naming character requirements. Changing it changes topic names. #### `topic.cache.size` Sets the topic name cache capacity. * **Type**: `INT` * **Default**: `10000` * **Importance**: Low * **Valid Values / Notes**: Used to cache mappings from data collections to topic names. This is not a limit on the number of Kafka topics. #### `topic.heartbeat.prefix` Sets the heartbeat topic prefix for the default naming strategy. * **Type**: `STRING` * **Default**: `__debezium-heartbeat` * **Importance**: Low * **Valid Values / Notes**: By default, the heartbeat topic combines this prefix, the delimiter, and `topic.prefix`. Records are sent only when heartbeats are enabled. #### `topic.transaction` Sets the transaction topic suffix for the default naming strategy. * **Type**: `STRING` * **Default**: `transaction` * **Importance**: Low * **Valid Values / Notes**: The transaction topic combines `topic.prefix`, the delimiter, and this suffix. Transaction metadata must be enabled separately. ### Heartbeats, Signals, and Incremental Snapshots #### `heartbeat.interval.ms` Sets the interval for sending heartbeat records, in milliseconds. * **Type**: `INT` * **Default**: `0` * **Importance**: Medium * **Valid Values / Notes**: A non-negative integer; `0` disables heartbeats. Can help advance offsets when replication progresses but table events are filtered out. Kafka heartbeats alone do not guarantee that the database generates new WAL. #### `heartbeat.topics.prefix` Sets the generic heartbeat prefix property. * **Type**: `STRING` * **Default**: `__debezium-heartbeat` * **Importance**: Low * **Valid Values / Notes**: This property remains configurable, but the default `SchemaTopicNamingStrategy` uses the separate `topic.heartbeat.prefix` setting. Do not infer the default strategy's topic name from this property alone. #### `heartbeat.action.query` Specifies the query executed for database heartbeats. * **Type**: `STRING` * **Default**: `null` * **Importance**: Low * **Valid Values / Notes**: Requires a nonzero `heartbeat.interval.ms`. If writes are used to advance WAL in a low-traffic database, the account needs the appropriate write privileges, and the relevant table must be in the `pgoutput` publication. The query target must be in the currently connected database. #### `signal.data.collection` Specifies the table used to receive source-side signals. * **Type**: `STRING` * **Default**: `null` * **Importance**: Medium * **Valid Values / Notes**: PostgreSQL uses `schema.table`. Source-side signaling requires the appropriate signal table, capture scope, and privileges. #### `signal.enabled.channels` Selects enabled signaling channels. * **Type**: `LIST` * **Default**: `source` * **Importance**: Medium * **Valid Values / Notes**: A list of channel names. Selected channels require corresponding implementations and configuration; setting names alone is insufficient without channel resources. #### `signal.poll.interval.ms` The interval for checking registered signaling channels, in milliseconds. * **Type**: `LONG` * **Default**: `5000` * **Importance**: Medium * **Valid Values / Notes**: Shorter intervals increase polling overhead. This is not the interval for capturing business changes. #### `incremental.snapshot.chunk.size` Sets the maximum number of rows per incremental snapshot chunk. * **Type**: `INT` * **Default**: `1024` * **Importance**: Medium * **Valid Values / Notes**: Incremental snapshots capture additional existing data while streaming. Chunk size affects memory use and read load, not the number of streaming tasks. #### `incremental.snapshot.watermarking.strategy` Selects the management strategy for incremental snapshot watermark signals. * **Type**: `STRING` * **Default**: `INSERT_INSERT` * **Importance**: Low * **Valid Values / Notes**: Accepts `insert_insert` and `insert_delete`. The former writes both opening and closing watermark signals; the latter writes an opening signal and closes it by deletion. These operations write to the signal table and require appropriate privileges. #### `notification.enabled.channels` Selects notification output channels. * **Type**: `LIST` * **Default**: `null` * **Importance**: Medium * **Valid Values / Notes**: A list of channel names. Selected channels must have available implementations. A notification topic is required when the list includes `sink`. This is notification output from a Source Connector, not a direction setting for another Connector type. #### `notification.sink.topic.name` Specifies the output destination for the topic notification channel. * **Type**: `STRING` * **Default**: `null` * **Importance**: High * **Valid Values / Notes**: Required when `notification.enabled.channels` includes `sink`. Does not change business table event topics. ### Queues, Throughput, and Error Recovery #### `max.batch.size` Sets the maximum number of records delivered to the Worker in one batch. * **Type**: `INT` * **Default**: `2048` * **Importance**: Medium * **Valid Values / Notes**: The batch limit should be smaller than `max.queue.size`. Evaluate memory and latency before increasing it; a larger batch does not guarantee improved source-side commit capacity. #### `max.queue.size` Sets the maximum number of change events queued before delivery. * **Type**: `INT` * **Default**: `8192` * **Importance**: Medium * **Valid Values / Notes**: Must be greater than `0` and strictly greater than `max.batch.size`. Reaching the limit causes backpressure rather than silent drops; a backlog may still increase source-side WAL retention pressure. #### `max.queue.size.in.bytes` Sets the byte capacity limit for the change event queue. * **Type**: `LONG` * **Default**: `0` * **Importance**: Medium * **Valid Values / Notes**: `0` disables the byte limit. When enabled, it constrains the queue together with the record count limit. It is not a total memory limit for the Worker JVM. #### `poll.interval.ms` The wait time when the queue contains no new events, in milliseconds. * **Type**: `LONG` * **Default**: `500` * **Importance**: Medium * **Valid Values / Notes**: This does not cause full-table database queries at the specified interval. Reducing the wait changes idle polling overhead. #### `query.fetch.size` Controls the fetch size of JDBC queries during streaming. * **Type**: `INT` * **Default**: `0` * **Importance**: Medium * **Valid Values / Notes**: `0` uses the JDBC default fetch size. This is distinct from snapshot batches and replication message batches. #### `event.processing.failure.handling.mode` Controls behavior after event processing failures. * **Type**: `STRING` * **Default**: `fail` * **Importance**: Medium * **Valid Values / Notes**: `fail`, `warn`, `ignore`, `skip`. `fail` stops processing. Skipping policies omit problematic events; warnings or continued operation do not imply data completeness. #### `errors.max.retries` Controls the maximum number of retries for connection-related errors. * **Type**: `INT` * **Default**: `-1` * **Importance**: Low * **Valid Values / Notes**: `-1` means unlimited retries, `0` disables retries, and a positive value specifies the retry count. Applies only to retriable errors and cannot recover WAL that has been removed. #### `retriable.restart.connector.wait.ms` The wait before restarting capture logic after a retriable exception, in milliseconds. * **Type**: `LONG` * **Default**: `10000` * **Importance**: Low * **Valid Values / Notes**: Used with the error retry policy. Permanent privilege errors require authorization changes, not continually shorter waits. #### `executor.shutdown.timeout.ms` The maximum wait for the task executor to shut down, in milliseconds. * **Type**: `LONG` * **Default**: `4000` * **Importance**: Medium * **Valid Values / Notes**: Allow time for task cleanup during shutdown. This does not replace retention planning for source slots and offsets. ### Extended Metadata and Data Lineage #### `custom.metric.tags` Adds custom tags to MBean object names. * **Type**: `LIST` * **Default**: `null` * **Importance**: Low * **Valid Values / Notes**: Comma-separated key-value pairs, for example `environment=production`. Limit tag count and do not include credentials or sensitive business content. #### `openlineage.integration.enabled` Controls whether to output data lineage metadata through OpenLineage. * **Type**: `BOOLEAN` * **Default**: `false` * **Importance**: Low * **Valid Values / Notes**: Prepare the corresponding OpenLineage configuration and available integration resources before enabling it. #### `openlineage.integration.config.file.path` Specifies the OpenLineage configuration file path. * **Type**: `STRING` * **Default**: `./openlineage.yml` * **Importance**: Low * **Valid Values / Notes**: The file must be readable by the running process. Protect sensitive information in the file according to credential management requirements. #### `openlineage.integration.job.namespace` Sets the namespace for the lineage job. * **Type**: `STRING` * **Default**: `null` * **Importance**: Low * **Valid Values / Notes**: Used for lineage job identity. Does not change the captured database or topics. #### `openlineage.integration.job.description` Sets the lineage job description. * **Type**: `STRING` * **Default**: `Debezium change data capture job` * **Importance**: Low * **Valid Values / Notes**: Used only for metadata descriptions. Do not include sensitive requests or credentials. #### `openlineage.integration.job.tags` Sets lineage job tags. * **Type**: `LIST` * **Default**: `null` * **Importance**: Low * **Valid Values / Notes**: Comma-separated key-value pairs. Avoid excessive tags and sensitive information. #### `openlineage.integration.job.owners` Sets lineage job owner metadata. * **Type**: `LIST` * **Default**: `null` * **Importance**: Low * **Valid Values / Notes**: Comma-separated key-value pairs. Populate them according to your organization's metadata policy. ## Best Practices ### Establish an Initial Baseline and Continue Synchronizing Changes **Applicable Scenario**: Connect for the first time to a PostgreSQL database with existing business data, establish a complete initial state for search, caching, or data synchronization, and continue receiving business changes rather than only new data after startup. **Configuration Example**: Reuse the Quick Start connection, dedicated replication slot, pre-created publication, and table filter settings. Determine the complete capture scope before creating the Connector for the first time; no additional configuration is needed. ```properties theme={null} connector.class=io.debezium.connector.postgresql.PostgresConnector database.hostname= database.user= database.password= database.dbname= topic.prefix= plugin.name=pgoutput slot.name= publication.name= publication.autocreate.mode=disabled table.include.list= ``` **Key Considerations**: Check the table filters against the publication's table set before startup, then schedule the snapshot read window and avoid DDL during the snapshot. With no offset on first startup, the default `initial` mode emits `r` records and continues with changes after completion. It supports capturing changes made during the snapshot, but initialization reads add database load. Do not assume that expanding table filters automatically initializes new tables: with existing offsets, `initial` does not rescan existing data merely because tables were added. Restarting an incomplete snapshot may resend rows already read; downstream consumers must handle duplicates using stable message keys. For routine stops and starts, retain the Connector identity, topic prefix, offsets, and replication slot, and ensure the required WAL remains available. Do not drop the slot for routine maintenance. ### Keep Publication Tables Aligned When Maintaining the Capture Scope **Applicable Scenario**: Expand capture from the initial table set to other business tables while keeping table filters aligned with the PostgreSQL publication, so that new table changes are not missed after changing only Connector settings. Applies to deployments where the capture team is authorized to manage a dedicated table-specific publication. **Configuration Example**: Override the following two Quick Start settings. The table regular expression represents the complete table set after the change, and the publication name still refers to a table-specific publication dedicated to this Connector. Remove `table.exclude.list` first if it was previously set. ```properties theme={null} publication.autocreate.mode=filtered table.include.list= ``` **Key Considerations**: First confirm that the account has the privileges needed to manage the publication and add each table, then update the configuration and restart capture. During initialization, `filtered` creates or replaces the publication's table set according to the filters; it does not simply append tables to the original set. It cannot modify a `FOR ALL TABLES` publication and should not be used for a publication shared with other consumers. If added tables contain existing data, plan a separate baseline backfill. Updating the publication only addresses replication scope; it does not rerun a completed `initial` snapshot. For DBA-managed publications, retain `disabled` and have the DBA coordinate table set changes, without granting additional privileges for automatic management. ## Monitoring ### What to Monitor Monitor Kafka Connect cluster health, Connector and task status, throughput and processing latency, offset commit progress, errors and retries, and Worker JVM heap, GC, and thread signals. Even when a task reports that it is running, confirm that records and offsets continue to advance. For prolonged backlogs, use source-side operational information to check WAL retention pressure from replication slots. Monitor DLQ activity only when the corresponding error handling is enabled; do not assume that every capture exception is written to a DLQ. ### Import the Grafana Dashboard Download the [AutoMQ Connect Cluster Grafana Dashboard](https://automq-download-center.oss-cn-hangzhou.aliyuncs.com/connect-dashboard/automq-connect-cluster-dashboard.json), prepare a matching Prometheus-compatible data source and labels such as cluster and Worker, then import the JSON into Grafana and select the appropriate data source and cluster. ## Limitations * One Connector captures only one database and creates one streaming task. Increasing `tasks.max` does not split the replication stream. * Include and exclude settings at the same level are mutually exclusive. Connector table filters cannot compensate for tables missing from the publication. * PostgreSQL logical decoding does not provide replayable SQL DDL events. Event schema updates do not constitute a complete DDL history. * The completeness of `before` depends on replica identity and the old tuple supplied by the database. Do not assume that every update or delete contains a complete old row. * Schema changes are not supported during incremental snapshots. Coordinate DDL windows accordingly. * `TRUNCATE` is skipped by default. When enabled, it produces keyless `t` events, not per-row deletes or tombstones. * Global consumption order and atomic visibility across tables are not guaranteed across Kafka topics or partitions. In particular, do not rely on global ordering between keyless `TRUNCATE` events and row events. * After a replication slot is dropped or required WAL is removed, Kafka offsets cannot regenerate source log history. A new snapshot can rebuild the current state but cannot recover intermediate changes that are no longer available. * Normal failure recovery and restarts of incomplete snapshots may resend records. The default configuration must not be interpreted as an end-to-end exactly-once synchronization guarantee. ## FAQ ### Existing Data Appears in the Snapshot, but Subsequent Updates Do Not Reach the Topic First check the logical decoding plugin actually in use. Then verify that the `pgoutput` publication contains the target tables and publishes the required operations, and that `schema`, `table`, and `skipped.operations` filters do not exclude the events. Snapshots read through JDBC, so being able to read existing data does not prove that the publication scope is correct. For DBA-managed publications, have the DBA add the missing coverage. With `filtered`, confirm that the table-specific publication is dedicated to this Connector and that management privileges are available, then restart after updating the configuration. If updates or deletes fail in the database, also check the table's replica identity. ### Startup Fails with Insufficient Publication or Table Privileges Check that the account has replication, database connection, schema usage, and table read privileges. Automatic publication creation also requires database `CREATE`; modifying a publication and adding tables involves object ownership. The default `all_tables` mode may attempt to create an all-table publication requiring superuser privileges. Have a DBA pre-create the required table-specific publication and set `publication.autocreate.mode=disabled` instead of promoting the capture account directly to superuser. With `filtered`, confirm that the existing publication is not `FOR ALL TABLES` and that the table filters match a nonempty set. ### A Delete Produces Two Records, and the Second Has a Null Value This is the default delete behavior: a delete event with `op=d` and a null `after` is followed by a null-valued tombstone with the same key. Consumers must distinguish the delete envelope from the tombstone rather than treat a null-valued record as a parsing failure. Applications that reconstruct state must handle deletes. Log compaction uses tombstones to remove history for the same key; it does not automatically delete rows from downstream databases. ### Old Values Are Incomplete in Update Events, or Large Fields Contain an Unavailable Placeholder Check the table's `REPLICA IDENTITY`. `DEFAULT` typically supplies only old key columns, and unchanged TOAST fields may also omit their actual values. The placeholder means unavailable, not SQL NULL; consumers can retain existing field values when a new value is unavailable. If complete old rows are genuinely required, have a DBA evaluate `FULL` and its additional WAL and processing costs. Do not enable it uniformly for all tables merely to eliminate placeholders. Custom message keys cannot recover old column values that the database did not send. ### Adding Table Filters Does Not Produce Existing Data for New Tables `table.include.list` controls capture scope; it is not a request to rerun initialization. With existing offsets and a completed first snapshot, the default `initial` mode does not automatically rescan existing rows when tables are added. First verify the publication and privileges for the new tables. Then plan a supported incremental snapshot or a separate initialization capture process according to downstream baseline requirements. Do not try to fix this by clearing offsets or dropping slots directly, as that may affect the existing recovery boundary. ### WAL Usage Keeps Growing During Downtime Replication slots retain WAL needed for capture. Check Connector and task status, backlogs, offset commits, and LSN acknowledgment progress. Confirm that `flush.lsn.source` has not been disabled without an external reclamation mechanism. Observe progress after consumption resumes, and plan disk capacity and server-side retention limits according to the permitted downtime. Consider heartbeats when many events are filtered out. Low-traffic databases may also need a database heartbeat query that generates WAL, with the relevant table included in the publication. Do not drop a slot that is still needed for recovery merely to free disk space. ### Restarting Produces Duplicates or Fails to Read the Original Log Position Duplicates may result from offsets that were not yet persisted or rescans of incomplete snapshots. Downstream consumers should use stable keys and source positions to design idempotent processing. If the original position cannot be read, check whether capture identity changed, whether the replication slot was retained, and whether required WAL was removed. Increasing retry counts cannot recover missing logs. If rebuilding is necessary, coordinate the new snapshot baseline, existing downstream state, and historical event gaps. Even a strategy that permits a new snapshot cannot recover history that has already been lost. # Debezium SQL Server Source Connector Source: https://docs.automq.com/automq-cloud/kafka-connect/source-connectors/debezium-sqlserver-source-connector Configure and operate the Debezium SQL Server Source Connector in AutoMQ Connect, including prerequisites, configuration, monitoring, and troubleshooting. ## Overview The Debezium SQL Server Source Connector sends existing data and subsequent row-level changes from SQL Server business tables to Kafka. It is suitable for downstream data synchronization, cache updates, and change event processing. During initial onboarding, it can read a row snapshot of the tables and then continuously read INSERT, UPDATE, and DELETE operations captured by SQL Server CDC instead of periodically scanning entire tables. By default, each table maps to a data topic named `topic.prefix...
`. Message keys are typically derived from the table's primary key, while message values contain the operation type, before and after data, and source position. Schema change messages and internal schema history are stored separately. Internal schema history is used for recovery and is not intended for business consumption. ## Prerequisites * **CDC for databases and tables**: Confirm that the SQL Server version, edition, and deployment model support CDC. An administrator must first enable CDC for the database and then for each base table to be synchronized. Enabling CDC at the database level requires `sysadmin`, while enabling it at the table level requires `db_owner`. The Connector does not create or refresh capture instances on your behalf. * **CDC capture jobs and retention window**: Standard SQL Server deployments require SQL Server Agent to be running and the CDC capture and cleanup jobs to operate normally. The retention window must cover the longest expected downtime plus the catch-up period after recovery. Capture mechanisms for managed deployments must be prepared according to their own requirements and must not be managed as though they were a local SQL Server Agent deployment. * **Runtime account permissions**: The account must be able to read the source tables and captured columns used for the snapshot, and access CDC metadata and change data in every selected database. If a CDC gating role is configured, an account that is not `sysadmin` or `db_owner` must also belong to that role. CDC administration privileges do not need to be granted to the persistent runtime account. Querying SQL Server Agent service status separately requires service DMV visibility appropriate to the server version; do not treat `VIEW SERVER STATE` as a universal requirement for every version. A DBA may instead provide a controlled status query endpoint. A successful login does not mean that all of these read permissions are present. * **SQL Server TLS**: The Quick Start requires the server to present a trusted TLS certificate whose name matches the connection hostname, and the Connect Worker JVM must trust the certificate chain. If a private CA is used, add the CA to the Worker's trust configuration first. The driver enables connection encryption and certificate validation by default; disabling encryption or bypassing certificate validation is not a prerequisite for onboarding. * **Internal schema history**: Prepare a dedicated Kafka history topic for this Connector. Keep it single-partitioned and retain the complete history indefinitely so that the retention policy does not delete records required for recovery. Ensure that the history clients have read and write permissions, as well as permission to create the topic when automatic creation is required. Do not assume that these clients fully inherit Worker authentication settings. ## License Licensed under the Apache License 2.0. ## Quick Start Prepare a Connect Cluster, Kafka, and a SQL Server database and business tables with CDC enabled. Confirm that network connectivity, access permissions, and TLS trust configuration meet the requirements. For creation and management operations, see AutoMQ's [Manage Connectors](../manage-connectors). The following example uses database account authentication, inherits the message converters configured on the Worker, and establishes an encrypted connection through a trusted certificate. ```properties theme={null} connector.class=io.debezium.connector.sqlserver.SqlServerConnector database.hostname= database.names= database.user= database.password= topic.prefix= schema.history.internal.kafka.bootstrap.servers= schema.history.internal.kafka.topic= ``` Replace the environment placeholders. The hostname must match the certificate name, the topic prefix must be unique among other Connectors, and the history topic must not be shared with business topics or other independent Connectors. This example uses the default port `1433`, the default single Task, and the default `initial` snapshot mode: when no Offset exists, it reads the existing rows from in-scope CDC tables and then continuously synchronizes changes. Supply account credentials through a secure configuration mechanism supported by the deployment, and do not write them to public files or logs. The example depends on a prepared JVM trust chain and cannot be used directly in an environment where certificate trust has not been configured. ## Configuration ### Connection and Database Scope #### `database.hostname` The resolvable hostname or IP address of SQL Server. * **Type**: `string` * **Default**: None (`null`) * **Importance**: High * **Valid values / Notes**: Required. When TLS is used, the value must match the certificate identity. #### `database.port` The SQL Server connection port. * **Type**: `int` * **Default**: `1433` * **Importance**: High * **Valid values / Notes**: Specify the port on which the server actually listens. #### `database.instance` The SQL Server named instance. * **Type**: `string` * **Default**: None (`null`) * **Importance**: Low * **Valid values / Notes**: Set only when connecting to a named instance, and verify how its port is resolved. #### `database.names` Selects databases on the same SQL Server connection. * **Type**: `list` * **Default**: None (`null`) * **Importance**: High * **Valid values / Notes**: At runtime, a non-empty, comma-separated list of database names is required. Prepare CDC and permissions for each database. With multiple databases, Tasks are assigned by database; a database is not split by table. #### `database.user` The database connection account. * **Type**: `string` * **Default**: None (`null`) * **Importance**: High * **Valid values / Notes**: Set when using username and password authentication. Other authentication methods are determined by the selected JDBC mode and cannot be enabled merely by omitting the account. #### `database.password` The database connection password. * **Type**: `password` * **Default**: None (`null`) * **Importance**: High * **Valid values / Notes**: Supply it as required by the authentication method, and do not expose it in logs or shared configuration. #### `database.query.timeout.ms` The database query execution timeout in milliseconds. * **Type**: `int` * **Default**: `600000` * **Importance**: Low * **Valid values / Notes**: `0` means that query execution time is unlimited. This is distinct from the connection timeout. #### `connection.validation.timeout.ms` The maximum time to wait for database connection validation to complete, in milliseconds. * **Type**: `long` * **Default**: `60000` * **Importance**: Low * **Valid values / Notes**: A positive integer. This is not a data query timeout. #### `data.query.mode` Controls how incremental CDC data is queried. * **Type**: `string` * **Default**: `function` * **Importance**: Low * **Valid values / Notes**: `function` calls CDC change functions. `direct` queries change tables directly and requires matching permissions. #### `database.sqlserver.agent.status.query` Queries whether SQL Server Agent is running. * **Type**: `string` * **Default**: `SELECT CASE WHEN dss.[status]=4 THEN 1 ELSE 0 END AS isRunning FROM #db.sys.dm_server_services dss WHERE dss.[servicename] LIKE N'SQL Server Agent (%';` * **Importance**: Medium * **Valid values / Notes**: Returns the `isRunning` status, where `#db` is a database replacement marker. This setting is read from the database subconfiguration, so Connector configuration must use the `database.` prefix; the field suffix is `sqlserver.agent.status.query`. Service DMV permissions depend on the server version. Verify the result semantics of a custom query with the DBA. A failed query does not mean that Agent has stopped. #### `database.` Passes connection properties through to the Microsoft SQL Server JDBC driver for TLS, authentication, and driver connection behavior. * **Type**: `string` * **Default**: No fixed default * **Importance**: Not declared * **Valid values / Notes**: The property is passed to the driver after removing the `database.` or `driver.` prefix. If the same property is supplied under both prefixes, the `driver.` value takes precedence. Connector connection parameters listed separately still follow their own semantics; do not use pass-through properties to bypass database selection. A property accepted by the driver does not mean that every authentication method or optional dependency is available. TLS properties include `encrypt`, `trustServerCertificate`, `trustStore`, `trustStorePassword`, `trustStoreType`, and `hostNameInCertificate`. Unless overridden, the driver defaults to `encrypt=True` and `trustServerCertificate=false`. These are driver defaults, not ConfigDef defaults for this pass-through family. Encryption does not replace identity validation. If the certificate chain is untrusted or the name does not match, correct the certificate and trust configuration instead of disabling encryption or bypassing validation. Set other JDBC properties according to the driver's property names, values, and dependency requirements; do not treat the driver's complete property catalog as a static Connector configuration list. #### `driver.*` Passes properties to the JDBC driver under a separate prefix. * **Type**: `string` * **Default**: No fixed default * **Importance**: Not declared * **Valid values / Notes**: Replace `*` with the actual JDBC property name. The property is passed to the driver after removing the `driver.` prefix and takes precedence over a same-named driver property under `database.`. Property availability, driver defaults, and optional authentication dependencies follow the same boundaries as the preceding pass-through family. ### Topics and Synchronization Scope #### `topic.prefix` Provides an identifier and namespace for the source server and its event topics. * **Type**: `string` * **Default**: None (`null`) * **Importance**: High * **Valid values / Notes**: Required. Use letters, numbers, hyphens, periods, and underscores, and keep the value unique. Changing it after deployment changes the topic and source partition identity and is not a transparent rename. #### `topic.naming.strategy` Determines the naming strategy for data, schema change, transaction, and heartbeat topics. * **Type**: `class` * **Default**: `io.debezium.schema.SchemaTopicNamingStrategy` * **Importance**: Medium * **Valid values / Notes**: A custom implementation must be loadable from the plugin class path. Default data topic names contain the database, schema, and table names. #### `table.include.list` Limits capture to selected business tables. * **Type**: `list` * **Default**: None (`null`) * **Importance**: High * **Valid values / Notes**: A comma-separated list of fully qualified name regular expressions. SQL Server table filtering uses `schema.table`, and periods must be escaped. Do not set it together with `table.exclude.list`. A match does not automatically enable CDC for the table. #### `table.exclude.list` Excludes tables that do not need to be captured. * **Type**: `list` * **Default**: None (`null`) * **Importance**: Medium * **Valid values / Notes**: A comma-separated list of `schema.table` regular expressions. Mutually exclusive with `table.include.list`. #### `table.ignore.builtin` Controls whether built-in tables are ignored. * **Type**: `boolean` * **Default**: `true` * **Importance**: Low * **Valid values / Notes**: `true` / `false`. This does not change external system restrictions on CDC base tables. #### `column.include.list` Selects the columns retained in event values. * **Type**: `list` * **Default**: None (`null`) * **Importance**: Medium * **Valid values / Notes**: A comma-separated list of `schema.table.column` regular expressions. Mutually exclusive with `column.exclude.list`. Message keys are formed separately, so column filtering does not filter fields in the key. #### `column.exclude.list` Excludes columns from event values. * **Type**: `list` * **Default**: None (`null`) * **Importance**: Medium * **Valid values / Notes**: A comma-separated list of fully qualified column name regular expressions. Mutually exclusive with `column.include.list`; this setting alone cannot guarantee that sensitive fields do not appear in the message key. #### `skip.messages.without.change` Skips message publication when none of the included columns changed. * **Type**: `boolean` * **Default**: `false` * **Importance**: Medium * **Valid values / Notes**: `true` / `false`. Interpret its behavior together with column filtering; it is not an arbitrary row predicate. #### `skipped.operations` Selects operation types to skip during streaming. * **Type**: `list` * **Default**: `t` * **Importance**: Low * **Valid values / Notes**: `c`, `u`, `d`, `t`, or `none`, meaning create, update, delete, truncate, or skip none, respectively. The presence of the `t` option does not mean that SQL Server CDC can produce TRUNCATE events. Skipping business operations leaves downstream state incomplete. ### Initial Snapshot #### `snapshot.mode` Determines how existing data is baselined at startup and how incremental reading begins. * **Type**: `string` * **Default**: `initial` * **Importance**: Low * **Valid values / Notes**: `initial` takes a snapshot when no Offset exists and then begins streaming. `initial_only` only takes a snapshot. `always` takes a snapshot on every start. `no_data` captures only the schema before streaming. `schema_only` is a deprecated alias for `no_data`. `when_needed` decides whether to take a snapshot based on conditions such as a missing or unavailable position, but does not guarantee automatic recovery from every CDC cleanup scenario. `recovery` rebuilds schema history and should be considered only under safe conditions, such as no relevant schema changes while the Connector was stopped; it cannot recover historical events that have been cleaned up. `configuration_based` is controlled by the switches below. `custom` requires a custom Snapshotter. #### `snapshot.isolation.mode` Determines the snapshot isolation level and its concurrency effects. * **Type**: `string` * **Default**: `repeatable_read` * **Importance**: Low * **Valid values / Notes**: `repeatable_read`, `exclusive`, `snapshot`, `read_committed`, or `read_uncommitted`. Weaker isolation does not guarantee a consistent snapshot. `snapshot` requires `ALLOW_SNAPSHOT_ISOLATION` to be enabled on the database. Locking mode and lock timeout affect locking behavior. When `database.applicationIntent` is exactly `ReadOnly`, the implementation uses `snapshot` isolation. #### `snapshot.lock.timeout.ms` The maximum time to wait for table locks when a snapshot starts, in milliseconds. * **Type**: `long` * **Default**: `10000` * **Importance**: Medium * **Valid values / Notes**: A lock acquisition timeout terminates that snapshot attempt. Check concurrent source database load before adjusting it. #### `snapshot.locking.mode` Controls locks during the schema-reading phase for snapshot isolation modes that require locking. * **Type**: `string` * **Default**: `exclusive` (the default defined by the public runtime parameter) * **Importance**: Low * **Valid values / Notes**: `exclusive`, `none`, or `custom`. Applies to the `repeatable_read` and `exclusive` isolation modes. Consider `none` only under safe conditions, such as no schema changes during the snapshot; it does not guarantee that every snapshot phase is lock-free. `custom` requires a corresponding lock implementation. #### `snapshot.locking.mode.custom.name` Selects a custom snapshot lock implementation. * **Type**: `string` * **Default**: None (`null`) * **Importance**: Medium * **Valid values / Notes**: Required when `snapshot.locking.mode=custom`. The implementation must be loadable and expose the matching name. #### `snapshot.delay.ms` The delay before a snapshot starts after startup, in milliseconds. * **Type**: `long` * **Default**: `0` * **Importance**: Low * **Valid values / Notes**: A non-negative integer. This is not the streaming read interval. #### `snapshot.fetch.size` The number of records read into memory at a time during a snapshot. * **Type**: `int` * **Default**: None (`null`) * **Importance**: Medium * **Valid values / Notes**: A non-negative integer. When unset, implementation and JDBC fetch behavior applies; do not treat a batch size used in an example as the default. #### `snapshot.max.threads` The maximum number of threads used to execute a snapshot. * **Type**: `int` * **Default**: `1` * **Importance**: Medium * **Valid values / Notes**: A positive integer. The snapshot thread count is distinct from the number of Connect Tasks. Increasing it increases database load. #### `snapshot.include.collection.list` Limits the data collections read by the snapshot. * **Type**: `list` * **Default**: None (`null`) * **Importance**: Medium * **Valid values / Notes**: A list of fully qualified collection name regular expressions within the existing capture scope. It does not replace table filtering during streaming. #### `snapshot.select.statement.overrides` Declares tables whose snapshot SELECT statements are overridden. * **Type**: `string` * **Default**: None (`null`) * **Importance**: Medium * **Valid values / Notes**: A comma-separated list of table identifiers. SQL Server uses `..
`; also provide the corresponding dynamic SQL properties. A WHERE clause affects only the snapshot and is not a continuous row-level filter. #### `snapshot.select.statement.overrides.` Specifies the snapshot SELECT statement for a declared table. * **Type**: `string` * **Default**: None * **Importance**: Not declared * **Valid values / Notes**: Replace `` with `..
` and list it in `snapshot.select.statement.overrides`. The returned columns must satisfy the table schema and event conversion requirements. #### `snapshot.tables.order.by.row.count` Orders initial snapshot tables by row count. * **Type**: `string` * **Default**: `disabled` * **Importance**: Medium * **Valid values / Notes**: `disabled`, `ascending`, or `descending`. This does not change the synchronization scope. #### `snapshot.query.mode` Selects how snapshot queries are generated. * **Type**: `string` * **Default**: `select_all` * **Importance**: Low * **Valid values / Notes**: `select_all` or `custom`. The custom mode requires a query provider. #### `snapshot.query.mode.custom.name` Selects a custom snapshot query implementation. * **Type**: `string` * **Default**: None (`null`) * **Importance**: Medium * **Valid values / Notes**: When `snapshot.query.mode=custom`, supply the matching implementation name. The class and its dependencies must be loadable. #### `snapshot.mode.custom.name` Selects a custom Snapshotter. * **Type**: `string` * **Default**: None (`null`) * **Importance**: Medium * **Valid values / Notes**: Required when `snapshot.mode=custom` and must match the implementation's `name()`. #### `snapshot.mode.configuration.based.snapshot.data` Controls whether the configuration-based snapshot mode reads table data. * **Type**: `boolean` * **Default**: `false` * **Importance**: Medium * **Valid values / Notes**: Applies only when `snapshot.mode=configuration_based`. #### `snapshot.mode.configuration.based.snapshot.schema` Controls whether the configuration-based snapshot mode reads table schemas. * **Type**: `boolean` * **Default**: `false` * **Importance**: Medium * **Valid values / Notes**: Applies only when `snapshot.mode=configuration_based`. Coordinate it with data reading and history recovery requirements. #### `snapshot.mode.configuration.based.start.stream` Controls whether the configuration-based snapshot mode begins streaming after the snapshot. * **Type**: `boolean` * **Default**: `false` * **Importance**: Medium * **Valid values / Notes**: Applies only when `snapshot.mode=configuration_based`. #### `snapshot.mode.configuration.based.snapshot.on.data.error` Controls whether the configuration-based snapshot mode takes a new snapshot after a data position error. * **Type**: `boolean` * **Default**: `false` * **Importance**: Medium * **Valid values / Notes**: Applies only when `snapshot.mode=configuration_based`. Taking a new snapshot cannot restore the complete history of changes that have already been cleaned up. #### `snapshot.mode.configuration.based.snapshot.on.schema.error` Controls whether the configuration-based snapshot mode takes a new snapshot after a schema history error. * **Type**: `boolean` * **Default**: `false` * **Importance**: Medium * **Valid values / Notes**: Applies only when `snapshot.mode=configuration_based`. Verify that schema changes and retained positions are compatible. ### Incremental Snapshots and Signals #### `incremental.snapshot.chunk.size` The number of rows in each incremental snapshot chunk. * **Type**: `int` * **Default**: `1024` * **Importance**: Medium * **Valid values / Notes**: The definition accepts non-negative integers. Actual chunking requires a size that allows progress; evaluate it together with row size and database load. #### `incremental.snapshot.allow.schema.changes` Controls handling of schema changes during an incremental snapshot. * **Type**: `boolean` * **Default**: `false` * **Importance**: Low * **Valid values / Notes**: This switch does not replace CDC capture instance maintenance. Do not infer that arbitrary concurrent SQL Server DDL is safe, especially primary key changes during an incremental snapshot. #### `incremental.snapshot.option.recompile` Adds `OPTION(RECOMPILE)` to incremental snapshot SELECT statements. * **Type**: `boolean` * **Default**: `false` * **Importance**: Low * **Valid values / Notes**: This can avoid parameter-sniffing effects, but increases compilation and CPU load on the source database. #### `incremental.snapshot.watermarking.strategy` Controls how watermark signals for incremental snapshot windows are written. * **Type**: `string` * **Default**: `INSERT_INSERT` (corresponding configuration value: `insert_insert`) * **Importance**: Low * **Valid values / Notes**: `insert_insert` writes both opening and closing signals. `insert_delete` writes an opening signal and deletes the corresponding signal when closing. A signal data collection and corresponding write permissions are required. #### `signal.data.collection` The fully qualified name of the source signal table. * **Type**: `string` * **Default**: None (`null`) * **Importance**: Medium * **Valid values / Notes**: SQL Server uses `..
`. The source signal flow requires the prescribed schema, CDC, and corresponding access permissions. This source signal entry point is not enabled when the setting is absent. #### `signal.enabled.channels` The enabled signal channels. * **Type**: `list` * **Default**: `source` * **Importance**: Medium * **Valid values / Notes**: Select from available channels such as `source`, `kafka`, `file`, and `jmx`. Each selected channel requires its supporting resources and parameters. #### `signal.poll.interval.ms` The interval for checking registered signal channels, in milliseconds. * **Type**: `long` * **Default**: `5000` * **Importance**: Medium * **Valid values / Notes**: A positive integer. This is distinct from the business CDC polling interval. #### `signal.file` The file read by the file signal channel. * **Type**: `string` * **Default**: None (`null`) * **Importance**: High * **Valid values / Notes**: Required when the `file` channel is enabled. The Worker running the Task must be able to access it. #### `signal.kafka.bootstrap.servers` The cluster addresses for the Kafka signal channel. * **Type**: `string` * **Default**: None (`null`) * **Importance**: High * **Valid values / Notes**: Required when the `kafka` channel is enabled. It must point to the Kafka cluster used by Connect. #### `signal.kafka.topic` The topic read by the Kafka signal channel. * **Type**: `string` * **Default**: None (`null`) * **Importance**: High * **Valid values / Notes**: Required when the `kafka` channel is enabled. Prepare consume permissions. #### `signal.kafka.groupId` The group identifier for the Kafka signal consumer. * **Type**: `string` * **Default**: `kafka-signal` * **Importance**: Low * **Valid values / Notes**: Preserve the uppercase `I` in the property name. Coordinate group isolation with the signal delivery method. #### `signal.kafka.poll.timeout.ms` The timeout for a single Kafka signal poll, in milliseconds. * **Type**: `int` * **Default**: `0` * **Importance**: Low * **Valid values / Notes**: A non-negative integer. Applies only to the Kafka signal channel. #### `signal.consumer.*` Passes consumer properties through to the Kafka signal channel. * **Type**: `string` * **Default**: No fixed default * **Importance**: Not declared * **Valid values / Notes**: The property is passed to the Kafka client after removing the prefix and can be used for signal consumer authentication. It is not equivalent to all Worker consumer settings. ### Read Batches and Memory #### `max.batch.size` The maximum batch of records returned to Connect at a time. * **Type**: `int` * **Default**: `2048` * **Importance**: Medium * **Valid values / Notes**: A positive integer smaller than `max.queue.size`. #### `max.queue.size` The capacity of the queue holding change events waiting to be sent. * **Type**: `int` * **Default**: `8192` * **Importance**: Medium * **Valid values / Notes**: Must be greater than `max.batch.size`. A full queue creates backpressure; it is not an unlimited buffer. #### `max.queue.size.in.bytes` The byte capacity limit for the queue holding events waiting to be sent. * **Type**: `long` * **Default**: `0` * **Importance**: Medium * **Valid values / Notes**: A non-negative integer. `0` disables this byte limit, while the event count limit still applies. #### `max.iteration.transactions` Controls the number of transactions included in each CDC query iteration and constrains memory requirements for multi-table streaming. * **Type**: `int` * **Default**: `500` * **Importance**: Medium * **Valid values / Notes**: A non-negative integer. It is not a row count or Kafka message batch size; evaluate it together with transaction sizes. #### `query.fetch.size` The number of records read into memory in each JDBC query batch. * **Type**: `int` * **Default**: `10000` (the default defined by the public SQL Server runtime parameter) * **Importance**: Medium * **Valid values / Notes**: `0` delegates to the JDBC default fetch behavior. This is distinct from the per-table read limit set by `streaming.fetch.size`. #### `streaming.fetch.size` The maximum number of rows read from each table at a time during streaming. * **Type**: `int` * **Default**: `0` * **Importance**: Low * **Valid values / Notes**: `0` means unlimited. A nonzero value affects per-table batching and must not be treated as a transaction boundary. #### `poll.interval.ms` The time to wait before the next poll when no new change events are available, in milliseconds. * **Type**: `long` * **Default**: `500` * **Importance**: Medium * **Valid values / Notes**: A positive integer. More frequent polling increases query overhead. #### `streaming.delay.ms` The delay before entering the streaming phase after a snapshot completes, in milliseconds. * **Type**: `long` * **Default**: `0` * **Importance**: Low * **Valid values / Notes**: A non-negative integer. Required CDC data must remain retained during the delay. #### `executor.shutdown.timeout.ms` The maximum time to wait for the Task executor to shut down, in milliseconds. * **Type**: `long` * **Default**: `4000` * **Importance**: Medium * **Valid values / Notes**: A positive integer. This does not replace Offset and history persistence. ### Message Keys, Types, and Fields #### `message.key.columns` Specifies message key columns for matching tables. * **Type**: `string` * **Default**: None (`null`) * **Importance**: Medium * **Valid values / Notes**: A semicolon-separated list in the form `:,`. SQL Server table matching uses `schema.table`. Tables not overridden use their primary keys. A custom key does not create a unique constraint in the database; you must ensure that it is stable and unique. #### `tombstones.on.delete` Controls whether a same-key, null-value tombstone is sent after a DELETE event. * **Type**: `boolean` * **Default**: `true` * **Importance**: Medium * **Valid values / Notes**: When disabled, the delete event is still sent but no subsequent tombstone is produced. Consumers must distinguish between the two. #### `decimal.handling.mode` Controls the event representation of DECIMAL and NUMERIC values. * **Type**: `string` * **Default**: `precise` * **Importance**: Medium * **Valid values / Notes**: `precise` uses the precise Connect Decimal representation, `string` uses strings, and `double` can lose precision. money and smallmoney also use the decimal conversion path. #### `binary.handling.mode` Controls the event representation of binary columns. * **Type**: `string` * **Default**: `bytes` * **Importance**: Low * **Valid values / Notes**: `bytes`, `base64`, `base64-url-safe`, or `hex`. Keep it consistent with the downstream deserialization contract. #### `time.precision.mode` Controls the precision used to represent dates, times, and timestamps. * **Type**: `string` * **Default**: `adaptive` * **Importance**: Medium * **Valid values / Notes**: `adaptive`, `adaptive_time_microseconds`, `isostring`, `microseconds`, `nanoseconds`, or `connect`. `connect` uses Connect millisecond precision. Other modes must be interpreted together with the actual column type and conversion path; do not assume that every SQL Server type produces the same representation. #### `schema.name.adjustment.mode` Adjusts message Schema names for Converter compatibility. * **Type**: `string` * **Default**: `none` * **Importance**: Low * **Valid values / Notes**: `none`, `avro`, or `avro_unicode`. The latter two replace invalid characters or apply Unicode escaping, respectively. #### `field.name.adjustment.mode` Adjusts message field names for Converter compatibility. * **Type**: `string` * **Default**: `none` * **Importance**: Low * **Valid values / Notes**: `none`, `avro`, or `avro_unicode`. Name adjustment can affect downstream field mappings. #### `column.propagate.source.type` Adds source type and length information to the field Schema for matching columns. * **Type**: `list` * **Default**: None (`null`) * **Importance**: Medium * **Valid values / Notes**: A list of fully qualified column name regular expressions. This does not change the column value representation. #### `datatype.propagate.source.type` Selects fields for which original type information is propagated by matching source data type names. * **Type**: `list` * **Default**: None (`null`) * **Importance**: Medium * **Valid values / Notes**: A list of regular expressions for native database type names. This differs from matching by column name. #### `column.truncate.to..chars` Truncates matching string columns to the specified number of characters. * **Type**: The dynamic property value is a `string` (a list of column regular expressions) * **Default**: None (`null`) * **Importance**: Medium * **Valid values / Notes**: `N` is a non-negative integer in the property name, and the value is a comma-separated list of fully qualified column name regular expressions. The type metadata for the static pattern entry `column.truncate.to.(d+).chars` is `int`, but the pattern name must not be used as an actual configuration key; the value of a concrete numbered property is not the character count. #### `column.mask.with..chars` Replaces matching column content with a mask containing the specified number of asterisks. * **Type**: `string` * **Default**: None (`null`) * **Importance**: Medium * **Valid values / Notes**: `N` is a non-negative integer, and the value is a list of fully qualified column name regular expressions. The static pattern name `column.mask.with.(d+).chars` is not used directly as a configuration key. Masking does not replace a security review of message key fields. #### `column.mask.hash..with.salt.` Replaces matching column content with a salted hash. * **Type**: `string` * **Default**: None (`null`) * **Importance**: Medium * **Valid values / Notes**: Corresponds to the pattern entry `column.mask.hash.([^.]+).with.salt.(.+)`. Replace the algorithm and salt with actual names and values; the property value is a list of column regular expressions. The algorithm must be supported by the JVM, and the salt must be managed securely. #### `column.mask.hash.v2..with.salt.` Uses the v2 salted hash mapping for matching columns. * **Type**: `string` * **Default**: None * **Importance**: Not declared * **Valid values / Notes**: The value is a list of fully qualified column name regular expressions, and the algorithm must be supported by the JVM. The resulting downstream identifiers are not unconditionally interchangeable with those produced by the original hash method. #### `unavailable.value.placeholder` Marks original column values that the source did not provide. * **Type**: `string` * **Default**: `__debezium_unavailable_value` * **Importance**: Medium * **Valid values / Notes**: Distinguish it from actual business values and `null`; downstream systems must not treat the placeholder as real content. #### `include.schema.changes` Controls whether schema messages are published to the schema change topic. * **Type**: `boolean` * **Default**: `true` * **Importance**: Medium * **Valid values / Notes**: The default topic name is `topic.prefix`. This is independent of internal schema history and does not automatically refresh SQL Server CDC capture instances. #### `include.schema.comments` Controls whether table and column comments are included in schema metadata. * **Type**: `boolean` * **Default**: `false` * **Importance**: Medium * **Valid values / Notes**: Enabling it increases the memory footprint of schema metadata. #### `provide.transaction.metadata` Controls whether transaction metadata and event counts are generated. * **Type**: `boolean` * **Default**: `false` * **Importance**: Low * **Valid values / Notes**: This does not provide global ordering across databases or partitions and is not equivalent to end-to-end exactly-once delivery. #### `transaction.metadata.factory` The factory class that creates transaction context and transaction message structures. * **Type**: `class` * **Default**: `io.debezium.pipeline.txmetadata.DefaultTransactionMetadataFactory` * **Importance**: Low * **Valid values / Notes**: A custom class and its dependencies must be loadable from the plugin class path. #### `sourceinfo.struct.maker` The implementation class that creates the event `source` structure. * **Type**: `class` * **Default**: `io.debezium.connector.sqlserver.SqlServerSourceInfoStructMaker` * **Importance**: Low * **Valid values / Notes**: A custom implementation can change source position fields used by downstream systems. Keep the consumption contract compatible. #### `extended.headers.enabled` Controls whether Debezium context headers are added to messages. * **Type**: `boolean` * **Default**: `true` * **Importance**: Low * **Valid values / Notes**: The headers carry source context and do not replace business fields in the message value. ### Schema History and Recovery #### `schema.history.internal` The implementation that stores and restores database schema history. * **Type**: `class` * **Default**: `io.debezium.storage.kafka.history.KafkaSchemaHistory` * **Importance**: Low * **Valid values / Notes**: The implementation class and its dependencies must be loadable, and storage properties for the implementation must be configured. #### `schema.history.internal.kafka.bootstrap.servers` The cluster addresses used by the Kafka schema history client. * **Type**: `string` * **Default**: None (`null`) * **Importance**: High * **Valid values / Notes**: Required for the default Kafka history implementation. Use a `host:port` list for the Kafka cluster used by Connect. #### `schema.history.internal.kafka.topic` The topic that stores internal schema history. * **Type**: `string` * **Default**: None (`null`) * **Importance**: High * **Valid values / Notes**: Required for the default Kafka history implementation. Keep it single-partitioned, retain the complete history indefinitely, and do not share it with other independent Connectors. This requirement does not limit the partition count of business data topics. #### `schema.history.internal.kafka.create.timeout.ms` The timeout for creating the history topic, in milliseconds. * **Type**: `long` * **Default**: `30000` * **Importance**: Low * **Valid values / Notes**: A positive integer. Applies only to the Kafka history implementation. #### `schema.history.internal.kafka.query.timeout.ms` The timeout for querying Kafka cluster information, in milliseconds. * **Type**: `long` * **Default**: `3000` * **Importance**: Low * **Valid values / Notes**: A positive integer. Applies only to the Kafka history implementation. #### `schema.history.internal.kafka.recovery.attempts` The number of consecutive polls that return no records during history recovery. * **Type**: `int` * **Default**: `100` * **Importance**: Low * **Valid values / Notes**: Together with the recovery polling interval, this determines how long recovery waits when no records are available. It is not the number of database connection retries. #### `schema.history.internal.kafka.recovery.poll.interval.ms` The polling interval for recovering history data, in milliseconds. * **Type**: `int` * **Default**: `100` * **Importance**: Low * **Valid values / Notes**: A non-negative integer. Applies only to the Kafka history implementation. #### `schema.history.internal.file.filename` The file path for file-based schema history storage. * **Type**: `string` * **Default**: None (`null`) * **Importance**: Medium * **Valid values / Notes**: Required when using `io.debezium.storage.file.history.FileSchemaHistory`. The file must persist, and its accessibility after the Task is scheduled to another Worker must be considered. #### `schema.history.internal.skip.unparseable.ddl` Controls whether unparseable DDL is skipped during history processing. * **Type**: `boolean` * **Default**: `false` * **Importance**: Low * **Valid values / Notes**: Skipping can lose schema metadata. This general history option does not mean that every DDL operation in a SQL Server stream can be processed automatically. #### `schema.history.internal.store.only.captured.databases.ddl` Stores schema history only for captured databases. * **Type**: `boolean` * **Default**: `false` * **Importance**: Low * **Valid values / Notes**: Narrowing the history scope can affect recovery preparation when synchronization scope is expanded later. #### `schema.history.internal.store.only.captured.tables.ddl` Stores schema history only for captured tables. * **Type**: `boolean` * **Default**: `false` * **Importance**: Low * **Valid values / Notes**: Verify history completeness before adding new tables later; changing the filter alone does not backfill existing data. #### `schema.history.internal.producer.*` Passes properties through to the Kafka history producer client. * **Type**: `string` * **Default**: No fixed default * **Importance**: Not declared * **Valid values / Notes**: The property is passed to the Kafka client after removing the prefix and can provide secure connection settings. It is not equivalent to business message producer configuration. #### `schema.history.internal.consumer.*` Passes properties through to the Kafka history recovery consumer client. * **Type**: `string` * **Default**: No fixed default * **Importance**: Not declared * **Valid values / Notes**: The property is passed to the Kafka client after removing the prefix. Coordinate authentication with the history producer; do not assume that all Worker authentication settings are inherited. ### Heartbeats and Error Handling #### `heartbeat.interval.ms` The interval for sending heartbeat messages, in milliseconds. * **Type**: `int` * **Default**: `0` * **Importance**: Medium * **Valid values / Notes**: A non-negative integer. `0` disables heartbeats. Heartbeats alone cannot guarantee that the recovery position remains within the CDC retention window. #### `heartbeat.topics.prefix` The naming prefix for heartbeat topics. * **Type**: `string` * **Default**: `__debezium-heartbeat` * **Importance**: Low * **Valid values / Notes**: Corresponding messages are produced only when heartbeats are enabled. This is not the business table topic prefix. #### `heartbeat.action.query` The database query executed for each heartbeat. * **Type**: `string` * **Default**: None (`null`) * **Importance**: Low * **Valid values / Notes**: The account must have permission to execute the query. Evaluate its write behavior and effect on source database load. #### `errors.max.retries` The retry budget for retriable Connector errors. * **Type**: `int` * **Default**: `-1` * **Importance**: Low * **Valid values / Notes**: `-1` means unlimited retries, `0` means no retries, and a positive value is the limit. Not every initialization, conversion, or Kafka write error is handled by this setting. Permission and configuration errors cannot heal through retries. #### `retriable.restart.connector.wait.ms` The wait time before restart after a retriable exception, in milliseconds. * **Type**: `long` * **Default**: `10000` * **Importance**: Low * **Valid values / Notes**: A positive integer. Evaluate long outage risks together with the CDC retention period. #### `event.processing.failure.handling.mode` Controls how corrupt or unprocessable events are handled. * **Type**: `string` * **Default**: `fail` * **Importance**: Medium * **Valid values / Notes**: `fail` stops processing. `warn` logs and skips the event. `ignore` / `skip` skips it. Skipping loses the corresponding event and is not equivalent to lossless fault tolerance. #### `event.converting.failure.handling.mode` Controls how column value conversion failures are handled. * **Type**: `string` * **Default**: `warn` * **Importance**: Medium * **Valid values / Notes**: `fail` throws an exception. `warn` sets the failed column to null and logs a warning. `skip` sets the failed column to null and logs at debug level. Do not interpret `skip` here as meaning that the complete event is necessarily discarded. ### Extension Processing and Notifications #### `converters` The alias list for Debezium custom type converters. * **Type**: `string` * **Default**: None (`null`) * **Importance**: Low * **Valid values / Notes**: Provide `.type` for each alias. These are distinct from Kafka Connect's `key.converter` and `value.converter`. #### `.type` Specifies the Debezium custom converter class. * **Type**: `class` * **Default**: None * **Importance**: Not declared * **Valid values / Notes**: The alias must be listed in `converters`, and the implementation and its dependencies must be on the plugin class path. #### `.
`. Record values use the Debezium change-event structure, and record keys can retain the complete partition and clustering keys. The Connector continuously reads only the Scylla CDC log and does not take an initial snapshot of the base table. It is suitable for feeding incremental changes from tables such as orders, accounts, and device states into event streams, cache updates, search indexes, or audit pipelines. New deployments should explicitly use the `advanced` output format to obtain direct field values, complex types, and configurable before and after images. The default `legacy` format is deprecated. ## Prerequisites * Before capture begins, the target Scylla tables must exist and have CDC enabled. The Quick Start and other basic examples in this document use `cdc.include.after=only-updated`, so the target tables must also have CDC postimage enabled. If a `before` image is required, CDC preimage must also be enabled. The CDC log retention period should cover the expected outage and recovery window. * The Scylla account used by the Connector must have permission to read the target keyspaces, tables, CDC logs, and related metadata. When TLS is enabled, the certificates, truststore, keystore, or private key files must be readable by the Connect Worker. ## License Uses Apache License 2.0. ## Quick Start Prepare a Connect Cluster, Kafka, and a CDC-enabled Scylla table. Confirm that the Connect Worker can access Scylla and Kafka and has the required permissions. For preparation and management procedures, see [Manage Connectors](../manage-connectors). ```properties theme={null} connector.class=com.scylladb.cdc.debezium.connector.ScyllaConnector scylla.cluster.ip.addresses=:9042 scylla.table.names=.
topic.prefix=scylla scylla.ssl.enabled=false cdc.output.format=advanced cdc.include.primary-key.placement=kafka-key,payload-after,payload-before cdc.include.after=only-updated key.converter=org.apache.kafka.connect.json.JsonConverter value.converter=org.apache.kafka.connect.json.JsonConverter ``` Replace ``, ``, and `
` with the actual resources, and enable CDC postimage on the target table before starting the Connector. If authentication is enabled in Scylla, also add `scylla.user` and `scylla.password`. TLS should normally also be enabled in production. With this configuration, the `after` field for an INSERT contains the complete new row, while the `after` field for an UPDATE contains the primary key and the columns that actually changed. A DELETE is identified by `op=d` and the Kafka key. The example reads only changes that occur after startup or can be recovered from the CDC log; it does not emit existing rows from the base table. ## Configuration ### Connector Identity and Source Tables #### `connector.class` Specifies the Connector implementation class. * **Type**: `string` * **Default**: None * **Importance**: High * **Valid values / Notes**: Must be set to `com.scylladb.cdc.debezium.connector.ScyllaConnector`. * **Required**: Yes #### `scylla.table.names` Specifies the Scylla tables to read. * **Type**: `list` * **Default**: `null` * **Importance**: High * **Valid values / Notes**: Required. Use comma-separated `keyspace.table` names. Unquoted keyspace and table names may contain only 1 to 48 ASCII letters, digits, or underscores. Quoted identifiers are not supported. CDC must be enabled on every table. A missing table does not cause validation to fail; the Connector waits for it to appear. * **Required**: Yes #### `topic.prefix` Sets the namespace prefix for data topics and heartbeat topics. * **Type**: `string` * **Default**: `null` * **Importance**: High * **Valid values / Notes**: Required, and should be unique across Connector instances. The default naming strategy uses this prefix to generate `..
`. * **Required**: Yes #### `topic.naming.strategy` Specifies the Debezium topic naming strategy implementation. * **Type**: `class` * **Default**: `io.debezium.schema.SchemaTopicNamingStrategy` * **Importance**: Medium * **Valid values / Notes**: A custom class must implement the Debezium `TopicNamingStrategy`. Together with `topic.prefix` and `heartbeat.topics.prefix`, it determines topic names. ### Scylla Connection and Authentication #### `scylla.cluster.ip.addresses` Specifies the Scylla CQL contact points. * **Type**: `list` * **Default**: `null` * **Importance**: High * **Valid values / Notes**: Required. Use comma-separated `host:port` entries. Every entry must explicitly provide a numeric port and be reachable from the Worker. The current parser does not support IPv6 literals that contain colons. * **Required**: Yes #### `scylla.local.dc` Specifies the local data center to prefer. * **Type**: `string` * **Default**: `null` * **Importance**: Low * **Valid values / Notes**: The name must match the Scylla cluster topology metadata. When omitted, the driver makes the selection. #### `scylla.user` Specifies the CQL username. * **Type**: `string` * **Default**: `null` * **Importance**: High * **Valid values / Notes**: When omitted, an unauthenticated connection is used. When set, `scylla.password` must also be set. #### `scylla.password` Specifies the CQL password. * **Type**: `password` * **Default**: `null` * **Importance**: High * **Valid values / Notes**: When set, `scylla.user` must also be set. Supply it through a controlled secret or Config Provider; do not write it to ordinary configuration files or logs. #### `scylla.consistency.level` Sets the consistency level used when reading the CDC log. * **Type**: `string` * **Default**: `quorum` * **Importance**: Medium * **Valid values / Notes**: Use a consistency level supported by the underlying Scylla CDC driver. This value affects only CDC log queries. #### `scylla.query.options.fetch.size` Sets the CQL query page size. * **Type**: `int` * **Default**: `0` * **Importance**: Low * **Valid values / Notes**: Must be a non-negative integer. `0` uses the driver default, and a positive value sets the number of rows read per page. ### TLS #### `scylla.ssl.enabled` Controls whether TLS connections to Scylla are enabled. * **Type**: `boolean` * **Default**: `null` * **Importance**: High * **Valid values / Notes**: Should be explicitly set to `true` or `false`. Other TLS settings are read only when this is set to `true`. #### `scylla.ssl.provider` Selects the TLS implementation provider. * **Type**: `string` * **Default**: `jdk` * **Importance**: Low * **Valid values / Notes**: Valid values are `jdk`, `openssl`, or `openssl_refcnt`. This setting takes effect only when `scylla.ssl.enabled=true`. #### `scylla.ssl.truststore.path` Specifies the path to the Java truststore file. * **Type**: `string` * **Default**: `null` * **Importance**: Medium * **Valid values / Notes**: Used only for TLS. The file must exist and be readable by the Worker. The Connector does not validate the path in advance. #### `scylla.ssl.truststore.password` Specifies the Java truststore password. * **Type**: `string` * **Default**: `null` * **Importance**: Medium * **Valid values / Notes**: Used with `scylla.ssl.truststore.path`. Although its ConfigDef type is `string`, it should still be managed as a secret. #### `scylla.ssl.keystore.path` Specifies the path to the Java keystore file. * **Type**: `string` * **Default**: `null` * **Importance**: Medium * **Valid values / Notes**: Used for TLS connections that require a client certificate. The file must be readable by the Worker. The Connector does not validate the path in advance. #### `scylla.ssl.keystore.password` Specifies the Java keystore password. * **Type**: `string` * **Default**: `null` * **Importance**: Medium * **Valid values / Notes**: Used with `scylla.ssl.keystore.path`. Although its ConfigDef type is `string`, it should still be managed as a secret. #### `scylla.ssl.cipherSuites` Restricts the TLS cipher suites. * **Type**: `list` * **Default**: `null` * **Importance**: High * **Valid values / Notes**: Takes effect only with TLS. When omitted, the defaults of the selected TLS Provider are used. Explicit values must be supported by the Provider. #### `scylla.ssl.openssl.keyCertChain` Specifies the path to the OpenSSL client certificate chain. * **Type**: `string` * **Default**: `null` * **Importance**: High * **Valid values / Notes**: Used only with an OpenSSL Provider. The file must be readable by the Worker and should match `scylla.ssl.openssl.privateKey`. #### `scylla.ssl.openssl.privateKey` Specifies the path to the OpenSSL client private key. * **Type**: `string` * **Default**: `null` * **Importance**: High * **Valid values / Notes**: Used only with an OpenSSL Provider. Restrict the file permissions and ensure that the Worker can read the file. The Connector does not validate the path or the certificate and key pairing. ### Startup, Read Windows, and Buffering #### `scylla.initial.lookback.ms` Sets the lookback period for the initial read when no stored offset exists. * **Type**: `long` * **Default**: `0` * **Importance**: Medium * **Valid values / Notes**: Must be non-negative. `0` reads from the starting window of the first CDC Generation. A positive value looks back by the specified duration from the current time. It takes effect only for a specific task that has no stored offset and cannot recover data older than the CDC retention period. #### `streaming.delay.ms` Sets the delay before streaming begins. * **Type**: `long` * **Default**: `0` * **Importance**: Low * **Valid values / Notes**: Must be non-negative. The Scylla snapshot phase does not read data, so this should normally remain `0`. #### `scylla.query.time.window.size` Sets the time window covered by each CDC query, in milliseconds. * **Type**: `int` * **Default**: `30000` * **Importance**: Low * **Valid values / Notes**: Must be a non-negative integer. A smaller window reduces the work of each query but increases the number of queries. It is also used to construct the initial lookback window. #### `scylla.confidence.window.size` Sets the safety window during which the latest CDC interval is not read, in milliseconds. * **Type**: `int` * **Default**: `30000` * **Importance**: Low * **Valid values / Notes**: Must be a non-negative integer. A larger value helps avoid the latest CDC data that has not yet stabilized, but increases end-to-end latency. `0` removes this delay. #### `scylla.minimal.wait.for.window.time` Sets the minimum wait between consecutive CDC query windows, in milliseconds. * **Type**: `int` * **Default**: `0` * **Importance**: Low * **Valid values / Notes**: Must be a non-negative integer. `0` applies no active rate limiting. A positive value can reduce query pressure during catch-up. #### `poll.interval.ms` Sets the interval for polling records from the internal change queue, in milliseconds. * **Type**: `long` * **Default**: `500` * **Importance**: Medium * **Valid values / Notes**: Must be non-negative. A smaller value can reduce response latency after an idle period, but increases polling frequency. #### `max.batch.size` Sets the maximum number of records returned by each Poll. * **Type**: `int` * **Default**: `2048` * **Importance**: Medium * **Valid values / Notes**: Must be a positive integer and should be less than `max.queue.size`. #### `max.queue.size` Sets the maximum number of records that the internal change queue can hold. * **Type**: `int` * **Default**: `8192` * **Importance**: Medium * **Valid values / Notes**: Must be a positive integer and should be greater than `max.batch.size` to retain buffer capacity. When the queue is full, backpressure is applied to the reader. #### `max.queue.size.in.bytes` Sets the queue limit in bytes. * **Type**: `long` * **Default**: `0` * **Importance**: Medium * **Valid values / Notes**: In 2.0.6, this public configuration is not connected to the Scylla queue construction logic and cannot be used to limit memory. Use `max.queue.size` to control the number of records. ### CDC Output #### `cdc.output.format` Selects the output format for CDC records. * **Type**: `string` * **Default**: `legacy` * **Importance**: High * **Valid values / Notes**: Valid values are `legacy` or `advanced`. `legacy` is deprecated and scheduled for removal in 3.0.0. New deployments should explicitly use `advanced` to support direct field values, complex types, and before and after images. * **Deprecation**: The default value `legacy` is deprecated. The replacement value is `advanced`. #### `experimental.preimages.enabled` Controls whether the Legacy format reads Preimage records. * **Type**: `boolean` * **Default**: `false` * **Importance**: Low * **Valid values / Notes**: Applies only to `legacy`. Setting it to `true` when `cdc.output.format=advanced` is rejected. For the Advanced format, use `cdc.include.before`. #### `cdc.include.before` Controls the before image in Advanced records. * **Type**: `string` * **Default**: `none` * **Importance**: Medium * **Valid values / Notes**: Valid values are `none`, `full`, or `only-updated`, and the setting applies only to `advanced`. `full` and `only-updated` require CDC preimage to be enabled on all existing target tables. #### `cdc.include.after` Controls the after image in Advanced records. * **Type**: `string` * **Default**: `none` * **Importance**: Medium * **Valid values / Notes**: Valid values are `none`, `full`, or `only-updated`, and the setting applies only to `advanced`. `full` and `only-updated` require CDC postimage to be enabled on all existing target tables. #### `cdc.include.primary-key.placement` Sets the locations of the primary key in output records. * **Type**: `list` * **Default**: `kafka-key,payload-after,payload-before` * **Importance**: Medium * **Valid values / Notes**: The Legacy format accepts only the default combination. The Advanced format can use `kafka-key`, `payload-after`, `payload-before`, `payload-key`, and `kafka-headers`. Although `payload-diff` passes validation, 2.0.6 does not implement its output. The ConfigDef default remains `kafka-key,payload-after,payload-before`, but when using the `advanced` format in 2.0.6, this combination must be set explicitly to generate a non-`null` structured Kafka key. Omitting the configuration may result in a required key schema with a `null` key value. Retain `kafka-key` when relying on key-based partitioning, ordering, or log compaction. #### `cdc.include.primary-key.payload-key-name` Sets the field name of the `payload-key` primary-key object. * **Type**: `string` * **Default**: `key` * **Importance**: Low * **Valid values / Notes**: Used only when the primary-key placement includes `payload-key`. Choose a non-empty name that does not conflict with other top-level fields. #### `cdc.incomplete.task.timeout.ms` Sets the timeout for waiting for an Advanced image combination, in milliseconds. * **Type**: `long` * **Default**: `15000` * **Importance**: Low * **Valid values / Notes**: Must be positive. A change that is still missing a required Preimage or Postimage after this period is logged as an error and discarded. Cleanup depends on subsequent events advancing and is not an exact timer. #### `tombstones.on.delete` Controls whether a Tombstone is emitted after a DELETE event. * **Type**: `boolean` * **Default**: `true` * **Importance**: Medium * **Valid values / Notes**: `true` emits a record with the same key and a null value after the delete event, allowing a log-compacted topic to remove the old value. Removing `kafka-key` prevents normal key-based compaction semantics. #### `skipped.operations` Specifies the Debezium operation types that are not emitted. * **Type**: `list` * **Default**: `t` * **Importance**: Low * **Valid values / Notes**: Valid values are `c`, `u`, `d`, `t`, or `none`. Truncate is skipped by default. This configuration cannot make the Connector support multi-row partition deletes or range deletes that cannot be converted into row events. #### `event.processing.failure.handling.mode` Sets the behavior when Debezium event processing fails. * **Type**: `string` * **Default**: `fail` * **Importance**: Medium * **Valid values / Notes**: Valid values are `fail`, `warn`, or `ignore`. `fail` stops the task. `warn` and `ignore` may skip problematic events and should be used only when data gaps are acceptable to the business. #### `transaction.metadata.factory` Specifies the Debezium transaction metadata factory. * **Type**: `class` * **Default**: `io.debezium.pipeline.txmetadata.DefaultTransactionMetadataFactory` * **Importance**: Low * **Valid values / Notes**: This is an advanced extension point. Version 2.0.6 does not expose a configuration that enables transaction metadata, so replacing this factory does not cause the Connector to produce transaction metadata. ### Retries and Error Recovery #### `retriable.restart.connector.wait.ms` Sets how long Debezium waits before restarting after a retriable exception, in milliseconds. * **Type**: `long` * **Default**: `10000` * **Importance**: Low * **Valid values / Notes**: Must be positive. This setting and the Scylla Worker retry parameters operate at different layers. #### `errors.max.retries` Sets the maximum number of retries for Debezium connection errors. * **Type**: `int` * **Default**: `-1` * **Importance**: Low * **Valid values / Notes**: `-1` means unlimited retries, `0` means no retry, and a positive value means a finite number of retries. Do not confuse it with `worker.max.retries`. #### `worker.retry.backoff.base` Sets the base duration for Scylla Worker exponential backoff, in milliseconds. * **Type**: `int` * **Default**: `50` * **Importance**: Low * **Valid values / Notes**: Must be a non-negative integer and should not be greater than `worker.maximum.backoff`. The Connector does not validate the relationship between the two values. #### `worker.maximum.backoff` Sets the maximum Scylla Worker exponential backoff, in milliseconds. * **Type**: `int` * **Default**: `30000` * **Importance**: Low * **Valid values / Notes**: Must be a non-negative integer and should not be less than `worker.retry.backoff.base`. #### `worker.jitter.percentage` Sets the random jitter percentage for Worker retry backoff. * **Type**: `int` * **Default**: `20` * **Importance**: Low * **Valid values / Notes**: Use `1` through `100`. Version 2.0.6 validates only that the value is positive and does not enforce an upper limit, but values greater than `100` should not be configured. #### `worker.max.retries` Sets the total number of Scylla Worker execution attempts. * **Type**: `int` * **Default**: `20` * **Importance**: Low * **Valid values / Notes**: Accepts a positive integer or `-1`. `1` means a single execution with no retry, and `-1` means unlimited attempts. `0` and values less than `-1` are invalid. ### Tasks and Connection Pooling #### `tasks.max` Sets the maximum number of tasks that Kafka Connect can create. * **Type**: `int` * **Default**: `1` * **Importance**: High * **Valid values / Notes**: Must be at least `1`. The actual number of tasks may be lower, depending on the current CDC vnode or tablet work assignments. Increasing this value does not guarantee linear throughput growth and affects the total number of connections and queues. #### `tasks.max.enforce` Controls whether the framework enforces the `tasks.max` limit. * **Type**: `boolean` * **Default**: `true` * **Importance**: Low * **Valid values / Notes**: Kafka Connect 3.9.1 has deprecated this configuration and plans to remove it. Keep it set to `true` and plan concurrency through `tasks.max`. * **Deprecation**: Yes; there is no direct replacement configuration. #### `worker.shared.session.enabled` Controls whether tasks in the same Worker JVM share a Scylla Session. * **Type**: `boolean` * **Default**: `false` * **Importance**: Low * **Valid values / Notes**: When set to `true`, tasks share a Session only if their connection and pool configurations are identical. Sharing is limited to a single JVM. It can reduce the number of connections but increases contention on the same pool. #### `worker.pooling.core.pool.local` Sets the target number of core connections for each local Scylla node. * **Type**: `int` * **Default**: `1` * **Importance**: Low * **Valid values / Notes**: Must be a non-negative integer and should not be greater than `worker.pooling.max.pool.local`. The Connector does not validate the relationship between the two values. #### `worker.pooling.max.pool.local` Sets the maximum number of connections for each local Scylla node. * **Type**: `int` * **Default**: `1` * **Importance**: Low * **Valid values / Notes**: Must be a non-negative integer and should not be less than `worker.pooling.core.pool.local`. #### `worker.pooling.max.requests.per.connection` Sets the maximum number of concurrent requests allowed on a single connection. * **Type**: `int` * **Default**: `256` * **Importance**: Low * **Valid values / Notes**: Must be a non-negative integer. When Session sharing is disabled, each task uses an independent connection pool, so the aggregate concurrency limit grows with the actual task count. When sharing is enabled, identically configured tasks in the same Worker JVM share a Session, and this value applies to each connection in the shared pool. #### `worker.pooling.max.queue.size` Sets the request queue limit for each connection pool. * **Type**: `int` * **Default**: `256` * **Importance**: Low * **Valid values / Notes**: Must be a non-negative integer. Requests that exceed capacity or time out while waiting are rejected. When Session sharing is disabled, each task uses an independent connection pool. When sharing is enabled, identically configured tasks in the same Worker JVM share and contend for the same pool. #### `worker.pooling.pool.timeout.ms` Sets the maximum wait for obtaining a connection from a host connection pool, in milliseconds. * **Type**: `int` * **Default**: `5000` * **Importance**: Low * **Valid values / Notes**: Must be a non-negative integer. Adjust it together with the request queue, connection count, and Scylla latency. ### Heartbeats #### `heartbeat.interval.ms` Sets the heartbeat record interval, in milliseconds. * **Type**: `int` * **Default**: `30000` * **Importance**: Medium * **Valid values / Notes**: Must be a positive integer and cannot be set to `0`. Heartbeats advance and persist the CDC read position during low-traffic periods. #### `heartbeat.topics.prefix` Sets the name prefix for heartbeat topics. * **Type**: `string` * **Default**: `__debezium-heartbeat` * **Importance**: Low * **Valid values / Notes**: The naming strategy combines this value with `topic.prefix` to generate the heartbeat topic. It should comply with Kafka topic naming rules. ### Converters and Extension Processing #### `key.converter` Sets the Kafka Connect Converter for the SourceRecord key. * **Type**: `class` * **Default**: `null` * **Importance**: Low * **Valid values / Notes**: When omitted, the Worker configuration is inherited. The Converter must be instantiable and support structured primary keys. If `kafka-key` is removed from the primary-key placements, the record key may be `null`. #### `value.converter` Sets the Kafka Connect Converter for the SourceRecord value. * **Type**: `class` * **Default**: `null` * **Importance**: Low * **Valid values / Notes**: When omitted, the Worker configuration is inherited. The Converter must support the Debezium Envelope `STRUCT` schema and the data types of the selected output format. #### `converters` Sets Debezium custom Converter aliases. * **Type**: `string` * **Default**: `null` * **Importance**: Low * **Valid values / Notes**: Use comma-separated aliases and configure the implementation class and options with each alias prefix. The implementation class must be present on the plugin Classpath. #### `post.processors` Sets Debezium Post Processor aliases. * **Type**: `string` * **Default**: `null` * **Importance**: Low * **Valid values / Notes**: Use comma-separated aliases and enable only installed implementations that are compatible with the current Debezium runtime. ### Signals and Notifications #### `signal.enabled.channels` Sets the enabled Debezium signal channels. * **Type**: `list` * **Default**: `source` * **Importance**: Medium * **Valid values / Notes**: Configure only channels supported by the current plugin Classpath and Debezium runtime. The Source channel is enabled by default. #### `signal.poll.interval.ms` Sets the polling interval for enabled signal channels, in milliseconds. * **Type**: `long` * **Default**: `5000` * **Importance**: Medium * **Valid values / Notes**: Must be positive. The Scylla database signal table is not integrated, so this value cannot enable database-table signals. #### `signal.data.collection` Specifies the database signal collection. * **Type**: `string` * **Default**: `null` * **Importance**: Medium * **Valid values / Notes**: The Scylla task in 2.0.6 does not integrate database signal table mapping, so this configuration cannot enable signals through a Scylla table. Use another supported signal channel. #### `notification.enabled.channels` Sets the enabled Debezium notification channels. * **Type**: `list` * **Default**: `null` * **Importance**: Medium * **Valid values / Notes**: Configure only channels available on the current plugin Classpath. When a Sink notification channel is enabled, `notification.sink.topic.name` must also be set. #### `notification.sink.topic.name` Specifies the Kafka topic used by the Sink notification channel. * **Type**: `string` * **Default**: `null` * **Importance**: High * **Valid values / Notes**: Required only when the notification channels include Sink. The topic must be valid, and the Connector must have write permission. ### Observability #### `custom.metric.tags` Adds custom tags to Debezium JMX metrics. * **Type**: `list` * **Default**: `null` * **Importance**: Low * **Valid values / Notes**: Use a list of `key=value` entries. Tag values should be stable, must not contain passwords, tokens, or other sensitive information, and must comply with JMX ObjectName constraints. ### Registered but Unsupported Snapshot Configurations #### `snapshot.mode.custom.name` Specifies a custom Snapshotter name. * **Type**: `string` * **Default**: `null` * **Importance**: Medium * **Valid values / Notes**: Although this field is publicly registered, version 2.0.6 always uses a snapshot process that reads neither schemas nor table data and does not expose `snapshot.mode`. Setting this field has no effect. #### `snapshot.mode.configuration.based.snapshot.data` Controls whether Configuration-based mode snapshots data. * **Type**: `boolean` * **Default**: `false` * **Importance**: Medium * **Valid values / Notes**: Version 2.0.6 does not expose a usable Configuration-based Snapshot mode. This configuration cannot request a base-table snapshot. #### `snapshot.mode.configuration.based.snapshot.schema` Controls whether Configuration-based mode snapshots the schema. * **Type**: `boolean` * **Default**: `false` * **Importance**: Medium * **Valid values / Notes**: The Scylla snapshot implementation in 2.0.6 does not capture schemas. This configuration has no effect. #### `snapshot.mode.configuration.based.start.stream` Controls whether Configuration-based mode starts streaming. * **Type**: `boolean` * **Default**: `false` * **Importance**: Medium * **Valid values / Notes**: Version 2.0.6 does not expose a usable Configuration-based Snapshot mode. This configuration has no effect. #### `snapshot.mode.configuration.based.snapshot.on.schema.error` Controls whether a Configuration-based snapshot is rerun after a schema error. * **Type**: `boolean` * **Default**: `false` * **Importance**: Medium * **Valid values / Notes**: The Scylla snapshot implementation reads neither schemas nor table data. This configuration has no effect. #### `snapshot.mode.configuration.based.snapshot.on.data.error` Controls whether a Configuration-based snapshot is rerun after a data error. * **Type**: `boolean` * **Default**: `false` * **Importance**: Medium * **Valid values / Notes**: The Scylla snapshot implementation reads neither schemas nor table data. This configuration has no effect. #### `incremental.snapshot.watermarking.strategy` Sets the incremental snapshot watermarking strategy. * **Type**: `string` * **Default**: `INSERT_INSERT` * **Importance**: Low * **Valid values / Notes**: This field is publicly registered by Debezium, but version 2.0.6 does not provide a usable Scylla incremental snapshot capability. It cannot be used to read existing base-table data. ## Best Practices ### Preserve Before and After Images for Update Events **Applicable scenario**: Downstream systems need to compare field changes, generate audit records, or maintain a complete materialized view, and CDC preimage and postimage can be enabled on the target tables before integration. The expected result is that UPDATE events contain complete `before` and `after` images, while INSERT and DELETE events continue to follow their respective image boundaries. **Configuration example**: ```properties theme={null} connector.class=com.scylladb.cdc.debezium.connector.ScyllaConnector scylla.cluster.ip.addresses=:9042 scylla.table.names=.
topic.prefix=scylla scylla.ssl.enabled=false cdc.output.format=advanced cdc.include.primary-key.placement=kafka-key,payload-after,payload-before cdc.include.before=full cdc.include.after=full cdc.incomplete.task.timeout.ms=30000 key.converter=org.apache.kafka.connect.json.JsonConverter value.converter=org.apache.kafka.connect.json.JsonConverter ``` **Key considerations**: Enable the corresponding CDC preimage and postimage on all target tables before starting the Connector. Complete images increase Scylla CDC storage, read traffic, and Kafka message size. If only updated columns are needed, use `only-updated` instead. When an image record remains missing beyond the timeout, the corresponding logical change is discarded, so set the timeout based on error logs and downstream data-integrity requirements. ### Limit the CDC History Lookback During Initial Integration **Applicable scenario**: The target tables have already been continuously producing CDC logs, but the initial deployment needs only a recent range of changes and should not catch up from the first still-visible CDC Generation. The expected result is that tasks without stored offsets start reading from approximately one hour before the current time instead of producing a base-table snapshot. **Configuration example**: ```properties theme={null} connector.class=com.scylladb.cdc.debezium.connector.ScyllaConnector scylla.cluster.ip.addresses=:9042 scylla.table.names=.
topic.prefix=scylla scylla.ssl.enabled=false scylla.initial.lookback.ms=3600000 cdc.output.format=advanced cdc.include.primary-key.placement=kafka-key,payload-after,payload-before cdc.include.after=only-updated key.converter=org.apache.kafka.connect.json.JsonConverter value.converter=org.apache.kafka.connect.json.JsonConverter ``` **Key considerations**: CDC postimage must be enabled on the target tables so that both historical and real-time events carry consumable non-primary-key change values. `scylla.initial.lookback.ms` takes effect only when the corresponding task has no stored offset. It cannot override an existing recovery position or read data that has already aged out of Scylla CDC retention. Determine the lookback duration from the historical range the business permits and the expected catch-up throughput. If existing base-table rows are required, use a separate data initialization process and coordinate deduplication and continuity with subsequent CDC events. ### Increase Concurrency While Controlling Scylla Connection Pressure **Applicable scenario**: Monitoring shows that the Connector is continuously falling behind, Kafka and the Worker still have processing capacity, but a single task cannot consume the current vnode or tablet assignments in time. The expected result is increased concurrency within the currently assignable work units, while tasks in the same Worker JVM share a Session to avoid multiplying the connection count directly by the number of tasks. **Configuration example**: ```properties theme={null} connector.class=com.scylladb.cdc.debezium.connector.ScyllaConnector tasks.max=4 scylla.cluster.ip.addresses=:9042 scylla.table.names=.
topic.prefix=scylla scylla.ssl.enabled=false cdc.output.format=advanced cdc.include.primary-key.placement=kafka-key,payload-after,payload-before cdc.include.after=only-updated worker.shared.session.enabled=true worker.pooling.core.pool.local=1 worker.pooling.max.pool.local=2 worker.pooling.max.requests.per.connection=256 worker.pooling.max.queue.size=512 worker.pooling.pool.timeout.ms=5000 key.converter=org.apache.kafka.connect.json.JsonConverter value.converter=org.apache.kafka.connect.json.JsonConverter ``` **Key considerations**: CDC postimage must be enabled on the target tables. The actual number of tasks may be lower than `tasks.max`, and topology or CDC Generation changes trigger reassignment, so do not assume that a task is permanently mapped to one vnode or tablet. Session sharing applies only within the same JVM. It reduces connection count while increasing pool contention. Increase concurrency gradually while monitoring Scylla request latency, connection-pool queuing, task retries, Kafka throughput, and end-to-end latency. ## Monitoring ### What to Monitor Monitor the running status and restart counts of the Connect Cluster, Workers, Connector, and tasks. Also monitor Source Record throughput, end-to-end latency, backlog trends, offset commit latency and failures, errors and retries, and Worker JVM CPU, heap memory, GC, and thread status. If the deployment explicitly enables error tolerance and a DLQ, also monitor DLQ write volume and failures. ### Import the Grafana Dashboard Download the [AutoMQ Connect Cluster Grafana Dashboard](https://automq-download-center.oss-cn-hangzhou.aliyuncs.com/connect-dashboard/automq-connect-cluster-dashboard.json). Confirm that Grafana has a data source configured to collect Kafka Connect JMX metrics and that labels such as Connector, Task, and Worker are available for filtering. Then upload the JSON file on the Grafana Dashboard import page and select the corresponding data source. ## Limitations * The Connector does not take an initial snapshot of the base table and does not support incremental snapshots. It can read only changes that are still retained in the Scylla CDC log. * Delivery semantics are at least once. If a failure occurs after Kafka has received a record but before the Source Offset is persisted, the record may be emitted again after restart. The Connector does not provide Exactly-once delivery or its own deduplication. * Global ordering is not guaranteed across tables, vnodes, tablets, CDC Generations, tasks, or Kafka partitions. Removing `kafka-key` also weakens the partition-ordering basis normally used for the same primary key. * When a multi-row partition delete occurs on a table with clustering columns, the Connector does not emit one delete event per row. Row-range deletes are also unsupported. Only a table without clustering columns can represent a partition delete as a single-row delete. * The Connector does not support row filtering, column Include/Exclude filtering, or dynamic table discovery. The capture scope can be specified only by explicitly listing tables in `scylla.table.names`. * The `legacy` output format does not support List, Set, Map, Tuple, UDT, or Postimage and is deprecated. Its orphaned Preimages have no timeout cleanup mechanism. * The Connector does not emit transaction metadata or establish a transaction boundary across the Scylla read position, Kafka records, and Connect Offsets. ## FAQ ### Why is the Kafka key empty, or why does the key converter report that a required field is `null` when using the `advanced` format? Scylla CDC Source Connector 2.0.6 cannot rely only on the ConfigDef default of `cdc.include.primary-key.placement` in the `advanced` format. Explicitly set `cdc.include.primary-key.placement=kafka-key,payload-after,payload-before` and retain a `key.converter` that supports structured primary keys. After the Connector restarts, the Kafka key contains the source-table primary-key fields. Also confirm that the target table actually defines a primary key and that the effective Connector configuration does not override or remove `kafka-key`. ### Why are existing rows in the table not emitted after the Connector starts? The Connector reads only the CDC log and does not scan the base table. Check that CDC is enabled on the target table, that the table is listed in `scylla.table.names`, and that the CDC log still retains the required time range. When recent history is required during initial integration, set `scylla.initial.lookback.ms` only when no stored offset exists. When the complete existing dataset is required, first use a separate initialization process and then continue synchronization from an explicit CDC boundary. ### Why are changes from a table still missing after configuration validation succeeds? A missing target table does not cause configuration validation to fail; the Connector waits for the table to appear. Confirm the `keyspace.table` spelling, ensure that quoted identifiers are not used, and check that the table exists and has CDC enabled. If `cdc.include.before` or `cdc.include.after` is configured, also confirm that Preimage or Postimage is enabled on the table as appropriate, and check the Connector and task status, Scylla permissions, and error logs. ### Why do duplicate events appear after a restart? The Connector uses at-least-once delivery. If Kafka acknowledges a record but the corresponding Source Offset has not yet been flushed successfully, a restart recovers from the previous persisted position and emits some events again. Retain the complete primary key as the Kafka key, implement idempotent writes or deduplication downstream using fields such as the primary key, operation type, and source timestamp, and monitor offset commit failures and latency. Do not rely on the Connector to provide Exactly-once delivery. ### Why do some delete operations have no corresponding Kafka event? First confirm that `skipped.operations` does not include `d`. A normal row delete emits a delete event, but a multi-row partition delete on a table with clustering columns and a row-range delete are not expanded into per-row events. If the business must capture these deletes, issue explicit per-row deletes or supplement the unrepresentable bulk-delete semantics with application-level events. ### Why are changes missing after `before` or `after` is enabled? The Advanced format must combine the primary change with the corresponding Preimage or Postimage. Confirm that all target tables have the required CDC options enabled and check for incomplete-combination errors that exceed `cdc.incomplete.task.timeout.ms`. Do not mask persistently missing images by only increasing the timeout. First check the Scylla CDC configuration, log retention, read latency, and Connector errors. # Server Sent Events Source Connector Source: https://docs.automq.com/automq-cloud/kafka-connect/source-connectors/server-sent-events-source-connector Configure and operate the Server Sent Events Source Connector in AutoMQ Connect, including prerequisites, configuration, monitoring, and troubleshooting. ## Overview The Server Sent Events Source Connector connects to an HTTP endpoint that supports Server-Sent Events (SSE), continuously receives events, and writes them to a specified Kafka topic. It is suitable for ingesting service status updates, notification streams, or other real-time data published over a long-lived SSE connection into Kafka for downstream stream processing, storage, or distribution systems. Each SSE event maps to one Kafka record. The record value uses a fixed structure with three string fields: `event`, `id`, and `data`. The `data` field remains a string; JSON or XML within it is not parsed automatically. The record key is null, and the SSE event ID is not stored as a Kafka Connect offset. ## License Uses Apache License 2.0. ## Quick Start Prepare a Connect Cluster, Kafka, and an SSE endpoint that does not require authentication, and confirm network connectivity and access permissions. For preparation and management, see [Manage Connector](../manage-connectors). ```properties theme={null} connector.class=com.github.cjmatta.kafka.connect.sse.ServerSentEventsSourceConnector sse.uri= topic= ``` Replace `` with an SSE endpoint accessible to the Connect Worker, and replace `` with the Kafka topic that receives events. After applying the configuration, check both the Connector and Task status and verify actual events in the target topic. A running Task alone does not mean that the SSE connection has produced data. ## Configuration ### Kafka Connect Framework #### `connector.class` The Server Sent Events Source Connector implementation class to load. * **Type**: `string` * **Default**: None * **Importance**: High * **Valid Values / Notes**: Use `com.github.cjmatta.kafka.connect.sse.ServerSentEventsSourceConnector`. * **Required**: Yes #### `tasks.max` The maximum number of Tasks that Kafka Connect requests the Connector to create. * **Type**: `int` * **Default**: `1` * **Importance**: High * **Valid Values / Notes**: Must be at least `1`. This Connector always creates only one Task; increasing this value does not increase the number of SSE connections or consumption concurrency. ### SSE Connection and Output #### `sse.uri` The SSE stream address to which the Task connects. * **Type**: `string` * **Default**: None * **Importance**: High * **Valid Values / Notes**: Use an SSE endpoint accessible to every candidate Worker. The Connector does not validate the URI format, protocol, or reachability during configuration parsing. * **Required**: Yes #### `topic` The Kafka topic that receives all SSE events. * **Type**: `string` * **Default**: None * **Importance**: High * **Valid Values / Notes**: One Connector instance can write to only one fixed topic. It does not support configuring a topic list or routing rules based on event content. * **Required**: Yes ### HTTP Authentication and Request Headers #### `http.basic.auth` Controls whether the Connector reads the username and password for HTTP Basic Authentication. * **Type**: `boolean` * **Default**: `false` * **Importance**: Medium * **Valid Values / Notes**: Can be set to `true` or `false`. When enabled, the Task reads the `password`-typed configuration as a string and may fail with a type-conversion error during startup. Even if an Authorization header is constructed, the current implementation does not pass that request builder to the actual SSE handshake. Do not treat this as an available authentication method. #### `http.basic.auth.username` The username for HTTP Basic Authentication. * **Type**: `string` * **Default**: `null` * **Importance**: Medium * **Valid Values / Notes**: Read only when `http.basic.auth=true`. The Connector does not validate that the value is nonempty or that it is configured together with the password. Because of the Basic Auth implementation limitations, do not rely on this configuration for endpoints that require authentication. #### `http.basic.auth.password` The password for HTTP Basic Authentication. * **Type**: `password` * **Default**: `null` * **Importance**: Medium * **Valid Values / Notes**: Read only when `http.basic.auth=true`. Enabling Basic Auth and providing a password may cause a type-conversion error when the Task starts. Do not expose real passwords in plaintext configurations, logs, or documentation. #### `http.header.*` Reads custom HTTP request-header configurations. The name after `http.header.` is used as the request header name. * **Type**: `dynamic-prefix string values` * **Default**: `{}` * **Importance**: Medium * **Valid Values / Notes**: For example, `http.header.User-Agent` represents the `User-Agent` request header. The Connector does not validate header names or values, and values may contain sensitive credentials. The current implementation adds these headers to a request builder that is not passed to `SseEventSource`, so do not rely on this configuration for authentication, access control, or User-Agent overrides. ### HTTP Client #### `compression.enabled` Controls the gzip encoding property of the Jersey client. * **Type**: `boolean` * **Default**: `true` * **Importance**: Low * **Valid Values / Notes**: Can be set to `true` or `false`. When enabled, the Connector sets Jersey's gzip encoding property, but the explicitly constructed `Accept-Encoding` header is not connected to the actual SSE handshake path. Validate compression negotiation and response decompression behavior against the target SSE service. ### Connection Rate Limiting #### `rate.limit.requests.per.second` Controls the minimum interval before the Connector opens or reopens an SSE connection. * **Type**: `double` * **Default**: `null` * **Importance**: Low * **Valid Values / Notes**: A positive value is used to calculate the wait time between connection-opening requests. `null`, `0`, or a negative value does not enable this wait. It does not limit SSE event throughput and is not a Worker-wide request rate limit. #### `rate.limit.max.concurrent` Declares the maximum number of concurrent connections. * **Type**: `int` * **Default**: `null` * **Importance**: Low * **Valid Values / Notes**: Although the current implementation accepts and stores this value, it does not use it to limit connection, Task, or request concurrency. Do not use it as a concurrency control mechanism. ### Reconnection Parameters #### `retry.backoff.initial.ms` Sets the initial wait time for a reconnection triggered by the idle health check and contributes to calculating the SSE client's own reconnection interval. * **Type**: `long` * **Default**: `2000` * **Importance**: Low * **Valid Values / Notes**: The unit is milliseconds. The Connector does not validate that the value is nonnegative. The interval used by the SSE client itself does not exceed `2000` milliseconds, while an idle health-check reconnection uses the configured value as the first exponential-backoff wait. #### `retry.backoff.max.ms` Sets the maximum exponential-backoff wait time for a reconnection triggered by the idle health check. * **Type**: `long` * **Default**: `30000` * **Importance**: Low * **Valid Values / Notes**: The unit is milliseconds. The Connector does not validate that the value is nonnegative or require it to be greater than or equal to `retry.backoff.initial.ms`. It does not control every reconnection path of the SSE client itself. #### `retry.max.attempts` Limits the number of idle health-check reconnection attempts managed by the Connector. * **Type**: `int` * **Default**: `-1` * **Importance**: Low * **Valid Values / Notes**: `-1` means unlimited attempts, and `0` rejects the first reconnection of this type. Values less than `-1` are not treated as unlimited. This configuration does not guarantee coverage of asynchronous SSE errors, every HTTP status, or recovery after a Task failure. ## Monitoring ### What to Monitor Monitor Kafka Connect health, Connector and Task status, throughput, latency, offset commits, errors, retries, and Worker JVM signals. Also monitor logs related to SSE connection errors and queue growth to prevent heap memory pressure when the source continuously outpaces Kafka. Monitor DLQ activity only when the corresponding error handling is enabled, but do not rely on the DLQ to capture connection and event-processing errors internal to the Connector. ### Import the Grafana Dashboard Ensure that Connect metrics are available in a Grafana data source and that the collected labels match the dashboard filters; download the [Kafka Connect Dashboard](https://automq-download-center.oss-cn-hangzhou.aliyuncs.com/connect-dashboard/automq-connect-cluster-dashboard.json), import the JSON into Grafana, and select the corresponding data source. ## Limitations * One Connector instance connects to one SSE URI, writes to one fixed topic, and always creates only one Task. To connect to multiple SSE endpoints, create a separate Connector instance for each endpoint. * The Connector does not provide event-type filtering or parse `data` content. SSE `data` is always written as a string field in the fixed structure. * The Connector does not store SSE event IDs as Kafka Connect offsets and does not provide persistent deduplication. Task or Worker restarts and reconnections may cause duplicates or omissions; do not claim exactly-once, duplicate-free, omission-free, or unconditional at-least-once delivery. * SSE events first enter an unbounded in-memory queue, and a single poll has no record-count or byte-size limit. If the source continuously outpaces Kafka, heap memory pressure may occur. * Basic Auth has a password type-conversion failure path. The Authorization header, custom headers, and explicit `Accept-Encoding` header are added to a request builder that is not passed to `SseEventSource`. Do not rely on these configurations to access protected endpoints or override the User-Agent. * `rate.limit.max.concurrent` does not enforce a concurrency limit. `rate.limit.requests.per.second` affects only the wait before the Connector actively opens a connection; it does not limit event throughput or every internal reconnection performed by the SSE client. * The reconnection parameters cover only specific connection lifecycle paths. They cannot guarantee that every initial connection failure, asynchronous error, or HTTP response is retried and recovered automatically. * An SSE message without an `event` name may be skipped or emitted with `event=unknown`, depending on its position within a batch. ## FAQ ### The Connector and Task Are Running, but the Target Topic Has No Messages A successfully started Task does not necessarily mean that the SSE stream is connected and continuously producing events. Confirm that `sse.uri` is accessible from the Worker running the Task, that the endpoint returns a valid SSE response, and that it is publishing events with data. Check the Worker logs for connection, protocol, and asynchronous errors, and verify output in the target topic. For endpoints that require Basic Auth or custom request headers, do not assume that the current configuration can complete the handshake. Prefer a controlled endpoint without authentication when isolating the problem. ### Duplicate Messages Appear or a Segment of Events Is Missing After a Restart The Connector does not store a recoverable SSE consumption position or write event IDs to Kafka Connect offsets. Even if the SSE service supports `Last-Event-ID`, after a Task or Worker restart the Connector has no persisted event ID from which to resume. Use stable business identifiers for idempotent processing or deduplication downstream, and monitor both duplicates and data gaps during restart windows. Do not rely on offset commits to eliminate this risk. ### Increasing `tasks.max` Still Produces Only One Task This is the task-allocation boundary of the Connector. It always returns one Task configuration, so increasing `tasks.max` does not increase the number of SSE connections or throughput. To ingest multiple endpoints, create an independent Connector instance for each endpoint. Validate capacity planning for a single endpoint against the source event rate, Kafka write capacity, and Worker memory. ### Worker Memory Usage Keeps Growing The SSE callback writes events to an unbounded in-memory queue, and the Connector provides neither backpressure nor a batch limit. Check the source event rate, Kafka produce latency, Task errors, and queue-related logs. Reduce the source send rate, restore Kafka write capacity, or separate different endpoints into independent Connector instances, and configure memory and alert thresholds for the Worker. `rate.limit.requests.per.second` limits only how often connections are opened; it cannot reduce the event rate of an established SSE stream. # Shell Source Connector Source: https://docs.automq.com/automq-cloud/kafka-connect/source-connectors/shell-source-connector Configure and operate the Shell Source Connector in AutoMQ Connect, including prerequisites, configuration, monitoring, and troubleshooting. ## Overview Shell Source Connector runs shell commands on the Kafka Connect Worker hosting the Task, converts each line of standard output into a Kafka record, and writes it to the specified Topic. It connects external data sources to Kafka, ingesting output from existing command-line tools, commands that read finite text files, or collection scripts. After each command completes successfully, the Connector returns its output to Kafka Connect as a batch, then runs the command again on the next poll. Each record value is a string with the line terminator removed, the record key is null, and the timestamp is the time the record is constructed. The command determines which data to collect and whether to output only new data; the Connector does not automatically detect new file content or parse JSON or CSV fields. ## Prerequisites * An executable `sh` must be available in the operating system or container of every candidate Worker that may run the Task. * Tools, scripts, and source resources used by the command must be available on every candidate Worker and accessible to the Worker process; paths in containers must refer to resources inside the container. * The command must finish within a finite amount of time, and its text output per execution should be bounded, because the entire output is handed to Kafka Connect only after the command finishes. ## License Uses Apache License 2.0. ## Quick Start Prepare a Connect Cluster, Kafka, and the target Topic in advance, confirm network connectivity and access permissions, and ensure that the Worker can execute `sh`. For preparation and management operations, see AutoMQ's [Manage Connectors](../manage-connectors). The following command uses the Shell's `printf` to output two fixed lines of text; no external file is required. ```properties theme={null} connector.class=uk.co.threefi.connect.shell.ShellSourceConnector shell.command=printf '%s\\n' alpha beta topic= value.converter=org.apache.kafka.connect.storage.StringConverter ``` Replace `` with the target Topic name and apply the settings above to the Connector configuration. Each successful collection produces two text records with values `alpha` and `beta`, using one Task by default. The command runs repeatedly, so these text values continue to appear rather than being sent only once. The double backslash in the code is for reading a properties file; after parsing, the command's format string is `%s\n`. ## Configuration ### Connector and Execution Concurrency #### `connector.class` Selects the Shell Source Connector implementation. * **Category**: Kafka Connect framework configuration * **Type**: `string` * **Default**: None * **Importance**: High * **Required**: Yes * **Valid Values / Notes**: Use `uk.co.threefi.connect.shell.ShellSourceConnector`. #### `tasks.max` The maximum number of Tasks allowed for the Connector. * **Category**: Kafka Connect framework configuration * **Type**: `int` * **Default**: `1` * **Importance**: High * **Valid Values / Notes**: Values range from `1` to `2147483647`. Every Task receives the same command configuration; the source data scope is not automatically divided. For a single source and a single command, generally keep the default. Increasing the number of Tasks may cause duplicate execution or resource contention rather than partitioning the data. #### `tasks.max.enforce` Whether to enforce the `tasks.max` limit. * **Category**: Kafka Connect framework configuration * **Type**: `boolean` * **Default**: `true` * **Importance**: Low * **Deprecated**: Yes * **Replacement**: None * **Valid Values / Notes**: Accepts `true` or `false`. Keep the default and control the number of Tasks through `tasks.max`; do not rely on disabling this check to increase parallelism. ### Command and Collection Timing #### `shell.command` The shell command string executed on each poll. * **Category**: Connector configuration * **Type**: `string` * **Default**: Empty string * **Importance**: High * **Valid Values / Notes**: Explicitly specify a valid command that can finish successfully. The command is executed by `sh -c` on the Worker, inheriting the Worker process's environment and working directory; use absolute paths for files or scripts where possible. Only stdout is collected, and it is decoded using the Worker JVM's default character set. Command text may appear in logs, so do not include passwords, tokens, or other credentials. Template substitution based on message keys, Topics, or values is not supported. #### `block.ms` The wait time, in milliseconds, after each command has been processed and before the collection batch is returned. * **Category**: Connector configuration * **Type**: `int` * **Default**: `100` * **Importance**: Low * **Valid Values / Notes**: Use an integer from `0` to `2147483647`. Configuration parsing does not validate that the value is nonnegative, but the actual wait requires a nonnegative value. The wait occurs after successful execution, empty output, or a caught command-execution I/O error; output from the first collection is also handed to Connect only after the wait. This is not a command timeout, a fixed interval, or cron scheduling; the interval between collections also includes command execution and Worker processing time. ### Output Destination and Text Serialization #### `topic` The target Kafka Topic for all output lines. * **Category**: Connector configuration * **Type**: `string` * **Default**: Empty string * **Importance**: High * **Valid Values / Notes**: Explicitly specify one valid Topic name, not a list of names or a regular expression. Plugin configuration validation does not check whether the Topic is valid or whether access permissions are available. #### `value.converter` Specifies the Converter used when writing Source record values to Kafka. * **Category**: Kafka Connect framework configuration * **Type**: `class` * **Default**: `null` * **Importance**: Low * **Valid Values / Notes**: When omitted, inherits the Worker's value Converter. Use `org.apache.kafka.connect.storage.StringConverter` when writing plain text to prevent the output format from varying with the Worker's default settings. The Converter must be an instantiable Kafka Connect Converter implementation; selecting a Converter does not make the plugin automatically parse JSON or CSV strings into fields. ## Best Practices ### Adjust the Wait Time to Match Source Load During Continuous Collection **Applicable Scenario**: After initial setup, you need to keep running a collection command that finishes on each execution, but frequent queries or script runs increase the load on the source. A longer wait after each collection reduces access frequency at the cost of higher delivery latency. **Configuration Example**: Add the following setting to the running Connector's configuration, or override the existing `block.ms`; keep the original command, Topic, and StringConverter. ```properties theme={null} block.ms=3000 ``` **Key Notes**: This example waits 3 seconds after each command finishes before returning the current batch; it does not guarantee execution every 3 seconds. Adjust the wait time based on the call frequency the source can handle, command execution time, and business latency requirements, and observe throughput and latency. The command should still finish on each execution and produce a bounded amount of output. Do not replace periodic collection with a long-running command such as `tail -f`; increasing the wait does not resolve repeated output or provide a dedicated backoff strategy after failures. ## Monitoring ### What to Monitor Monitor Kafka Connect cluster health, Connector and Task status, record throughput and end-to-end latency, Offset commit success rates and duration, errors and retries, and Worker JVM memory, GC, and thread signals. A healthy Task status does not mean every command execution succeeds; assess source execution results together with the actual Kafka output. Successful Offset commits also do not mean collection can resume from a saved source position. Monitor DLQ activity only when the corresponding error handling is enabled in the deployment; do not assume command execution failures are record errors that automatically go to the DLQ. ### Import the Grafana Dashboard Download the shared [Kafka Connect Grafana Dashboard](https://automq-download-center.oss-cn-hangzhou.aliyuncs.com/connect-dashboard/automq-connect-cluster-dashboard.json), confirm that the monitoring data source collects Kafka Connect metrics and that labels such as cluster, Worker, Connector, and Task match the dashboard queries, then use Grafana's import feature to upload the JSON and select the corresponding data source. ## Limitations * Collects only stdout text; it does not automatically collect stderr or provide binary passthrough. * Output is returned only after the command finishes with a zero exit code; commands that run indefinitely cannot be used as real-time, line-by-line streams. * The entire output of each execution is held in memory, with no setting to split batches by record count or byte size. * File positions, line numbers, and source cursors are neither saved nor restored; committed timestamp Offsets cannot be used to resume reading from a saved position. * Does not automatically deduplicate records or atomically tie source archiving, deletion, or external cursor advancement to Kafka writes. * Does not provide message-data template substitution, built-in business-key extraction, or dynamic Topic routing. * Does not provide a command execution timeout setting or a plugin mechanism to actively terminate child processes. * Does not guarantee global record ordering across Kafka partitions or multiple Tasks. ## FAQ ### What Should I Check When the Task Is Running Normally but the Topic Has No New Messages? Confirm that the command produces stdout when run in the actual Worker container or host with the Worker's permissions and environment, and that it finishes with a zero exit code. Check tool paths, script permissions, and source resource locations. Commands that write only to stderr do not produce records; if a command produces output but exits with a nonzero status, its entire output is discarded. Check command execution warnings in the Worker and investigate source-side errors without exposing credentials; after fixing paths, permissions, or the command, observe the output again. Also check the target Topic, Converter, and `block.ms`, since a long wait delays the current batch. After a command I/O error is caught, the command runs again in a subsequent collection, so Task status alone is not enough to determine whether source execution succeeded. ### Why Does the Same Content Keep Appearing, and Why Does Reading Not Resume from the Next Line After a Restart? The Connector executes the entire command each time and does not read historical Offsets as a source recovery position. Reading the same file or repeatedly querying the same content produces records again, including after a restart. Before resuming after maintenance, confirm that the source data is still replayable, and have downstream systems handle duplicates using business identifiers. If the business requires reliable incremental cursors and archiving after acknowledgment, use a data source or Connector with the corresponding recovery protocol. Do not replace Kafka write acknowledgment by moving or deleting a file immediately after reading it; doing so may remove replayable data before it has been delivered. ### Why Does Increasing the Number of Tasks Cause Duplicate Collection? Every Task executes the same command, without dividing work by file, data scope, or source partition. Check `tasks.max` and restore it to `1` for a single source and a single command; also check whether candidate Workers refer to the same resource. Do not treat additional Tasks as source partitioning. Before scaling, define nonoverlapping data scopes and resource ownership, then design independent collection tasks. ### Why Do Consumers Still Receive Strings When the Command Outputs JSON Text? The Connector treats each line as a string record and does not parse JSON fields. With StringConverter, consumers receive the text of that line. If structured data is required, parse it in a downstream application or use a data source Connector that provides structured records. First check whether the command output's character set matches the Worker JVM's default character set, to avoid mistaking decoding issues for JSON format issues. # Twitter Source Connector Source: https://docs.automq.com/automq-cloud/kafka-connect/source-connectors/twitter-source-connector Configure the Twitter Source Connector in AutoMQ Connect, including compatibility limits, OAuth settings, filters, monitoring, and troubleshooting. ## Overview The Twitter Source Connector uses Twitter4J to connect to the legacy Twitter Streaming API. It continuously receives real-time statuses that match configured keywords and optional user IDs, converts each status into a structured Kafka Connect record, and writes the record to a specified Kafka topic. It is intended for ingesting a real-time status stream that the account is authorized to access into Kafka for stream processing, search, or archival systems. Regular statuses are written to `kafka.status.topic`. When delete-notice processing is enabled, the connector also writes delete notices to the same topic as records with null values. The connector processes only real-time callbacks received after the connection is established; it does not provide historical search, backfill existing data, or maintain a recoverable upstream read position. ## Prerequisites * Kafka Connect 3.9.1 cannot use the official 0.3.34 ZIP directly. The release package is missing the Guava dependency required at runtime. Even after adding the Guava 30.1.1-jre version declared by its dependency management, the packaged `connect-utils` 0.7.171 still throws an `IllegalAccessError` when accessing `SystemTime` in Kafka 3.9.1, preventing the task from starting. Proceed only after obtaining an official artifact that the connector vendor provides and confirms as compatible with Kafka Connect 3.9.1. * The connector uses Twitter4J 4.0.6 to access the legacy `statuses/filter.json` streaming endpoint. Before deployment, confirm with the current X/Twitter API service that this endpoint remains available to the target account, product tier, and region. Existing OAuth credentials alone do not establish availability. * Prepare an OAuth 1.0a consumer key, consumer secret, access token, and access token secret authorized to access that streaming endpoint, and confirm that the authorization scope permits reading the required real-time data. * Identify the keywords to track. `filter.keywords` is required; configuring only user IDs does not create an ingestion task. ## License Licensed under the Apache License 2.0. ## Quick Start The configuration below is for reference only and does not establish that the official 0.3.34 ZIP can run on Kafka Connect 3.9.1. First obtain an official artifact that the vendor has confirmed as compatible with Kafka Connect 3.9.1; do not add dependencies or modify binaries yourself to bypass the compatibility errors. Then prepare a Connect cluster, Kafka, a topic to receive status records, and an X/Twitter account with OAuth credentials whose access to the legacy streaming endpoint has been confirmed. Also verify network connectivity and access permissions. For preparation and management procedures, see [Manage Connectors](../manage-connectors). ```properties theme={null} connector.class=com.github.jcustenborder.kafka.connect.twitter.TwitterSourceConnector twitter.oauth.consumerKey= twitter.oauth.consumerSecret= twitter.oauth.accessToken= twitter.oauth.accessTokenSecret= filter.keywords= kafka.status.topic= process.deletes=false ``` Replace the keyword, target topic, and four OAuth placeholders. Supply credentials through a controlled configuration-management mechanism; do not commit them to a source repository or write them to logs. The example inherits the worker's key and value converters. The selected converters must be able to serialize nested Structs, arrays, maps, and Timestamps. Before submitting the configuration, confirm with the X/Twitter API service that the target account currently has permission to use the legacy streaming endpoint; successful configuration validation does not establish that the external real-time stream is available. ## Configuration ### Authentication #### `twitter.oauth.consumerKey` The Twitter OAuth consumer key. * **Type**: `password` * **Default**: None * **Importance**: High * **Valid Values / Notes**: Use a value that belongs to the same application and authorization relationship as the other three OAuth settings. Credential validity is checked by the external API. * **Required**: Yes #### `twitter.oauth.consumerSecret` The Twitter OAuth consumer secret. * **Type**: `password` * **Default**: None * **Importance**: High * **Valid Values / Notes**: Manage this as sensitive configuration. Do not write it to logs, support tickets, or shared examples. * **Required**: Yes #### `twitter.oauth.accessToken` The Twitter OAuth access token. * **Type**: `password` * **Default**: None * **Importance**: High * **Valid Values / Notes**: It must correspond to an account and application authorized to access the legacy streaming endpoint. Connector configuration validation does not confirm actual permissions. * **Required**: Yes #### `twitter.oauth.accessTokenSecret` The Twitter OAuth access token secret. * **Type**: `password` * **Default**: None * **Importance**: High * **Valid Values / Notes**: Manage this as sensitive configuration and use it with the corresponding access token. * **Required**: Yes ### Ingestion Scope #### `filter.keywords` The list of tracking keywords submitted to the streaming filter endpoint. * **Type**: `list` * **Default**: None * **Importance**: High * **Valid Values / Notes**: Separate keywords with commas. Provide at least one valid keyword. The connector partitions tasks according to the number of keywords and `tasks.max`. * **Required**: Yes #### `filter.userIds` The list of user IDs to track through the streaming filter endpoint. * **Type**: `list` * **Default**: Empty list * **Importance**: High * **Valid Values / Notes**: Use comma-separated decimal numeric user IDs, not usernames. Each item must be parseable as a Java `long`. Duplicate IDs are merged. This setting does not replace the required `filter.keywords` setting. ### Kafka Destination and Delete Notices #### `kafka.status.topic` The Kafka topic that receives regular statuses and, when enabled, delete notices. * **Type**: `string` * **Default**: None * **Importance**: High * **Valid Values / Notes**: Specify a single explicit topic name. This version does not support a separate `kafka.delete.topic`. * **Required**: Yes #### `process.deletes` Controls whether Twitter delete notices are processed. * **Type**: `boolean` * **Default**: None * **Importance**: High * **Valid Values / Notes**: `false` ignores delete notices. `true` writes each delete notice to `kafka.status.topic` with a `StatusDeletionNoticeKey` containing only `StatusId` and a null value. * **Required**: Yes ### Queue and Batching #### `queue.empty.ms` The time, in milliseconds, to wait for records when the internal queue is empty. * **Type**: `int` * **Default**: `100` * **Importance**: Low * **Valid Values / Notes**: The minimum is `10`. This setting controls how long an empty-queue poll waits; it is not a Twitter API connection timeout. #### `queue.batch.size` The target number of records returned from the internal queue by one poll. * **Type**: `int` * **Default**: `100` * **Importance**: Low * **Valid Values / Notes**: The minimum is `1`. This setting controls connector-internal queue batches; it is not a Twitter API fetch batch size. ### Twitter Client Diagnostics #### `twitter.debug` Enables Twitter4J debug logging. * **Type**: `boolean` * **Default**: `false` * **Importance**: Low * **Valid Values / Notes**: Enable it temporarily and only during controlled troubleshooting. It may produce substantial output and does not change the Kafka Connect worker's log-level configuration. ### Connector Identity and Tasks #### `connector.class` The connector implementation class to load. * **Type**: `string` * **Default**: None * **Importance**: High * **Valid Values / Notes**: Use `com.github.jcustenborder.kafka.connect.twitter.TwitterSourceConnector`. * **Required**: Yes #### `tasks.max` The maximum number of tasks the connector may create. * **Type**: `int` * **Default**: `1` * **Importance**: High * **Valid Values / Notes**: The minimum is `1`. The actual task count is the smaller of `tasks.max` and the number of keywords. Increasing this value establishes more independent external streaming connections. #### `tasks.max.enforce` Controls whether Kafka Connect enforces the `tasks.max` limit. * **Type**: `boolean` * **Default**: `true` * **Importance**: Low * **Valid Values / Notes**: Kafka Connect 3.9.1 marks this setting as deprecated and plans to remove it. Keep it set to `true` and manage the task count through `tasks.max`. * **Deprecation Status**: Yes ### Record Conversion #### `key.converter` Overrides the worker converter used to serialize SourceRecord keys. * **Type**: `class` * **Default**: `null`, inherits the worker configuration * **Importance**: Low * **Valid Values / Notes**: If explicitly configured, the class must implement the Kafka Connect `Converter` interface and be instantiable. Regular statuses and delete notices use structured keys. #### `value.converter` Overrides the worker converter used to serialize SourceRecord values. * **Type**: `class` * **Default**: `null`, inherits the worker configuration * **Importance**: Low * **Valid Values / Notes**: If explicitly configured, the class must implement the Kafka Connect `Converter` interface and be instantiable. Regular statuses contain nested structures, arrays, maps, and Timestamps; delete-notice values are null. ## Best Practices ### Adjust the Scope of Ongoing Ingestion Applicable scenario: After the connector has completed initial onboarding, business topics change and you need to add or narrow keywords. You may also need to track a defined set of numeric user IDs so that subsequent real-time data continues to enter the existing target topic. Replace or add the following properties in the Quick Start configuration: ```properties theme={null} filter.keywords=, filter.userIds=, ``` Key considerations: `filter.userIds` accepts only numeric IDs and cannot create tasks by itself, so always retain at least one keyword. Changing the filter conditions rebuilds the real-time stream. Because the connector has no historical backfill or checkpoint-resume capability, account for possible gaps or duplicates during the transition window in the downstream design. ### Increase Ingestion Parallelism for Multiple Keywords Applicable scenario: An existing single task has been running continuously, and an expanded keyword set now needs to be distributed across multiple independent tasks and streaming connections to reduce the filtering scope handled by each connection. Replace or add the following properties in the Quick Start configuration: ```properties theme={null} tasks.max=2 filter.keywords=,,, ``` Key considerations: The connector never creates more tasks than there are keywords, and it assigns keywords in iteration order using round-robin distribution. Increasing `tasks.max` establishes more external streaming connections. If `filter.userIds` is also configured, the complete user ID list is copied to every task, which may produce duplicate records. The connector does not guarantee global ordering or deduplication across tasks; downstream systems should use stable business identifiers to handle duplicates. ### Preserve Upstream Delete Signals Applicable scenario: Continuous ingestion is already running, and downstream archival, indexing, or compliance processing needs to observe status delete notices emitted upstream instead of silently ignoring them. Replace the following property in the Quick Start configuration: ```properties theme={null} process.deletes=true ``` Key considerations: Delete notices are written to the same `kafka.status.topic` as regular statuses. Each record uses a `StatusDeletionNoticeKey` containing only `StatusId` and has a null value; this version has no separate delete topic. Downstream systems must explicitly recognize this record shape. If Kafka log compaction is expected to perform deletion, also confirm that the final key serialization, partitioning, and target-topic configuration match the intended downstream semantics. ## Monitoring ### What to Monitor Monitor general Kafka Connect health, connector and task states, throughput, latency, offset commits, errors, retries, and worker JVM signals. Monitor DLQ activity only when the deployment has enabled the corresponding error handling. This connector does not persist a recoverable Twitter upstream cursor, so a task in the RUNNING state does not establish that the external real-time stream is complete. Also inspect logs related to authentication, connections, stall warnings, and upstream rate limits. ### Import the Grafana Dashboard Confirm that Connect metrics are available through a Grafana data source and that collected labels satisfy the dashboard filters. Download the [Kafka Connect Dashboard](https://automq-download-center.oss-cn-hangzhou.aliyuncs.com/connect-dashboard/automq-connect-cluster-dashboard.json), import the JSON into Grafana, and select the corresponding data source. ## Limitations * The official 0.3.34 ZIP is missing Guava, so Kafka Connect 3.9.1 cannot complete plugin discovery. The unmodified release package cannot be used directly with this worker version. * After Guava 30.1.1-jre is added to 0.3.34, `connect-utils` 0.7.171 still accesses `SystemTime` in Kafka 3.9.1 when the task starts and throws an `IllegalAccessError`. This failure occurs before any X/Twitter request, and the task cannot run. * The connector depends on the legacy `statuses/filter.json` streaming endpoint used by Twitter4J 4.0.6. Its current availability, product-tier access, and account authorization are determined by the X/Twitter API service and must be confirmed by the user before deployment. * The connector receives only real-time statuses and delete callbacks after the connection is established. It does not support historical search, backfilling existing data, or reading a specified time range. * The connector does not persist an upstream cursor that can be used for recovery. After a task restart, migration, or filter-condition change, it establishes a new real-time connection and cannot resume precisely or backfill the interruption window. * The connector does not guarantee global ordering across tasks, idempotent writes, or deduplication. Multiple tasks, overlapping filter conditions, and reconnections can all introduce duplicates or gaps. * All regular statuses are written to one `kafka.status.topic`. The connector does not route records to separate topics by keyword, user, or event type, and it does not provide a raw JSON passthrough mode. * Delete notices can be written only as records with null values in `kafka.status.topic`. This version does not support `kafka.delete.topic`. * The internal queue is effectively unbounded under practical workloads and has no upstream-pause mechanism. If Kafka writes or serialization remain slow, the backlog may increase worker memory pressure. * Per-record conversion or enqueue exceptions caught internally by the connector are not passed to Kafka Connect's DLQ handling, and the event is not retried automatically. ## FAQ ### Why Can't the Official 0.3.34 ZIP Start a Task in Kafka Connect 3.9.1? The original release package is missing Guava, so the worker reports that `com.google.common.collect.Multimap` is missing during plugin discovery. After only Guava 30.1.1-jre is added, the plugin can be discovered and accepts the configuration, but the task throws an `IllegalAccessError` because `connect-utils` 0.7.171 accesses `SystemTime` in Kafka 3.9.1. The error occurs before the X/Twitter client is created or any external request is sent, so it is unrelated to OAuth credentials or external API responses. Do not treat adding dependencies yourself or modifying the binary as a supported solution. Until the vendor provides and confirms an official artifact compatible with Kafka Connect 3.9.1, the examples on this page are configuration references only. ### The Connector Cannot Establish a Twitter Streaming Connection Common causes include the legacy streaming endpoint no longer being available to the target account, the four OAuth 1.0a credentials not belonging to the same authorization relationship, insufficient token permissions, or the external service rejecting the current product tier. First confirm the current availability of `statuses/filter.json` and the account authorization with the X/Twitter API service. Then verify the four credentials and the worker's access path to the external service. Do not troubleshoot by printing complete credentials in logs. ### The Connector Has Started but Has No Task or Produces No Records If `filter.keywords` is empty, configuring only `filter.userIds` does not create an ingestion task. Confirm that at least one valid keyword is present, inspect connector and task states and authentication logs, and verify that the keywords or numeric user IDs satisfy the current streaming endpoint's server-side rules. The streaming endpoint returns only matching events received after the connection is established; it does not backfill earlier data. ### Duplicate Records or Ordering Changes Appear After Scaling Out Each task uses an independent streaming connection. Keywords are partitioned, while the complete `filter.userIds` list is copied to every task. The same event may be duplicated because filter scopes overlap or connections are re-established, and there is no global ordering guarantee across tasks. Check `tasks.max`, keyword grouping, and user ID settings. Deduplicate downstream using stable status IDs; do not treat Kafka offsets as Twitter upstream cursors. ### Why Is There No Separate Delete Topic After Delete Processing Is Enabled? This version has no `kafka.delete.topic` setting. When `process.deletes=true`, delete notices are written to `kafka.status.topic` as records with delete keys and null values. Check whether downstream converters and consumers preserve and recognize null values, and confirm that the target topic's compaction policy matches the intended behavior. # YugabyteDB Source Connector Source: https://docs.automq.com/automq-cloud/kafka-connect/source-connectors/yugabytedb-source-connector Configure and operate the YugabyteDB Source Connector in AutoMQ Connect, including prerequisites, configuration, monitoring, and troubleshooting. ## Overview The YugabyteDB Source Connector reads changes from YugabyteDB tables through YSQL logical replication and writes INSERT, UPDATE, DELETE, and TRUNCATE events to Kafka topics. Changes from regular tables are written to topic names composed of `topic.prefix`, the schema, and the table name. Message values use the Debezium event structure, which includes fields such as `before`, `after`, `source`, `op`, and timestamps. The connector can first create a snapshot of existing data and then continuously read incremental changes, or it can begin streaming directly when a data baseline already exists. It is suitable for synchronizing business data in YugabyteDB to stream processing, search, analytics, or heterogeneous data systems. Kafka record keys usually come from table primary keys; when no usable primary key exists, the record key may be null. ## Prerequisites * Use a dedicated YugabyteDB YSQL account with the `LOGIN` and `REPLICATION` attributes. Depending on the deployment, pre-create or allow the connector to create the matching replication slot and publication. If the connector is allowed to create the publication, also grant it `CREATE` on the database and the required ownership of the captured tables. Confirm that the server supports the logical decoding plugin specified by `plugin.name`. The target connector artifact declares compatibility with YugabyteDB 2024.1.x. ## License Licensed under the Apache License 2.0. ## Quick Start Prepare a Connect cluster, Kafka, and a YugabyteDB YSQL database in advance, and confirm network connectivity and access permissions. For preparation and management procedures, see [Manage Connectors](../manage-connectors). ```properties theme={null} connector.class=io.debezium.connector.postgresql.YugabyteDBConnector topic.prefix=ybdb database.hostname= database.port=5433 database.user= database.password= database.dbname= plugin.name=yboutput slot.name=debezium publication.name=dbz_publication snapshot.mode=initial ``` Replace the database address, account, password, and database name placeholders with values for your environment, and confirm that the port, logical decoding plugin, slot, and publication match the target cluster. Provide the database password through a secrets management mechanism. After you apply the configuration, the connector first creates an initial snapshot and then continuously sends change events that occur after that snapshot. ## Configuration ### Runtime and Serialization #### `connector.class` Specifies the YugabyteDB Source Connector implementation class that Kafka Connect loads. * **Type**: `string` * **Default**: None * **Importance**: High * **Valid values / Notes**: This ConfigDef declares no additional public value range. * **Required**: Yes #### `tasks.max` Maximum number of tasks to use for this connector. * **Type**: `int` * **Default**: `1` * **Importance**: High * **Valid values / Notes**: Must be an integer greater than or equal to `1`. #### `tasks.max.enforce` (Deprecated) Whether to enforce that the tasks.max property is respected by the connector. By default, connectors that generate too many tasks will fail, and existing sets of tasks that exceed the tasks.max property will also be failed. If this property is set to false, then connectors will be allowed to generate more than the maximum number of tasks, and existing sets of tasks that exceed the tasks.max property will be allowed to run. This property is deprecated and will be removed in an upcoming major release. * **Type**: `boolean` * **Default**: `true` * **Importance**: Low * **Valid values / Notes**: Kafka Connect 3.9.1 marks this property as deprecated but still accepts it; this ConfigDef declares no replacement. * **Deprecated**: Yes #### `key.converter` Overrides the worker-level setting and specifies the converter for record keys. * **Type**: `class` * **Default**: None * **Importance**: Low * **Valid values / Notes**: Must be a concrete `Converter` implementation with a public no-argument constructor. #### `value.converter` Overrides the worker-level setting and specifies the converter for record values. * **Type**: `class` * **Default**: None * **Importance**: Low * **Valid values / Notes**: Must be a concrete `Converter` implementation with a public no-argument constructor. #### `header.converter` Overrides the worker-level setting and specifies the converter for record headers. * **Type**: `class` * **Default**: None * **Importance**: Low * **Valid values / Notes**: Must be a concrete `HeaderConverter` implementation with a public no-argument constructor. #### `transforms` Aliases for the transformations to be applied to records. * **Type**: `list` * **Default**: `[]` * **Importance**: Low * **Valid values / Notes**: Use unique, non-empty transformation aliases; configure `transforms..type` for each alias. #### `predicates` Aliases for the predicates used by transformations. * **Type**: `list` * **Default**: `[]` * **Importance**: Low * **Valid values / Notes**: Use unique, non-empty predicate aliases; configure `predicates..type` for each alias. #### `config.action.reload` The action that Connect should take on the connector when changes in external configuration providers result in a change in the connector's configuration properties. A value of 'none' indicates that Connect will do nothing. A value of 'restart' indicates that Connect should restart/reload the connector with the updated configuration properties.The restart may actually be scheduled in the future if the external configuration provider indicates that a configuration value will expire in the future. * **Type**: `string` * **Default**: `restart` * **Importance**: Low * **Valid values / Notes**: Allowed values: `none`, `restart`. ### Error Handling and Topic Creation #### `errors.retry.timeout` The maximum duration in milliseconds that a failed operation will be reattempted. The default is 0, which means no retries will be attempted. Use -1 for infinite retries. * **Type**: `long` * **Default**: `0` * **Importance**: Medium * **Valid values / Notes**: `0` disables retries, `-1` retries indefinitely, and a positive value sets the total retry duration. #### `errors.retry.delay.max.ms` The maximum duration in milliseconds between consecutive retry attempts. Jitter will be added to the delay once this limit is reached to prevent thundering herd issues. * **Type**: `long` * **Default**: `60000` * **Importance**: Medium * **Valid values / Notes**: Must be a non-negative millisecond value; jitter is added after the delay reaches this limit. #### `errors.tolerance` Behavior for tolerating errors during connector operation. 'none' is the default value and signals that any error will result in an immediate connector task failure; 'all' changes the behavior to skip over problematic records. * **Type**: `string` * **Default**: `none` * **Importance**: Medium * **Valid values / Notes**: Allowed values: `none`, `all`. #### `errors.log.enable` If true, write each error and the details of the failed operation and problematic record to the Connect application log. This is 'false' by default, so that only errors that are not tolerated are reported. * **Type**: `boolean` * **Default**: `false` * **Importance**: Medium * **Valid values / Notes**: This ConfigDef declares no additional public value range. #### `errors.log.include.messages` Controls whether error logs include the source record content and metadata that caused the failure. * **Type**: `boolean` * **Default**: `false` * **Importance**: Medium * **Valid values / Notes**: Enabling this can write record keys, values, headers, and source offsets to logs; assess exposure of sensitive data. #### `topic.creation.groups` Groups of configurations for topics created by source connectors * **Type**: `list` * **Default**: `[]` * **Importance**: Low * **Valid values / Notes**: Use unique, non-empty topic creation group aliases. ### Source Transactions and Offsets #### `exactly.once.support` Permitted values are requested, required. If set to "required", forces a preflight check for the connector to ensure that it can provide exactly-once semantics with the given configuration. Some connectors may be capable of providing exactly-once semantics but not signal to Connect that they support this; in that case, documentation for the connector should be consulted carefully before creating it, and the value for this property should be set to "requested". Additionally, if the value is set to "required" but the worker that performs preflight validation does not have exactly-once support enabled for source connectors, requests to create or validate the connector will fail. * **Type**: `string` * **Default**: `requested` * **Importance**: Medium * **Valid values / Notes**: Allowed values are case-insensitive: `required`, `requested`. #### `transaction.boundary` Permitted values are: poll, interval, connector. If set to 'poll', a new producer transaction will be started and committed for every batch of records that each task from this connector provides to Connect. If set to 'connector', relies on connector-defined transaction boundaries; note that not all connectors are capable of defining their own transaction boundaries, and in that case, attempts to instantiate a connector with this value will fail. Finally, if set to 'interval', commits transactions only after a user-defined time interval has passed. * **Type**: `string` * **Default**: `poll` * **Importance**: Medium * **Valid values / Notes**: Allowed values are case-insensitive: `interval`, `poll`, `connector`. #### `transaction.boundary.interval.ms` If 'transaction.boundary' is set to 'interval', determines the interval for producer transaction commits by connector tasks. If unset, defaults to the value of the worker-level 'offset.flush.interval.ms' property. It has no effect if a different transaction.boundary is specified. * **Type**: `long` * **Default**: None * **Importance**: Low * **Valid values / Notes**: Must be at least `0`; applies only when `transaction.boundary=interval`, and otherwise defaults to the worker `offset.flush.interval.ms` value when unset. #### `offsets.storage.topic` The name of a separate offsets topic to use for this connector. If empty or not specified, the worker’s global offsets topic name will be used. If specified, the offsets topic will be created if it does not already exist on the Kafka cluster targeted by this connector (which may be different from the one used for the worker's global offsets topic if the bootstrap.servers property of the connector's producer has been overridden from the worker's). Only applicable in distributed mode; in standalone mode, setting this property will have no effect. * **Type**: `string` * **Default**: None * **Importance**: Low * **Valid values / Notes**: Must be a non-empty topic name; applies only in distributed mode, and uses the worker global offsets topic when unset. ### Topics and Database Connection #### `topic.prefix` Topic prefix that identifies and provides a namespace for the particular database server/cluster is capturing changes. The topic prefix should be unique across all other connectors, since it is used as a prefix for all Kafka topic names that receive events emitted by this connector. Only alphanumeric characters, hyphens, dots and underscores must be accepted. * **Type**: `string` * **Default**: None * **Importance**: High * **Valid values / Notes**: This ConfigDef declares no additional public value range. * **Required**: Yes #### `database.hostname` Resolvable hostname or IP address of the database server. * **Type**: `string` * **Default**: None * **Importance**: High * **Valid values / Notes**: This ConfigDef declares no additional public value range. * **Required**: Yes #### `database.port` Port of the database server. * **Type**: `int` * **Default**: `5433` * **Importance**: High * **Valid values / Notes**: This ConfigDef declares no additional public value range. #### `database.user` Name of the database user to be used when connecting to the database. * **Type**: `string` * **Default**: None * **Importance**: High * **Valid values / Notes**: This ConfigDef declares no additional public value range. * **Required**: Yes #### `database.password` Password of the database user to be used when connecting to the database. * **Type**: `password` * **Default**: None * **Importance**: High * **Valid values / Notes**: Provide it through secrets management and do not write the actual password to ordinary configuration files or logs. #### `database.dbname` The name of the database from which the connector should capture changes * **Type**: `string` * **Default**: None * **Importance**: High * **Valid values / Notes**: This ConfigDef declares no additional public value range. * **Required**: Yes #### `database.initial.statements` A semicolon separated list of SQL statements to be executed when a JDBC connection to the database is established. Note that the connector may establish JDBC connections at its own discretion, so this should typically be used for configuration of session parameters only, but not for executing DML statements. Use doubled semicolon (';;') to use a semicolon as a character and not as a delimiter. * **Type**: `string` * **Default**: None * **Importance**: Low * **Valid values / Notes**: This ConfigDef declares no additional public value range. #### `database.tcpKeepAlive` Enable or disable TCP keep-alive probe to avoid dropping TCP connection * **Type**: `boolean` * **Default**: `true` * **Importance**: Medium * **Valid values / Notes**: This ConfigDef declares no additional public value range. ### SSL and Connection Routing #### `database.sslmode` Controls the SSL mode used for the YugabyteDB YSQL connection. * **Type**: `string` * **Default**: `prefer` * **Importance**: Medium * **Valid values / Notes**: Allowed values: `allow`, `prefer`, `disable`, `verify-ca`, `require`, `verify-full`. #### `database.sslcert` File containing the SSL Certificate for the client. See the Postgres SSL docs for further information * **Type**: `string` * **Default**: None * **Importance**: Medium * **Valid values / Notes**: This ConfigDef declares no additional public value range. #### `database.sslpassword` Password to access the client private key from the file specified by 'database.sslkey'. See the Postgres SSL docs for further information * **Type**: `password` * **Default**: None * **Importance**: Medium * **Valid values / Notes**: Provide it through secrets management and do not write the actual password to ordinary configuration files or logs. #### `database.sslrootcert` File containing the root certificate(s) against which the server is validated. See the Postgres JDBC SSL docs for further information * **Type**: `string` * **Default**: None * **Importance**: Medium * **Valid values / Notes**: This ConfigDef declares no additional public value range. #### `database.sslkey` File containing the SSL private key for the client. See the Postgres SSL docs for further information * **Type**: `string` * **Default**: None * **Importance**: Medium * **Valid values / Notes**: This ConfigDef declares no additional public value range. #### `database.sslfactory` A name of class to that creates SSL Sockets. Use com.yugabyte.ssl.NonValidatingFactory to disable SSL validation in development environments * **Type**: `string` * **Default**: None * **Importance**: Medium * **Valid values / Notes**: This ConfigDef declares no additional public value range. #### `yb.load.balance.connections` This config determines load-balance property in the connection url. Supported values are 'true', 'only-primary', 'only-rr', 'prefer-primary', 'prefer-rr' and 'false' * **Type**: `string` * **Default**: `only-primary` * **Importance**: Low * **Valid values / Notes**: This ConfigDef declares no additional public value range. ### Logical Replication and Slots #### `plugin.name` Specifies the logical decoding plugin installed and supported on the server. * **Type**: `string` * **Default**: `yboutput` * **Importance**: Medium * **Valid values / Notes**: Allowed values: `decoderbufs`, `yboutput`, `pgoutput`. The validated recommended path uses `yboutput`. #### `slot.name` Specifies the logical decoding replication slot used to stream changes. * **Type**: `string` * **Default**: `debezium` * **Importance**: Medium * **Valid values / Notes**: Use lowercase letters, numbers, and underscores, with a maximum length of 63 characters. #### `slot.lsn.type` LSN type being used with the replication slot * **Type**: `string` * **Default**: `SEQUENCE` * **Importance**: Medium * **Valid values / Notes**: Allowed values: `sequence`, `hybrid_time`. #### `publication.name` Specifies the publication used to stream changes. * **Type**: `string` * **Default**: `dbz_publication` * **Importance**: Medium * **Valid values / Notes**: This ConfigDef declares no additional public value range. #### `publication.autocreate.mode` Controls whether and how the connector creates a missing publication. * **Type**: `string` * **Default**: `all_tables` * **Importance**: Medium * **Valid values / Notes**: Allowed values: `filtered`, `disabled`, `all_tables`. Pre-create the publication when using `disabled`. #### `replica.identity.autoset.values` Applies only when streaming changes using pgoutput.Determines the value for Replica Identity at table level. This option will overwrite the existing value in databaseA comma-separated list of regular expressions that match fully-qualified tables and Replica Identity value to be used in the table. Each expression must match the pattern ' : ', where the table names could be defined as (SCHEMA\_NAME.TABLE\_NAME), and the replica identity values are: DEFAULT - Records the old values of the columns of the primary key, if any. This is the default for non-system tables.INDEX index\_name - Records the old values of the columns covered by the named index, that must be unique, not partial, not deferrable, and include only columns marked NOT NULL. If this index is dropped, the behavior is the same as NOTHING.FULL - Records the old values of all columns in the row\.NOTHING - Records no information about the old row. This is the default for system tables. * **Type**: `string` * **Default**: None * **Importance**: Medium * **Valid values / Notes**: This ConfigDef declares no additional public value range. #### `slot.drop.on.stop` Whether or not to drop the logical replication slot when the connector finishes orderly. By default the replication is kept so that on restart progress can resume from the last recorded location * **Type**: `boolean` * **Default**: `false` * **Importance**: Medium * **Valid values / Notes**: This ConfigDef declares no additional public value range. #### `slot.stream.params` Any optional parameters used by logical decoding plugin. Semi-colon separated. E.g. 'add-tables=public.table,public.table2;include-lsn=true' * **Type**: `string` * **Default**: None * **Importance**: Low * **Valid values / Notes**: This ConfigDef declares no additional public value range. #### `slot.max.retries` How many times to retry connecting to a replication slot when an attempt fails. * **Type**: `int` * **Default**: `6` * **Importance**: Low * **Valid values / Notes**: This ConfigDef declares no additional public value range. #### `slot.retry.delay.ms` Time to wait between retry attempts when the connector fails to connect to a replication slot, given in milliseconds. Defaults to 10 seconds (10,000 ms). * **Type**: `long` * **Default**: `10000` * **Importance**: Low * **Valid values / Notes**: This ConfigDef declares no additional public value range. #### `status.update.interval.ms` Frequency for sending replication connection status updates to the server, given in milliseconds. Defaults to 10 seconds (10,000 ms). * **Type**: `int` * **Default**: `10000` * **Importance**: Medium * **Valid values / Notes**: This ConfigDef declares no additional public value range. #### `xmin.fetch.interval.ms` Specify how often (in ms) the xmin will be fetched from the replication slot. This xmin value is exposed by the slot which gives a lower bound of where a new replication slot could start from. The lower the value, the more likely this value is to be the current 'true' value, but the bigger the performance cost. The bigger the value, the less likely this value is to be the current 'true' value, but the lower the performance penalty. The default is set to 0 ms, which disables tracking xmin. * **Type**: `long` * **Default**: `0` * **Importance**: Medium * **Valid values / Notes**: This ConfigDef declares no additional public value range. #### `flush.lsn.source` Controls whether Debezium flushes the processed LSN to the source YugabyteDB database. * **Type**: `boolean` * **Default**: `true` * **Importance**: Low * **Valid values / Notes**: This ConfigDef declares no additional public value range. #### `streaming.mode` Streaming mode the connector should follow * **Type**: `string` * **Default**: `DEFAULT` * **Importance**: Low * **Valid values / Notes**: Allowed values: `default`, `parallel`. `parallel` also requires matching numbers of `slot.names`, `publication.names`, and `slot.ranges` entries. #### `slot.names` Comma separated values for multiple slot names * **Type**: `string` * **Default**: None * **Importance**: Low * **Valid values / Notes**: Used only for parallel streaming. Separate entries with commas; the count must match `publication.names` and `slot.ranges`. #### `publication.names` Comma separated values for multiple publication names * **Type**: `string` * **Default**: None * **Importance**: Low * **Valid values / Notes**: Used only for parallel streaming. Separate entries with commas; the count must match `slot.names` and `slot.ranges`. #### `slot.ranges` Semi-colon separated values for hash ranges to be polled by tasks. * **Type**: `string` * **Default**: None * **Importance**: Low * **Valid values / Notes**: Separate hash ranges with semicolons; the count must match the slots and publications, and the ranges must fully cover `0` through `65536`. #### `ysql.major.upgrade` Should be used carefully only on YSQL major upgrade. This will set yb\_ignore\_read\_time\_in\_walsender to true in the walsender session. Setting this is required to get over the catalog read errors. * **Type**: `boolean` * **Default**: `false` * **Importance**: High * **Valid values / Notes**: This ConfigDef declares no additional public value range. ### Capture Scope and Message Selection #### `skipped.operations` The comma-separated list of operations to skip during streaming, defined as: 'c' for inserts/create; 'u' for updates; 'd' for deletes, 't' for truncates, and 'none' to indicate nothing skipped. By default, only truncate operations will be skipped. * **Type**: `list` * **Default**: `["t"]` * **Importance**: Low * **Valid values / Notes**: This ConfigDef declares no additional public value range. #### `message.prefix.include.list` A comma-separated list of regular expressions that match the logical decoding message prefixes to be monitored. All prefixes are monitored by default. * **Type**: `list` * **Default**: None * **Importance**: Medium * **Valid values / Notes**: Mutually exclusive with `message.prefix.exclude.list`. #### `message.prefix.exclude.list` A comma-separated list of regular expressions that match the logical decoding message prefixes to be excluded from monitoring. * **Type**: `list` * **Default**: None * **Importance**: Medium * **Valid values / Notes**: Mutually exclusive with `message.prefix.include.list`. #### `table.include.list` The tables for which changes are to be captured * **Type**: `list` * **Default**: None * **Importance**: High * **Valid values / Notes**: Use regular expressions for fully qualified table names; mutually exclusive with `table.exclude.list`. #### `table.exclude.list` A comma-separated list of regular expressions that match the fully-qualified names of tables to be excluded from monitoring * **Type**: `list` * **Default**: None * **Importance**: Medium * **Valid values / Notes**: Use regular expressions for fully qualified table names; mutually exclusive with `table.include.list`. #### `table.ignore.builtin` Flag specifying whether built-in tables should be ignored. * **Type**: `boolean` * **Default**: `true` * **Importance**: Low * **Valid values / Notes**: This ConfigDef declares no additional public value range. #### `schema.include.list` The schemas for which events should be captured * **Type**: `list` * **Default**: None * **Importance**: High * **Valid values / Notes**: Mutually exclusive with `schema.exclude.list`. #### `schema.exclude.list` The schemas for which events must not be captured * **Type**: `list` * **Default**: None * **Importance**: Medium * **Valid values / Notes**: Mutually exclusive with `schema.include.list`. #### `column.include.list` Regular expressions matching columns to include in change events * **Type**: `list` * **Default**: None * **Importance**: Medium * **Valid values / Notes**: Use regular expressions for fully qualified column names; mutually exclusive with `column.exclude.list`. #### `column.exclude.list` Regular expressions matching columns to exclude from change events * **Type**: `list` * **Default**: None * **Importance**: Medium * **Valid values / Notes**: Use regular expressions for fully qualified column names; mutually exclusive with `column.include.list`. #### `message.key.columns` A semicolon-separated list of expressions that match fully-qualified tables and column(s) to be used as message key. Each expression must match the pattern ' : ', where the table names could be defined as (DB\_NAME.TABLE\_NAME) or (SCHEMA\_NAME.TABLE\_NAME), depending on the specific connector, and the key columns are a comma-separated list of columns representing the custom key. For any table without an explicit key configuration the table's primary key column(s) will be used as message key. Example: dbserver1.inventory.orderlines:orderId,orderLineId;dbserver1.inventory.orders:id * **Type**: `string` * **Default**: None * **Importance**: Medium * **Valid values / Notes**: This ConfigDef declares no additional public value range. ### Snapshots and Incremental Snapshots #### `snapshot.mode` Controls whether and how the connector snapshots existing data at startup. * **Type**: `string` * **Default**: `initial` * **Importance**: Medium * **Valid values / Notes**: Allowed values: `always`, `never`, `initial_only`, `initial`, `parallel`, `custom`. #### `snapshot.custom.class` When 'snapshot.mode' is set as custom, this setting must be set to specify a fully qualified class name to load (via the default class loader). This class must implement the 'Snapshotter' interface and is called on each app boot to determine whether to do a snapshot and how to build queries. * **Type**: `string` * **Default**: None * **Importance**: Medium * **Valid values / Notes**: Used only when `snapshot.mode=custom`. #### `snapshot.delay.ms` A delay period before a snapshot will begin, given in milliseconds. Defaults to 0 ms. * **Type**: `long` * **Default**: `0` * **Importance**: Low * **Valid values / Notes**: This ConfigDef declares no additional public value range. #### `snapshot.include.collection.list` This setting must be set to specify a list of tables/collections whose snapshot must be taken on creating or restarting the connector. * **Type**: `list` * **Default**: None * **Importance**: Medium * **Valid values / Notes**: This ConfigDef declares no additional public value range. #### `snapshot.fetch.size` The maximum number of records that should be loaded into memory while performing a snapshot. * **Type**: `int` * **Default**: None * **Importance**: Medium * **Valid values / Notes**: This ConfigDef declares no additional public value range. #### `snapshot.max.threads` The maximum number of threads used to perform the snapshot. Defaults to 1. * **Type**: `int` * **Default**: `1` * **Importance**: Medium * **Valid values / Notes**: This ConfigDef declares no additional public value range. #### `snapshot.lock.timeout.ms` The maximum number of millis to wait for table locks at the beginning of a snapshot. If locks cannot be acquired in this time frame, the snapshot will be aborted. Defaults to 10 seconds * **Type**: `long` * **Default**: `10000` * **Importance**: Medium * **Valid values / Notes**: This ConfigDef declares no additional public value range. #### `yb.consistent.snapshot` Whether or not to take a consistent snapshot of the tables.Disabling this option may result in duplication of some already snapshot data in the streaming phase. * **Type**: `boolean` * **Default**: `true` * **Importance**: Low * **Valid values / Notes**: This ConfigDef declares no additional public value range. #### `incremental.snapshot.chunk.size` The maximum size of chunk (number of documents/rows) for incremental snapshotting * **Type**: `int` * **Default**: `1024` * **Importance**: Medium * **Valid values / Notes**: This ConfigDef declares no additional public value range. #### `incremental.snapshot.watermarking.strategy` Specify the strategy used for watermarking during an incremental snapshot: 'insert\_insert' both open and close signal is written into signal data collection (default); 'insert\_delete' only open signal is written on signal data collection, the close will delete the relative open signal; * **Type**: `string` * **Default**: `INSERT_INSERT` * **Importance**: Low * **Valid values / Notes**: Allowed values: `insert_delete`, `insert_insert`. #### `snapshot.select.statement.overrides` This property contains a comma-separated list of fully-qualified tables (DB\_NAME.TABLE\_NAME) or (SCHEMA\_NAME.TABLE\_NAME), depending on the specific connectors. Select statements for the individual tables are specified in further configuration properties, one for each table, identified by the id 'snapshot.select.statement.overrides.\[DB\_NAME].\[TABLE\_NAME]' or 'snapshot.select.statement.overrides.\[SCHEMA\_NAME].\[TABLE\_NAME]', respectively. The value of those properties is the select statement to use when retrieving data from the specific table during snapshotting. A possible use case for large append-only tables is setting a specific point where to start (resume) snapshotting, in case a previous snapshotting was interrupted. * **Type**: `string` * **Default**: None * **Importance**: Medium * **Valid values / Notes**: This ConfigDef declares no additional public value range. #### `snapshot.tables.order.by.row.count` Controls the order in which tables are processed in the initial snapshot. A `descending` value will order the tables by row count descending. A `ascending` value will order the tables by row count ascending. A value of `disabled` (the default) will disable ordering by row count. * **Type**: `string` * **Default**: `disabled` * **Importance**: Medium * **Valid values / Notes**: Allowed values: `disabled`, `ascending`, `descending`. ### Queueing, Polling, and Recovery #### `event.processing.failure.handling.mode` Controls how the connector handles failures while processing change events. * **Type**: `string` * **Default**: `fail` * **Importance**: Medium * **Valid values / Notes**: Allowed values: `warn`, `fail`, `ignore`, `skip`. #### `max.batch.size` Maximum size of each batch of source records. Defaults to 2048. * **Type**: `int` * **Default**: `2048` * **Importance**: Medium * **Valid values / Notes**: This ConfigDef declares no additional public value range. #### `max.queue.size` Maximum size of the queue for change events read from the database log but not yet recorded or forwarded. Defaults to 8192, and should always be larger than the maximum batch size. * **Type**: `int` * **Default**: `8192` * **Importance**: Medium * **Valid values / Notes**: This ConfigDef declares no additional public value range. #### `poll.interval.ms` Time to wait for new change events to appear after receiving no events, given in milliseconds. Defaults to 500 ms. * **Type**: `long` * **Default**: `500` * **Importance**: Medium * **Valid values / Notes**: This ConfigDef declares no additional public value range. #### `max.queue.size.in.bytes` Maximum size of the queue in bytes for change events read from the database log but not yet recorded or forwarded. Defaults to 0. Mean the feature is not enabled * **Type**: `long` * **Default**: `0` * **Importance**: Medium * **Valid values / Notes**: This ConfigDef declares no additional public value range. #### `retriable.restart.connector.wait.ms` Time to wait before restarting connector after retriable exception occurs. Defaults to 10000ms. * **Type**: `long` * **Default**: `10000` * **Importance**: Low * **Valid values / Notes**: This ConfigDef declares no additional public value range. #### `query.fetch.size` The maximum number of records that should be loaded into memory while streaming. A value of '0' uses the default JDBC fetch size. * **Type**: `int` * **Default**: `0` * **Importance**: Medium * **Valid values / Notes**: This ConfigDef declares no additional public value range. #### `errors.max.retries` The maximum number of retries on connection errors before failing (-1 = no limit, 0 = disabled, > 0 = num of retries). * **Type**: `int` * **Default**: `-1` * **Importance**: Low * **Valid values / Notes**: `-1` means unlimited retries, `0` disables retries, and a positive integer sets the maximum retry count. ### Event Format and Data Types #### `provide.transaction.metadata` Enables transaction metadata extraction together with event counting * **Type**: `boolean` * **Default**: `false` * **Importance**: Low * **Valid values / Notes**: This ConfigDef declares no additional public value range. #### `decimal.handling.mode` Specify how DECIMAL and NUMERIC columns should be represented in change events, including: 'precise' (the default) uses java.math.BigDecimal to represent values, which are encoded in the change events using a binary representation and Kafka Connect's 'org.apache.kafka.connect.data.Decimal' type; 'string' uses string to represent values; 'double' represents values using Java's 'double', which may not offer the precision but will be far easier to use in consumers. * **Type**: `string` * **Default**: `precise` * **Importance**: Medium * **Valid values / Notes**: Allowed values: `string`, `double`, `precise`. #### `time.precision.mode` Time, date, and timestamps can be represented with different kinds of precisions, including: 'adaptive' (the default) bases the precision of time, date, and timestamp values on the database column's precision; 'adaptive\_time\_microseconds' like 'adaptive' mode, but TIME fields always use microseconds precision; 'connect' always represents time, date, and timestamp values using Kafka Connect's built-in representations for Time, Date, and Timestamp, which uses millisecond precision regardless of the database columns' precision. * **Type**: `string` * **Default**: `adaptive` * **Importance**: Medium * **Valid values / Notes**: Allowed values: `adaptive`, `adaptive_time_microseconds`, `connect`. #### `primary.key.hash.columns` A comma separated value having all the hash components of the primary key * **Type**: `string` * **Default**: None * **Importance**: Low * **Valid values / Notes**: This ConfigDef declares no additional public value range. #### `hstore.handling.mode` Specify how HSTORE columns should be represented in change events, including: 'json' represents values as string-ified JSON (default); 'map' represents values as a key/value map * **Type**: `string` * **Default**: `json` * **Importance**: Low * **Valid values / Notes**: Allowed values: `json`, `map`. #### `binary.handling.mode` Specify how binary (blob, binary, etc.) columns should be represented in change events, including: 'bytes' represents binary data as byte array (default); 'base64' represents binary data as base64-encoded string; 'base64-url-safe' represents binary data as base64-url-safe-encoded string; 'hex' represents binary data as hex-encoded (base16) string * **Type**: `string` * **Default**: `bytes` * **Importance**: Low * **Valid values / Notes**: Allowed values: `bytes`, `base64`, `hex`, `base64-url-safe`. #### `schema.name.adjustment.mode` Specify how schema names should be adjusted for compatibility with the message converter used by the connector, including: 'avro' replaces the characters that cannot be used in the Avro type name with underscore; 'avro\_unicode' replaces the underscore or characters that cannot be used in the Avro type name with corresponding unicode like \_uxxxx. Note: \_ is an escape sequence like backslash in Java;'none' does not apply any adjustment (default) * **Type**: `string` * **Default**: `none` * **Importance**: Low * **Valid values / Notes**: Allowed values: `none`, `avro_unicode`, `avro`. #### `interval.handling.mode` Specify how INTERVAL columns should be represented in change events, including: 'string' represents values as an exact ISO formatted string; 'numeric' (default) represents values using the inexact conversion into microseconds * **Type**: `string` * **Default**: `numeric` * **Importance**: Low * **Valid values / Notes**: Allowed values: `string`, `numeric`. #### `schema.refresh.mode` Specify the conditions that trigger a refresh of the in-memory schema for a table. 'columns\_diff' (the default) is the safest mode, ensuring the in-memory schema stays in-sync with the database table's schema at all times. 'columns\_diff\_exclude\_unchanged\_toast' instructs the connector to refresh the in-memory schema cache if there is a discrepancy between it and the schema derived from the incoming message, unless unchanged TOASTable data fully accounts for the discrepancy. This setting can improve connector performance significantly if there are frequently-updated tables that have TOASTed data that are rarely part of these updates. However, it is possible for the in-memory schema to become outdated if TOASTable columns are dropped from the table. * **Type**: `string` * **Default**: `columns_diff` * **Importance**: Medium * **Valid values / Notes**: Allowed values: `columns_diff`, `columns_diff_exclude_unchanged_toast`. #### `unavailable.value.placeholder` Specify the constant that will be provided by Debezium to indicate that the original value is a toasted value not provided by the database. If starts with 'hex:' prefix it is expected that the rest of the string represents hexadecimal encoded octets. * **Type**: `string` * **Default**: `__debezium_unavailable_value` * **Importance**: Medium * **Valid values / Notes**: This ConfigDef declares no additional public value range. #### `converters` Optional list of custom converters that would be used instead of default ones. The converters are defined using ' .type' config option and configured using options ' . ' * **Type**: `string` * **Default**: None * **Importance**: Low * **Valid values / Notes**: This ConfigDef declares no additional public value range. #### `post.processors` Optional list of post processors. The processors are defined using ' .type' config option and configured using options ' ' * **Type**: `string` * **Default**: None * **Importance**: Low * **Valid values / Notes**: This ConfigDef declares no additional public value range. #### `tombstones.on.delete` Whether delete operations should be represented by a delete event and a subsequent tombstone event (true) or only by a delete event (false). Emitting the tombstone event (the default behavior) allows Kafka to completely delete all events pertaining to the given key once the source record got deleted. * **Type**: `boolean` * **Default**: `true` * **Importance**: Medium * **Valid values / Notes**: This ConfigDef declares no additional public value range. #### `topic.naming.strategy` The name of the TopicNamingStrategy class that should be used to determine the topic name for data change, schema change, transaction, heartbeat event etc. * **Type**: `class` * **Default**: `io.debezium.schema.SchemaTopicNamingStrategy` * **Importance**: Medium * **Valid values / Notes**: This ConfigDef declares no additional public value range. #### `include.schema.comments` Whether the connector parse table and column's comment to metadata object. Note: Enable this option will bring the implications on memory usage. The number and size of ColumnImpl objects is what largely impacts how much memory is consumed by the Debezium connectors, and adding a String to each of them can potentially be quite heavy. The default is 'false'. * **Type**: `boolean` * **Default**: `false` * **Importance**: Medium * **Valid values / Notes**: This ConfigDef declares no additional public value range. #### `include.unknown.datatypes` Specify whether the fields of data type not supported by Debezium should be processed: 'false' (the default) omits the fields; 'true' converts the field into an implementation dependent binary representation. * **Type**: `boolean` * **Default**: `false` * **Importance**: Medium * **Valid values / Notes**: This ConfigDef declares no additional public value range. #### `sourceinfo.struct.maker` The name of the SourceInfoStructMaker class that returns SourceInfo schema and struct. * **Type**: `class` * **Default**: `io.debezium.connector.postgresql.PostgresSourceInfoStructMaker` * **Importance**: Low * **Valid values / Notes**: This ConfigDef declares no additional public value range. ### Signals, Notifications, and Field Processing #### `heartbeat.interval.ms` Length of an interval in milli-seconds in in which the connector periodically sends heartbeat messages to a heartbeat topic. Use 0 to disable heartbeat messages. Disabled by default. * **Type**: `int` * **Default**: `0` * **Importance**: Medium * **Valid values / Notes**: This ConfigDef declares no additional public value range. #### `heartbeat.topics.prefix` The prefix that is used to name heartbeat topics.Defaults to \_\_debezium-heartbeat. * **Type**: `string` * **Default**: `__debezium-heartbeat` * **Importance**: Low * **Valid values / Notes**: This ConfigDef declares no additional public value range. #### `heartbeat.action.query` The query executed with every heartbeat. * **Type**: `string` * **Default**: None * **Importance**: Low * **Valid values / Notes**: This ConfigDef declares no additional public value range. #### `signal.data.collection` The name of the data collection that is used to send signals/commands to Debezium. Signaling is disabled when not set. * **Type**: `string` * **Default**: None * **Importance**: Medium * **Valid values / Notes**: This ConfigDef declares no additional public value range. #### `signal.poll.interval.ms` Interval for looking for new signals in registered channels, given in milliseconds. Defaults to 5 seconds. * **Type**: `long` * **Default**: `5000` * **Importance**: Medium * **Valid values / Notes**: This ConfigDef declares no additional public value range. #### `signal.enabled.channels` List of channels names that are enabled. Source channel is enabled by default * **Type**: `list` * **Default**: `["source"]` * **Importance**: Medium * **Valid values / Notes**: This ConfigDef declares no additional public value range. #### `notification.enabled.channels` List of notification channels names that are enabled. * **Type**: `list` * **Default**: None * **Importance**: Medium * **Valid values / Notes**: This ConfigDef declares no additional public value range. #### `notification.sink.topic.name` The name of the topic for the notifications. This is required in case 'sink' is in the list of enabled channels * **Type**: `string` * **Default**: None * **Importance**: High * **Valid values / Notes**: This ConfigDef declares no additional public value range. #### `custom.metric.tags` The custom metric tags will accept key-value pairs to customize the MBean object name which should be appended the end of regular name, each key would represent a tag for the MBean object name, and the corresponding value would be the value of that tag the key is. For example: k1=v1,k2=v2 * **Type**: `list` * **Default**: None * **Importance**: Low * **Valid values / Notes**: This ConfigDef declares no additional public value range. #### `column.mask.hash.([^.]+).with.salt.(.+)` A comma-separated list of regular expressions matching fully-qualified names of columns that should be masked by hashing the input. Using the specified hash algorithms and salt. * **Type**: `string` * **Default**: None * **Importance**: Medium * **Valid values / Notes**: This ConfigDef declares no additional public value range. #### `column.mask.with.(d+).chars` A comma-separated list of regular expressions matching fully-qualified names of columns that should be masked with configured amount of asterisk ('\*') characters. * **Type**: `string` * **Default**: None * **Importance**: Medium * **Valid values / Notes**: This ConfigDef declares no additional public value range. #### `column.truncate.to.(d+).chars` A comma-separated list of regular expressions matching fully-qualified names of columns that should be truncated to the configured amount of characters. * **Type**: `int` * **Default**: None * **Importance**: Medium * **Valid values / Notes**: This ConfigDef declares no additional public value range. #### `column.propagate.source.type` A comma-separated list of regular expressions matching fully-qualified names of columns that adds the column’s original type and original length as parameters to the corresponding field schemas in the emitted change records. * **Type**: `list` * **Default**: None * **Importance**: Medium * **Valid values / Notes**: This ConfigDef declares no additional public value range. #### `datatype.propagate.source.type` A comma-separated list of regular expressions matching the database-specific data type names that adds the data type's original type and original length as parameters to the corresponding field schemas in the emitted change records. * **Type**: `list` * **Default**: None * **Importance**: Medium * **Valid values / Notes**: This ConfigDef declares no additional public value range. ## Best Practices ### Establish a Baseline and Continue Synchronization During Initial Onboarding **Applicable business scenario**: You are onboarding existing business tables for the first time and need to write the current data to Kafka before seamlessly receiving subsequent changes. This approach is suitable for the initialization stage when downstream systems do not yet have a complete baseline. **Configuration example**: Keep the following property in the Quick Start configuration: ```properties theme={null} snapshot.mode=initial ``` **Key considerations**: Before starting the connector, confirm that the slot, publication, logical decoding plugin, and account permissions are ready. Snapshot records use the READ operation type. After the snapshot completes, the connector transitions to streaming. Downstream systems should process records idempotently by primary key and allow record replay during failure recovery or around offset commit boundaries. ### Read Only Subsequent Changes When a Data Baseline Already Exists **Applicable business scenario**: A downstream system has already completed historical data initialization through another controlled process and needs to receive only new changes from the logical replication position, avoiding another full snapshot from the connector. **Configuration example**: Change the snapshot mode in the Quick Start configuration to: ```properties theme={null} snapshot.mode=never ``` **Key considerations**: Before using this mode, confirm that the downstream baseline is consistent with the replication starting position and that the replication slot still retains the required history. This configuration does not backfill existing data from before the slot starting position. If the slot is deleted or the required replication history has been removed, recovery from the expected position cannot be guaranteed. ## Monitoring ### What to Monitor Monitor Kafka Connect health, connector and task status, throughput, latency, offset commits, errors, retries, and worker JVM signals. Monitor DLQ activity only when the corresponding error handling is enabled. ### Import the Grafana Dashboard Confirm that Connect metrics are available to a Grafana data source and that collected labels meet the dashboard filter requirements. Download the [Kafka Connect Dashboard](https://automq-download-center.oss-cn-hangzhou.aliyuncs.com/connect-dashboard/automq-connect-cluster-dashboard.json), import the JSON into Grafana, and select the corresponding data source. ## Limitations * Parallel streaming requires capturing only one table and creates a task for each slot, publication, and hash range combination. The three lists must contain the same number of entries, and the ranges must completely cover `0` through `65536`. * The connector does not guarantee global ordering across topics, Kafka partitions, or multiple parallel tasks. * A failure before Kafka Connect offsets are persisted may cause records to be replayed. Standard operation cannot be treated as providing unconditional end-to-end exactly-once delivery, so downstream systems should provide idempotency or deduplication. * Recovery depends on the replication slot continuing to exist and retaining the required replication history. If the slot is deleted or the history has been removed, the connector cannot guarantee that reading will continue from the original position. * Snapshot modes that do not enter streaming, such as `initial_only`, provide only an existing-data snapshot and do not provide continuous CDC. ## FAQ ### Why Can't the Connector Connect to YugabyteDB? A mismatched hostname, port, database name, account permissions, or logical decoding plugin can cause startup to fail. Check `database.hostname`, `database.port`, `database.dbname`, and `plugin.name`. Confirm that the account has the permissions required for login and logical replication and that the worker can access the YSQL service. After correcting the configuration, restart the connector and check the task status. ### Why Wasn't the Expected Data Topic Created? First, check whether `topic.prefix` follows the naming rules and whether the connector has actually captured matching data changes. Regular-table topic names also contain the schema and table name. Confirm that the downstream system subscribes to the complete topic name, and check whether the publication includes the target table and whether the replication slot is available. ### Why Are There Duplicate Records After a Restart? If a failure occurs after database changes have been sent to Kafka but before the corresponding offsets are persisted, those changes may be read again during recovery. Check the Connect offset commit status and replication slot position, and have the downstream system perform idempotent writes or deduplication using a stable business key or message key. Do not rely solely on connector restarts to prevent duplicates. ### Why Are No Changes Received Continuously After the Initial Snapshot Completes? Check whether `snapshot.mode` is set to `initial_only`, which does not enter continuous streaming after the snapshot completes. If continuous CDC is required, use a mode that includes a streaming phase, and confirm that the slot, publication, plugin, and database permissions remain valid. # Mutual TLS (mTLS) Authentication Source: https://docs.automq.com/automq-cloud/manage-security/authentication/mutual-tls-mtls-authentication Configure mTLS client authentication for AutoMQ Kafka clients. Mutual TLS (mTLS) authenticates both sides of a Kafka connection. The client validates the AutoMQ server certificate, and AutoMQ validates a client certificate issued by a trusted client CA. AutoMQ maps the certificate identity to a Kafka ACL user and applies ACL authorization. ## Certificate responsibilities Server certificate responsibilities depend on the DNS Zone mode selected when the instance is created. In both modes, you provide the client CA and issue a unique client certificate for each client identity. | DNS Zone mode | Server certificate | Client certificates | | - | - | - | | AutoMQ Managed Public DNS Zone | AutoMQ provides, installs, and renews the authoritative server certificate. Do not upload a user-issued Server Certificate or Private Key. | You provide the client CA certificate and use the client CA private key to issue client certificates. | | Customer-managed Private DNS Zone | You provide and rotate the server CA, Server Certificate, and Private Key. The Server Certificate SAN must match the private endpoint domain. | You provide the client CA and use its private key to issue client certificates. If the server and client use different CAs, combine their public certificates into one CA bundle for upload. | > [!NOTE] > > Select the DNS Zone mode and enable mTLS when you create the instance. Existing instances cannot be changed from an unencrypted listener to mTLS. ## Configuration workflow Complete the following steps in order: 1. Create or select a client CA and issue a Client Certificate. This step is required for both DNS Zone modes. 2. Prepare the server identity. AutoMQ manages it for a Public DNS Zone; you provide it for a Private DNS Zone. 3. Configure the AutoMQ instance. 4. Configure the Kafka client. ## Step 1: Create a client CA and Client Certificate Both DNS Zone modes require a client CA and a Client Certificate. Use your organization's certificate management system when available. If you need to create and maintain a private client CA, use the following procedure as a reference. > [!WARNING] > > Protect `client-ca.key` and `client.key` according to your organization's key management requirements. For client authentication, upload `client-ca.crt`, but never upload the client CA private key or Client Private Key. A customer-managed Private DNS Zone also requires the server materials described in Step 3. ### Create a client CA Create `client-ca.cnf`. Replace the distinguished-name values before running the commands. ```ini theme={null} [ req ] prompt = no distinguished_name = distinguished_name x509_extensions = extensions [ distinguished_name ] organizationName = commonName = [ extensions ] basicConstraints = critical,CA:true,pathlen:1 keyUsage = critical,keyCertSign,cRLSign subjectKeyIdentifier = hash authorityKeyIdentifier = keyid:always,issuer ``` Generate the client CA private key and certificate: ```bash theme={null} openssl genrsa -out client-ca.key 2048 chmod 400 client-ca.key openssl req -new -x509 \ -config client-ca.cnf \ -key client-ca.key \ -days 3650 \ -out client-ca.crt ``` ### Issue a Client Certificate Create the corresponding Kafka ACL user before issuing the Client Certificate. Unless you configure a different principal mapping rule, set the certificate Common Name (CN) to the ACL username. The default principal mapping extracts the CN from the Client Certificate: ```text theme={null} RULE:.*CN=([^,]+).*/$1/ ``` For example, a certificate with `CN=user01` maps to the ACL user `user01`. Create `client.cnf`: ```ini theme={null} [ req ] prompt = no distinguished_name = distinguished_name req_extensions = extensions [ distinguished_name ] organizationName = commonName = [ extensions ] basicConstraints = critical,CA:false keyUsage = critical,digitalSignature,keyEncipherment extendedKeyUsage = clientAuth ``` Generate the Client Private Key and CSR, and then sign the CSR with the client CA: ```bash theme={null} openssl genrsa -out client.key 2048 chmod 400 client.key openssl req -new \ -config client.cnf \ -key client.key \ -out client.csr openssl x509 -req \ -in client.csr \ -CA client-ca.crt \ -CAkey client-ca.key \ -CAcreateserial \ -days 365 \ -extfile client.cnf \ -extensions extensions \ -out client.crt ``` Verify the certificate identity, purpose, and validity period: ```bash theme={null} openssl x509 -in client.crt -noout -subject -issuer -dates -ext extendedKeyUsage ``` ## Step 2: Prepare the server identity ### AutoMQ Managed Public DNS Zone No user action is required. AutoMQ provides, installs, and renews the authoritative Server Certificate. Do not create or upload a Server Certificate or Server Private Key. ### Customer-managed Private DNS Zone You must provide a Server Certificate whose Subject Alternative Name (SAN) covers the AutoMQ private endpoint names associated with the Private DNS Zone. Use a certificate issued by your organization's certificate authority when available. The following reference procedure uses the client CA created in Step 1 to sign the Server Certificate. If your organization requires separate server and client CAs, use the server CA to sign the Server Certificate and retain both public CA certificates for the CA bundle in Step 3. Create `server.cnf`. Use the exact DNS name or wildcard required by the instance endpoint. Do not rely on the Common Name for hostname verification. ```ini theme={null} [ req ] prompt = no distinguished_name = distinguished_name req_extensions = extensions [ distinguished_name ] organizationName = commonName = [ extensions ] basicConstraints = critical,CA:false keyUsage = critical,digitalSignature,keyEncipherment extendedKeyUsage = serverAuth subjectAltName = @alt_names [ alt_names ] DNS.1 = ``` Generate the Server Private Key and CSR, and then sign the CSR: ```bash theme={null} openssl genrsa -out server.key 2048 chmod 400 server.key openssl req -new \ -config server.cnf \ -key server.key \ -out server.csr openssl x509 -req \ -in server.csr \ -CA client-ca.crt \ -CAkey client-ca.key \ -CAserial client-ca.srl \ -days 365 \ -extfile server.cnf \ -extensions extensions \ -out server.crt ``` Verify the certificate SAN, purpose, and validity period: ```bash theme={null} openssl x509 -in server.crt -noout -subject -issuer -dates -ext subjectAltName,extendedKeyUsage ``` ## Step 3: Configure AutoMQ ### AutoMQ Managed Public DNS Zone 1. When creating the instance, select `Public DNS Zone` and the AutoMQ managed mode. 2. Enable the mTLS listener. 3. Upload `client-ca.crt` as the Client CA certificate. 4. Do not upload a Server Certificate or Server Private Key. 5. Create the ACL user that matches the Client Certificate identity and grant only the required Topic and Consumer Group permissions. ### Customer-managed Private DNS Zone 1. When creating the instance, select the customer-managed `Private DNS Zone` and enable the mTLS listener. 2. Upload a PEM CA bundle that contains the client CA and server CA public certificates. If one CA issues both certificates as in this example, upload `client-ca.crt` once. 3. Upload `server.crt` as the Server Certificate and `server.key` as the Server Private Key. 4. Create the ACL user that matches the Client Certificate identity and grant only the required Topic and Consumer Group permissions. ## Step 4: Configure a Kafka client Convert the Client Certificate and Client Private Key to a PKCS#12 keystore: ```bash theme={null} openssl pkcs12 -export \ -in client.crt \ -inkey client.key \ -certfile client-ca.crt \ -out client.p12 \ -name automq-client \ -password pass: ``` Configure the Kafka client: ```properties theme={null} bootstrap.servers= security.protocol=SSL ssl.keystore.type=PKCS12 ssl.keystore.location=/path/to/client.p12 ssl.keystore.password= ssl.key.password= ``` For an AutoMQ Managed Public DNS Zone, the client normally trusts the public Server Certificate through the operating system or Java runtime. No custom server truststore is required unless your organization requires one. For a customer-managed Private DNS Zone whose server CA is not already trusted, import the server CA certificate into a client truststore. In the single-CA example above, use `client-ca.crt` as the server CA certificate. ```bash theme={null} keytool -importcert \ -alias automq-server-ca \ -file .crt \ -keystore truststore.jks \ -storepass ``` Add the truststore settings to the client configuration: ```properties theme={null} ssl.truststore.type=JKS ssl.truststore.location=/path/to/truststore.jks ssl.truststore.password= ``` ## Certificate expiration responsibility * **AutoMQ Managed Public DNS Zone:** AutoMQ monitors and renews the server certificate. You monitor and rotate the client CA and all client certificates. * **Customer-managed Private DNS Zone:** You monitor and rotate the server CA, Server Certificate, client CA, and client certificates. The server exposes `kafka_stream_cert_expiry_timestamp_milliseconds` and `kafka_stream_cert_days_remaining` for the installed server certificate. For collection methods, see [Monitoring and Alerting with Prometheus](/automq-cloud/monitoring-alert/monitoring-alert-via-prometheus). Client certificate monitoring must be implemented in your certificate management process. # SASL Authentication Source: https://docs.automq.com/automq-cloud/manage-security/authentication/sasl-authentication Configure SASL_PLAINTEXT or SASL_SSL authentication for AutoMQ Kafka clients. AutoMQ supports SASL authentication with Kafka ACL users. Use `SASL_PLAINTEXT` only on a trusted private network. Use `SASL_SSL` to encrypt client traffic with TLS. ## Enable SASL\_PLAINTEXT ### Server configuration When you create the instance, enable SASL authentication and the `SASL_PLAINTEXT` listener. Create an ACL user and grant only the Topic and Consumer Group permissions required by the application. ### Client configuration Configure the Kafka client with the credentials created in AutoMQ. The following example uses SASL/PLAIN: ```properties theme={null} bootstrap.servers= security.protocol=SASL_PLAINTEXT sasl.mechanism=PLAIN sasl.jaas.config=org.apache.kafka.common.security.plain.PlainLoginModule required username="" password=""; ``` ## Enable SASL\_SSL `SASL_SSL` combines SASL client authentication with TLS server authentication and transport encryption. Server certificate responsibilities depend on the DNS Zone mode selected when the instance is created. | DNS Zone mode | Server certificate responsibility | User-provided server TLS material | | - | - | - | | AutoMQ Managed Public DNS Zone | AutoMQ provides and manages the authoritative server certificate for the instance endpoint. | None. Do not upload a self-signed CA, Server Certificate, or Private Key. | | Customer-managed Private DNS Zone | You provide and rotate a server certificate whose Subject Alternative Name matches the private endpoint domain. | Server CA certificate, Server Certificate, and Private Key. | > [!NOTE] > > Select the DNS Zone mode and enable `SASL_SSL` when you create the instance. Existing instances cannot be changed from an unencrypted listener to `SASL_SSL`. ### Use an AutoMQ Managed Public DNS Zone 1. When creating the instance, select **Public DNS Zone** and the AutoMQ managed mode. 2. Enable the `SASL_SSL` listener and configure SASL authentication. 3. Do not upload user-managed server certificate files. AutoMQ provisions and renews the server certificate. 4. Create an ACL user and grant the required resource permissions. Because the server certificate is issued by a public certificate authority, Kafka clients normally use the trust anchors supplied by the operating system or Java runtime. Do not configure a custom truststore unless your organization requires one. ```properties theme={null} bootstrap.servers= security.protocol=SASL_SSL sasl.mechanism=PLAIN sasl.jaas.config=org.apache.kafka.common.security.plain.PlainLoginModule required username="" password=""; ``` ### Use a customer-managed Private DNS Zone For a customer-managed Private DNS Zone, you must provide a CA certificate, Server Certificate, and Server Private Key. Use certificates issued by your organization's certificate authority when available. If you need to create and maintain a private CA, use the following procedure as a reference. > [!WARNING] > > The following commands create a private CA. Protect `ca.key` and `server.key` according to your organization's key management requirements. Do not upload the CA private key to AutoMQ or distribute either private key to Kafka clients. #### 1. Create a private CA Create `ca.cnf`. Replace the distinguished-name values before running the commands. ```ini theme={null} [ req ] prompt = no distinguished_name = distinguished_name x509_extensions = extensions [ distinguished_name ] organizationName = commonName = [ extensions ] basicConstraints = critical,CA:true,pathlen:1 keyUsage = critical,keyCertSign,cRLSign subjectKeyIdentifier = hash authorityKeyIdentifier = keyid:always,issuer ``` Generate the CA private key and CA certificate: ```bash theme={null} openssl genrsa -out ca.key 2048 chmod 400 ca.key openssl req -new -x509 \ -config ca.cnf \ -key ca.key \ -days 3650 \ -out ca.crt ``` #### 2. Issue the Server Certificate Create `server.cnf`. The Subject Alternative Name (SAN) must cover the AutoMQ private endpoint names associated with the Private DNS Zone. Use the exact DNS name or wildcard required by the instance endpoint. Do not rely on the Common Name for hostname verification. ```ini theme={null} [ req ] prompt = no distinguished_name = distinguished_name req_extensions = extensions [ distinguished_name ] organizationName = commonName = [ extensions ] basicConstraints = critical,CA:false keyUsage = critical,digitalSignature,keyEncipherment extendedKeyUsage = serverAuth subjectAltName = @alt_names [ alt_names ] DNS.1 = ``` Generate the Server Private Key and certificate signing request (CSR), and then sign the CSR with the private CA: ```bash theme={null} openssl genrsa -out server.key 2048 chmod 400 server.key openssl req -new \ -config server.cnf \ -key server.key \ -out server.csr openssl x509 -req \ -in server.csr \ -CA ca.crt \ -CAkey ca.key \ -CAcreateserial \ -days 365 \ -extfile server.cnf \ -extensions extensions \ -out server.crt ``` Verify the certificate SAN and validity period before uploading it: ```bash theme={null} openssl x509 -in server.crt -noout -subject -issuer -dates -ext subjectAltName ``` #### 3. Configure AutoMQ 1. When creating the instance, select the customer-managed **Private DNS Zone** and enable the `SASL_SSL` listener. 2. Upload `ca.crt` as the Server CA certificate, `server.crt` as the Server Certificate, and `server.key` as the Private Key. 3. Create an ACL user and grant only the Topic and Consumer Group permissions required by the application. #### 4. Configure a Kafka client Import `ca.crt` into the client truststore when the client runtime does not already trust the private CA: ```bash theme={null} keytool -importcert \ -alias automq-server-ca \ -file ca.crt \ -keystore truststore.jks \ -storepass ``` ```properties theme={null} bootstrap.servers= security.protocol=SASL_SSL sasl.mechanism=PLAIN sasl.jaas.config=org.apache.kafka.common.security.plain.PlainLoginModule required username="" password=""; ssl.truststore.type=JKS ssl.truststore.location=/path/to/truststore.jks ssl.truststore.password= ``` ## Certificate expiration responsibility * **AutoMQ Managed Public DNS Zone:** AutoMQ monitors and renews the server certificate. You do not rotate the server certificate. * **Customer-managed Private DNS Zone:** You are responsible for monitoring and rotating the server CA and certificate before expiration. Use `kafka_stream_cert_expiry_timestamp_milliseconds` and `kafka_stream_cert_days_remaining` to monitor the installed server certificate. For collection methods, see [Monitoring and Alerting with Prometheus](/automq-cloud/monitoring-alert/monitoring-alert-via-prometheus). # Data Encryption at Rest Source: https://docs.automq.com/automq-cloud/manage-security/data-encryption-at-rest AutoMQ ensures transparent data encryption at rest with cloud-native scalability and Kafka compatibility, utilizing cloud vendor services for robust data security. AutoMQ provides at-rest encryption for application data, ensuring that data encryption is fully transparent to the user's application and is facilitated through the cloud vendor's storage services. This document outlines the steps to configure at-rest data encryption. ## **Operation Principle** In AutoMQ's BYOC service, data storage is primarily divided into two categories: * **Object Storage:** This service is utilized for storing message data, system logs, metrics, and other data types. * **Block Storage:** This service is employed for storing control plane metadata, such as Kafka KRaft, instances, and accounts. Both types of storage services use transparent data encryption provided by cloud vendors to encrypt data at rest. Simply enable encryption of data at rest during the creation of the BYOC console and instance to achieve transparent encryption. For more information on how cloud storage implements transparent encryption, you can refer to the following: * [https://docs.aws.amazon.com/AmazonS3/latest/userguide/UsingEncryption.html](https://docs.aws.amazon.com/AmazonS3/latest/userguide/UsingEncryption.html) * [https://docs.aws.amazon.com/ebs/latest/userguide/ebs-encryption.html](https://docs.aws.amazon.com/ebs/latest/userguide/ebs-encryption.html) > [!TIP] > > **Usage Restrictions:** > > The encryption keys for AutoMQ BYOC service storage are managed by the cloud vendor, and BYOK (Bring Your Own Key) custom keys are not supported. > > The data encryption feature is only supported on AWS. If needed, contact us via [Obtaining Services▸](/automq-cloud/support/obtaining-services). ## Configuration Instructions When enabling end-to-end static data encryption, follow the steps outlined below. It's important to enable this feature both during the creation of a BYOC environment console and when setting up an instance. Making changes to existing environment consoles or instances is not supported. 1. When creating a BYOC console, **enable the DataEncryption option**. ![](https://mintcdn.com/automq/HveFFwfWarPtnDnE/automq-cloud/manage-security/data-encryption-at-rest/1.webp?fit=max\&auto=format\&n=HveFFwfWarPtnDnE\&q=85\&s=c6176fc511fa19782ebf83a81ce87afd) 2. When creating an instance, click on advanced options and **enable DataEncryption**. ![](https://mintcdn.com/automq/HveFFwfWarPtnDnE/automq-cloud/manage-security/data-encryption-at-rest/2.webp?fit=max\&auto=format\&n=HveFFwfWarPtnDnE\&q=85\&s=b299c5837971ff1248cc49ff98ff5d0a) # Manage Kafka ACLs Source: https://docs.automq.com/automq-cloud/manage-security/manage-kafka-acls Enable Kafka ACLs with AutoMQ, ensuring cloud-native scalability, full Kafka compatibility, and cost efficiency. Learn crucial tips for optimal security. This article introduces the basic concepts of Kafka ACL functionality, relevant constraints, and how to enable and use ACL functionality in AutoMQ instances. ## Kafka ACL Concepts ### Overview Apache Kafka provides ACL (Access Control List) functionality, supporting authentication and authorization for Kafka clients. AutoMQ is fully compatible with Apache Kafka, so when using an AutoMQ instance, the Kafka ACL functionality can be enabled and utilized. > [!TIP] > > When using Kafka ACL, be aware of the following constraints: > > **Version Constraint:** Ensure that the AutoMQ instance version is >= 1.10.x. If not, upgrade the version before enabling it. > > **Optional Enablement:** By default, AutoMQ instances do not have ACL enabled. Users can manually enable ACL during instance creation or afterward. > > **Access Protocols:** AutoMQ supports accessing the cluster through the VPC internal network using SASL\_PLAINTEXT, SASL\_SSL, and mTLS protocols. > > **Resource Types:** AutoMQ supports ACL permission control for resource types such as Kafka Cluster, Topic, Consumer Group, and Transaction ID, but not for DelegationToken. If needed, refer to [Obtaining Services▸](/automq-cloud/support/obtaining-services) to contact us. ### ACL User In the Kafka ACL feature, the user is the subject for ACL identity recognition. The Kafka client transmits its user identity through the access protocol, and the Kafka server confirms the identity of the user corresponding to the current client request before proceeding with subsequent permission verification and other operations. Note the difference between a Kafka ACL user and an AutoMQ environment member: | **Scenario Comparison** | **Kafka ACL User** | **AutoMQ Environment Member** | | - | - | - | | **Usage Scenario** | Access via Kafka client API and CLI | Access via AutoMQ environment web | | **Scope of Coverage** | Acts on a single Kafka instance | Acts on the entire environment, allowing cross-instance operations | > [!TIP] > > **Note**: > > When accessing AutoMQ instances via the mTLS protocol, the server will by default map the client's certificate identity to an ACL user. The default mapping rule is set as RULE:.*CN=(\[^,]+).*/\$1/. > > Example: For a client certificate identity of: *CN=user01,O=xxxx,OU=xxx,L=xxx,S=xxx,C=xxx* > > AutoMQ extracts the CN field and constructs the Principal= User:user01. ### ACL Authorization Policy Apache Kafka specifies the range of resources that different users can access and the corresponding list of operations that can be executed through authorization policies. Refer to Apache Kafka's [design documentation](https://kafka.apache.org/documentation/#security_authz). The authorization policy for an AutoMQ instance includes the following information: | **Parameter** | **Description** | | - | - | | **Resource Type** |
  • Description: Resource type refers to the categories of Kafka resources applicable to Kafka ACL policies, supporting the following types:
    • Cluster: Defines operation permissions at the instance (cluster) level, such as viewing cluster configurations and cloud information.
    • Topic: Defines operation permissions at the Topic level, such as deleting, subscribing, sending messages, etc.
    • Consumer Group: Defines the permissions for Kafka Consumer clients to join Groups and participate in receiving messages.
    • TransactionID: Defines the usage permissions for transactional messages.
| | **Resource Name** |
  • Description: Resource Name defines the scope of resources covered by the ACL policy. It can be an exact name or a prefix defined through custom string conventions.
  • Restrictions: Refer to [Restrictions▸](/automq-cloud/overview/restrictions) .
| | **Match Type** |
  • Description: Match Type describes whether the Resource Name field in the current ACL rule is an exact match or a prefix match.
  • Types:
    • literal: Exact match, meaning the resource name is the actual effective name.
    • prefixed: Prefix match, meaning the resource name is the prefix of the actual effective resource.
| | **Operation Group** |
  • Description: An Operation Group is a bundled combination of fine-grained atomic authorization operations (Operations) in Apache Kafka by AutoMQ. Each operation group contains multiple Kafka operations. Operation groups simplify the authorization process for a series of typical use cases.
  • For the mapping relationship between operation groups and Kafka ACL operations, refer to the table below.
| | **Authorization Types** |
  • Description: Apache Kafka ACL supports the following two authorization types:
    • ALLOW: This ACL policy permits users to perform operations on the associated resources.
    • DENY: This ACL policy prevents users from performing operations on the associated resources.
\[!TIP] Note: A DENY type authorization policy functions like a denylist capability, is exclusive, and takes precedence over ALLOW.\ | | **Access Source** |
  • Description: Access Source defines when the current ACL policy is effective only for the current IP access source. It is not effective for an IP access source that is not matched.
  • Limitation: Access Source supports only precise IP addresses and does not support CIDR networks or domain names.
| AutoMQ defines operation groups to simplify authorization processes, and the mapping between operation groups and Kafka operations is displayed in the table below:
Resource Type Operation Group Included Operations Recommended Scenarios
Cluster All
  • Alter
  • AlterConfigs
  • ClusterAction
  • Create
  • Describe
  • DescribeConfigs
  • All
The All operation group grants full permissions for all actions on the Kafka cluster (instance). It is generally advised to assign this to user identities utilizing Kafka UI or CLI tools.
Topic All
  • Alter
  • AlterConfigs
  • Create
  • Delete
  • Describe
  • DescribeConfigs
  • Read
  • Write
The All operation group provides full permissions for all actions on a single Topic. It is typically suggested to assign this to user identities requiring both production and subscription permissions.
Produce
  • Create
  • Write
  • Describe
The Produce operation group defines the minimum permissions required for sending messages to a single Topic. It is advised to grant this authority to the user identity responsible for message production.
Consume
  • Read
  • Describe
The Consume operation group defines the minimum permissions required for subscribing to messages from a single Topic. It is advised to grant this authority to the user identity responsible for message subscription. > [!TIP] > > If you intend to use a Consumer Group to subscribe to messages, besides granting permissions for the Consume operation group on the Topic, you must also authorize the target Consumer Group.
Consumer Group All
  • Delete
  • Describe
  • Read
The All operation group grants complete operational permissions for a specific Consumer Group. It is advised to grant this authority to the user identity responsible for message subscription. > [!TIP] > > To utilize a Consumer Group for subscribing to messages, besides authorizing the Consumer Group, you must also grant permissions for the Consume operation group on the target Topic.
TransactionID All
  • Describe
  • Write
All operation groups agreed on granting permission to read state and commit transactions for a specific TransactionID. It is recommended to authorize this for user identities that need to send transactional messages.
## Using Kafka ACL To use the Kafka ACL feature in an AutoMQ instance, follow the process outlined below: ![](https://mintcdn.com/automq/HveFFwfWarPtnDnE/automq-cloud/manage-security/manage-kafka-acls/1.webp?fit=max\&auto=format\&n=HveFFwfWarPtnDnE\&q=85\&s=d8fc1eaba61f74569a4fca75e3ab206f) It is important to note that: * When creating an instance, ACL is not enabled by default. At this time, clients can access the cluster anonymously via the PLAINTEXT protocol and have permissions for all operations. * After enabling ACL, the PLAINTEXT protocol will continue to provide services. However, all client applications should promptly switch to SASL\_PLAINTEXT endpoints that support authentication and authorization to prevent unauthorized access. Once the switch is complete, close the PLAINTEXT protocol endpoints. # Overview Source: https://docs.automq.com/automq-cloud/manage-security/overview AutoMQ ensures secure Kafka-compatible cloud-native data links with flexible identity recognition, permission control, and robust encryption for transit and rest. AutoMQ is a widely-used tool in enterprise core data links for transmitting vital business data. AutoMQ Cloud provides extensive and flexible security configuration options for the data plane, including identity recognition, permission control, and data encryption. This document outlines the security configuration features supported by AutoMQ on the data plane. > [!TIP] > > This section only addresses the security configuration of data plane instances. For details on managing member accounts, RBAC, and other aspects related to the BYOC console and the control plane, refer to the documentation [Overview▸](/automq-cloud/manage-identities-and-access/overview). ## Identity Recognition The AutoMQ data plane (AutoMQ instance) offers Kafka API access capabilities and adheres to the identity recognition protocols provided by the Apache Kafka community, supporting the following identity recognition mechanisms. | **Recognition Protocol** | **Description** | | - | - | | **Anonymous Mode** |
  • **Protocol**: `PLAINTEXT`
  • **Description:** Users can access the cluster via the Kafka API without setting access credentials, thus accessing the AutoMQ instance anonymously with full operational privileges.
\[!TIP] It is not recommended to use anonymous mode in production environments. It is advised to perform strict identity verification using protocols such as SASL or mTLS.\ | | **SASL Mode** |
  • **Protocols**: `SASL_PLAINTEXT`, `SASL_SSL`
  • **Authentication Mechanisms**: `SCRAM-SHA-256`, `SCRAM-SHA-512`, `PLAIN`
  • **Description:** When accessing the cluster via the Kafka API, users need to set access credentials to identify the identity principal. This, in conjunction with the Kafka ACL authorization mechanism, verifies the operational permissions of the principal. [Manage Kafka ACLs▸](/automq-cloud/manage-security/manage-kafka-acls)
| | **Mutual TLS (mTLS)** |
  • **Protocols**: `SSL`
  • **Authentication Mechanism**: `SSL`
  • **Description:** When accessing the cluster via the Kafka API, a unique TLS certificate must be assigned to each client. Each TLS certificate corresponds to an identity principal in the Kafka ACL. After the server performs TLS verification, it identifies the corresponding identity principal and verifies the operational permissions of the principal using the Kafka ACL authorization mechanism. [Manage Kafka ACLs▸](/automq-cloud/manage-security/manage-kafka-acls)
| For configuration and usage methods of identity recognition protocols, refer to the following documentation: * [SASL Authentication▸](/automq-cloud/manage-security/authentication/sasl-authentication) * [Mutual TLS (mTLS) Authentication▸](/automq-cloud/manage-security/authentication/mutual-tls-mtls-authentication) ## Access Control AutoMQ data plane (AutoMQ instance) provides access to Kafka APIs, following the ACL access control protocol established by the Apache Kafka community to offer permission management capabilities. For configuration and instructions on Kafka ACLs, refer to [Manage Kafka ACLs▸](/automq-cloud/manage-security/manage-kafka-acls). ## Data Protection and Encryption AutoMQ Cloud provides customers with robust encryption capabilities for data in transit and at rest. * **Transmission Encryption:** As noted in the referenced document, AutoMQ supports the mTLS protocol. When accessing data using mTLS, the transmission link is encrypted via TLS, ensuring data remains secure and protected against leakage during network transmission. * **Data Encryption at Rest:** AutoMQ is built upon cloud storage, inherently supporting data storage encryption. This feature can be enabled when creating an installation in the BYOC console and during the creation of an AutoMQ instance. It supports transparent data encryption using cloud vendor-managed keys. For configuring data encryption at rest, refer to [Data Encryption at Rest▸](/automq-cloud/manage-security/data-encryption-at-rest). # Kafka Linking best practices Source: https://docs.automq.com/automq-cloud/migrate-to-automq/kafka-linking-best-practices Plan and run Kafka Linking migrations with reliable endpoints, safe client cutovers, offset validation, promotion gates, and rollback boundaries. This guide provides production best practices for migrating Apache Kafka workloads to AutoMQ with Kafka Linking. Complete the [prerequisite review](/automq-cloud/migrate-to-automq/prerequisites), then use this guide to create a runbook for each migration batch. > [!WARNING] > > Kafka Linking synchronizes Kafka topic data and committed Kafka Consumer Group offsets. It does not rewrite offsets stored in Flink checkpoints, savepoints, application databases, or other external systems. Identify the offset source that each consumer actually uses before cutover. ## Plan each migration batch Start with a non-critical but representative workload. Expand the scope only after the pilot passes. Keep dependent producers, topics, and consumers in the same batch so that a business data flow is not split across migration stages. Record the following information before migration: | Object | Information to confirm | | - | - | | Topic | Partition count, cleanup policy, retention, maximum message size, peak throughput, and dependencies | | Producer | Client version, idempotence setting, `transactional.id` usage, instance inventory, and owner | | Consumer | `group.id`, client version, offset source, acceptable replay window, and owner | | External component | Flink, Kafka Connect, Kafka Streams, Schema Registry, and application-managed offset stores | | Security | Listener protocol, credentials, certificate lifetime, Kafka ACLs, firewalls, and security groups | | Rollback | Steps before and after Mirror Topic promotion, stop conditions, and decision owner | Avoid unrelated source-cluster upgrades, broker replacements, network changes, authentication changes, and topic recreation during the migration window. Limiting concurrent changes makes failures easier to attribute. ## Configure reliable source endpoints A Kafka client uses `bootstrap.servers` to obtain cluster metadata. It then connects to the broker addresses returned through `advertised.listeners`. A successful connection to only the bootstrap address does not prove that Kafka Linking can reach the cluster. > [!WARNING] > > Enter a stable bootstrap DNS name or the formal endpoint provided by the source Kafka service. Do not use Kubernetes Pod IPs, node IP and NodePort combinations, or other temporary addresses that change during Pod recreation, node replacement, or scaling. Validate the source connection as follows: * Use stable DNS names or the source Kafka service's formal endpoint. When you configure multiple endpoints, distribute them across failure domains. * Confirm that the AutoMQ data plane can resolve and connect to **every** broker address and port returned in metadata. * For a Kubernetes source cluster, use the Kafka Operator or platform-provided stable bootstrap service and stable per-broker external listeners. * Allow both the bootstrap endpoints and all advertised broker endpoints through firewalls, security groups, routes, and network access controls. * For TLS or mTLS, verify the trust chain, the hostname against the certificate SAN, and the certificate lifetime. * Use a dedicated migration identity with the permissions required to read the selected topics, inspect Consumer Groups, and discover metadata. Do not rotate or delete this identity during migration. Run a metadata check from an environment with a network path equivalent to the AutoMQ data plane. For example: ```bash theme={null} kafka-broker-api-versions.sh \ --bootstrap-server :,: \ --command-config source-client.properties ``` The command must return the expected broker list. Then validate DNS resolution, port connectivity, and the TLS handshake for every returned endpoint. Fix `advertised.listeners` or network access before creating the Kafka Link if any broker is unreachable. ## Prepare the source and target clusters Complete these checks before creating a Kafka Link: * Reserve enough target capacity for migration traffic as described in [Prerequisites](/automq-cloud/migrate-to-automq/prerequisites). * Make sure that a topic with the same name does not already exist on the target. Kafka Linking must create a Mirror Topic for the source topic. * Keep source topic identity and partition structure stable within a migration batch. Do not delete and recreate a topic with the same name. * Keep target data long enough to cover the migration and observation windows. The target must not expire records that a consumer still needs before cutover. * Validate Kafka ACLs, certificates, Schema Registry, connectors, and other external dependencies on the target. Do not assume that topic data synchronization migrates every surrounding configuration or state. * Save a baseline of topic configurations, partition ranges, Consumer Group offsets, and business traffic on both clusters. > [!CAUTION] > > From the time a Mirror Topic is created until it is promoted to `PROMOTED`, do not increase the partition count of either the source topic or the target Mirror Topic. The source and target partition counts must remain unchanged while Kafka Linking is in progress. After the Kafka Link enters the linking state, monitor replication lag and errors. Start client cutover only when lag converges and no sustained authentication, network, or request errors remain. > [!CAUTION] > > Keep the source cluster, its network path, DNS endpoints, and migration identity available until every Mirror Topic and Consumer Group is promoted and business acceptance passes. Do not stop, scale to zero, delete, or release the source cluster early, and do not revoke Kafka Linking's access permissions. ### Verify the Mirror Topic and Consumer Group candidate lists When you create a Mirror Topic or Consumer Group, the console retrieves candidate resources through the source cluster's Kafka APIs. After you enter a search keyword, the console matches resource names by containment. For example, `order` matches `prod-order-v1`. Each search displays up to 100 matching resources. The candidate lists include only resources visible to the Kafka Linking source identity and then apply these filters: | Resource | Product filter | | - | - | | Source Topic | Excludes Topics marked as internal in Kafka metadata. It also excludes Topic names that start with `__` or `.`, or end with `-internal` or `.internal` | | Source Consumer Group | Includes only Groups whose `protocolType` is `consumer` or empty. It excludes other protocol types, such as `connect` used by Kafka Connect or `connector` reported by some implementations. It also excludes product-internal Groups whose IDs start with `sys-cmp` or `karapace-autogenerated` | If an item in the migration inventory does not appear, check the following in order: 1. Shorten the search keyword, confirm that the resource name matches by containment, and check whether the result falls outside the 100 items displayed per search. 2. Confirm that the name or Group ID does not match an internal-resource rule above. 3. For a Consumer Group, use a Kafka administration tool to inspect its `protocolType`. A Group with a non-Consumer protocol cannot be created as a Kafka Linking Consumer Group. 4. Confirm that the Kafka Linking source identity has the Kafka ACLs required to discover the Topic or Consumer Group. Resources hidden from that identity do not appear in the candidate lists. 5. Separately check whether the target already has a Topic with the same name and whether the resource is already a Mirror resource. These conflicts are not prefiltered from the source candidate list, but they can cause creation to fail. Internal Topics, coordination Groups, and external state used by components such as Kafka Connect are outside the business Topic and Consumer Group migration scope supported by these candidate lists. Follow the component-specific migration procedure instead of renaming resources to bypass the product filters. ### Match Consumer Groups to their Mirror Topics Creating a Mirror Consumer Group does not automatically create Mirror Topics for every topic it uses. Before cutover, compare the application's subscriptions and the source Group's committed offsets with the migration inventory: * Confirm that every topic the application still needs has a corresponding Mirror Topic on the target. Match exact names: `orders` and `orders.v2` are different topics. * Check the source Group's stored offsets, including topics the application no longer subscribes to. These entries can still participate in promotion. Review them as described in [Remove offsets for topics no longer used](#remove-offsets-for-topics-no-longer-used). * Validate each required partition's offset against the target readable range. A same-name ordinary topic is not a Mirror Topic, and its presence does not prove that data has been replicated. For example, if the source Group has committed offset `5350` for `orders.v2-0`, but the target partition has end offset `0`, promotion fails offset validation. The client can continue receiving `COORDINATOR_LOAD_IN_PROGRESS` while the Group remains `LINKING`. Check for an omitted Mirror Topic, incomplete replication, or an obsolete stored offset before retrying the cutover. Do not reset the offset to `0` to bypass the check. ### Remove offsets for topics no longer used Removing a topic from the application's subscription does not immediately remove its committed offsets from the source Group. Promotion reads stored Group offsets, so an obsolete entry can still fail validation against a same-name empty or unrelated target topic. A stored offset alone does not prove that the application still subscribes to that topic. Kafka's `offsets.retention.minutes` defaults to `10080` minutes (7 days), and `offsets.retention.check.interval.ms` defaults to `600000` ms (10 minutes). For a stable subscribed Group that no longer subscribes to a topic, expiration normally uses that partition's last offset commit time. If the entire Group becomes empty, retention normally starts when the Group enters `Empty`. Use the source broker's actual configuration and version; do not assume offsets disappear exactly 7 days after a subscription change. See the [Apache Kafka offset retention configuration](https://kafka.apache.org/39/generated/kafka_config.html#brokerconfigs_offsets.retention.minutes). If the topic is obsolete and its stored progress is no longer needed, remove only its offsets on the **source cluster** before retrying promotion: 1. Confirm from the application configuration and source Group membership that no member still subscribes to the topic and that the workload no longer needs its saved progress. Record any replay or skip implications if the topic is subscribed to again. 2. Save the source Group's offsets before changing them: ```bash theme={null} kafka-consumer-groups.sh \ --bootstrap-server \ --command-config source-client.properties \ --describe \ --group > source-group-offsets-before.txt ``` 3. Delete the obsolete topic's offsets with a source-compatible CLI and an identity authorized to delete Group offsets: ```bash theme={null} kafka-consumer-groups.sh \ --bootstrap-server \ --command-config source-client.properties \ --delete-offsets \ --group \ --topic ``` 4. Check the deletion result for every requested partition. Run `--describe --group ` against the source again to confirm those entries are gone and the other offsets remain. Keep source access available, retry the target consumer's Group join, and verify promotion and consumption. `--topic ` selects all partitions of that topic. To remove only a confirmed obsolete partition, use `--topic :0`. Kafka rejects offset deletion with `GROUP_SUBSCRIBED_TO_TOPIC` while the Group still subscribes to the topic. This operation deletes saved consumer progress, not topic data. Do not use it for a topic the application still needs, delete the entire Group, or delete the Topic to clear an offset-validation error. Deleting only the target offset does not remove the source entry that promotion reads. ## Validate consumer offset sources The consumer startup position depends on how the client manages state: | Offset source | Kafka Linking behavior | Pre-cutover check | | - | - | - | | Committed Kafka Consumer Group offset | After all source instances exit, Kafka Linking synchronizes and promotes the Group offset | Confirm that the source Group committed offset for every partition is within the target readable range, and ensure that the rollout eventually removes every source instance | | Flink checkpoint or savepoint | Kafka Linking does not rewrite Flink state | Inspect the restored offset for every partition | | Application-managed offset | Kafka Linking does not rewrite a database, Redis, file, or business snapshot | Identify the source of truth and inspect the offset passed to `seek` | | Kafka Connect or other component state | State can reside in internal topics or an external store | Follow the component's migration procedure instead of checking only a business Consumer Group | For every topic-partition, verify: ```text theme={null} target earliest offset <= client startup offset <= target end offset ``` Pause the consumer cutover if any partition fails this check. Options include continuing on the source until the checkpoint advances, changing the synchronization or retention range, or resetting client state after assessing the business impact. For example, if a Consumer's actual startup offset for Partition X is 100, it can cut over when the target readable range is `[80, 150]`. A range of `[120, 150]` means that the historical record at offset 100 is no longer readable. A range of `[80, 90]` means that the target has not replicated through offset 100, so wait for the target to catch up. > [!NOTE] > > `auto.offset.reset` applies only when the client has no valid starting offset. It does not override a Flink restore or an explicit `assign` and `seek` from an external offset store. ## Define rollback boundaries Rollback semantics change after promotion: * **Before promotion:** Standard producers can return to the source. Before moving consumers back, reconcile the source Consumer Group offset or expect records already processed on the target to be replayed. * **After promotion:** New target records no longer replicate to the source. Changing only `bootstrap.servers` would return clients to a source cluster that is missing post-promotion records. Stop the cutover and use a data reconciliation or reverse-migration plan. ## Cut over producers Choose the producer workflow based on whether the application uses Kafka transactions. For consumer steps, see [Cut over consumers](#cut-over-consumers). ### Cut over standard producers This workflow applies to producers that do not use Kafka transactions. Producers with a `transactional.id` must use the [transactional producer workflow](#cut-over-transactional-producers). 1. Move standard producers to the target AutoMQ instance in batches, then recreate or restart the clients. While a Mirror Topic is `LINKING`, Kafka Linking routes these writes to the source and replicates them back to the target. 2. Check every producer deployment and send callback. Confirm that no untracked producer instance continues to write directly to the source. ### Cut over transactional producers Kafka transactions cannot use the rolling proxy workflow for standard producers. Use the following order for any application that sets `transactional.id` or depends on exactly-once semantics: 1. Keep the transactional producer on the source while target replication lag converges. 2. Stop transactional producers on the source. Confirm that every open transaction has committed or aborted. 3. Compare source and target end offsets for every partition. Confirm that the target has caught up with the source. 4. Promote every Mirror Topic involved in the transactions and wait for the `PROMOTED` state. 5. Confirm that old producer instances cannot restart. Then start the transactional producers on the target. 6. Use `read_committed` consumers to verify committed records from before and after promotion, and validate the end-to-end transactional result. > [!WARNING] > > Do not point a transactional producer at the target while its Mirror Topic is still `LINKING`. For transactions across multiple topics, place all involved topics in one migration batch and stop, catch up, and promote them together. ## Cut over consumers This workflow applies to standard Consumers that participate in Group management through `subscribe` and `group.id`, regardless of whether producers use transactions. For Flink or application-managed offsets, first [validate the actual offset source](#validate-consumer-offset-sources), then follow the client or component migration procedure. 1. Before moving a Consumer Group, [match its topics to the Mirror Topics](#match-consumer-groups-to-their-mirror-topics) and confirm that the actual startup offset for every partition is within the target topic's readable range. See [Validate consumer offset sources](#validate-consumer-offset-sources) for the offset sources used by different clients. 2. Change the Consumer connection configuration and perform a rolling deployment so that instances connect to the target AutoMQ instance in batches. For standard Consumers that participate in Group management by using `subscribe` and `group.id`, target instances cannot complete JoinGroup or receive partition assignments while the target Mirror Group is `LINKING`, so they do not start consuming. The source instances that have not yet moved continue to carry the consumption workload. 3. Control the rollout batch size and continuously monitor source Consumer capacity and lag. As source instances leave in batches, effective source consumption capacity decreases. Make sure that the remaining source instances can carry the full consumption workload at that point. 4. Confirm that every source Consumer instance has exited. After Kafka Linking detects that the source Consumer Group has no active members, it automatically promotes the target Consumer Group. A brief consumption pause exists until promotion completes. 5. Wait for the Consumer Group to enter `PROMOTED`. Confirm that target Consumers successfully join the Group, receive partition assignments, and resume consumption. Validate consumption rate, lag, business results, and errors, and complete the observation window before moving the next workload. > [!WARNING] > > The rolling cutover must converge with every instance connected to the target. Do not run the same `group.id` on the source and target for an extended period. The Consumer Group cannot be automatically promoted while the source Group still has active members. A target Consumer process being started or connected to a broker does not mean that it is consuming. Treat the cutover as complete only after the Group is `PROMOTED`, target Consumers have partition assignments, and consumption progress is advancing. ### Understand Consumer Group auto-promotion and the consumption pause Data-plane auto-promotion uses the following flow: 1. When a target Consumer attempts to join a Mirror Group that is still `LINKING`, the data plane registers the Group for auto-promotion checks. This JoinGroup attempt receives a retriable error, so the target Consumer temporarily has no partition assignment. 2. The data plane queries the source Group. It attempts auto-promotion only when the source Group does not exist, or when it has no active members and its state is `EMPTY` or `DEAD`. If source members remain, the target Group stays `LINKING` and target Consumers remain unable to join. 3. After the condition is met, Kafka Linking fetches the source Group's committed offsets, validates that they are within the readable ranges of the target topics, commits them to the target Group, and changes the Group to `PROMOTED`. 4. The target Consumer retries according to its client configuration. It resumes consumption on AutoMQ only after it joins the Group, completes the rebalance, and receives partition assignments. For retriable errors such as `COORDINATOR_LOAD_IN_PROGRESS`, retry with backoff instead of exiting immediately. Use a retry budget that covers the planned cutover window. If failures persist, investigate source connectivity, authentication, and offset validation. The data plane schedules registered Groups every 10 seconds. After the first JoinGroup registration, a source check can normally start on the next scheduler run. If the source Group still has active members at that check, subsequent source-state checks for the same Group are eligible at a default minimum interval of 30 seconds. Therefore, consumption does not resume immediately after the last source instance exits. The workflow must still wait for the next eligible source check, offset synchronization and validation, Group promotion, and the client retry and rebalance. Plan for a consumption pause measured in tens of seconds. Network, authentication, out-of-range offsets, or promotion failures can extend this window. ## Promote Mirror Topics Promotion stops write routing and replication from the source for a topic. Pass every gate before promotion: | Gate | Pass condition | | - | - | | Standard producers | Every workload Producer instance connects to the target, and no instance still writes directly through a source-cluster endpoint | | Transactional producers | Source instances have stopped, transactions have ended, the target has caught up, and target instances have not started | | Consumer Groups | Source Groups have no active members, and target consumers run normally | | External-offset consumers | Every partition startup offset is readable on the target | | Kafka Link | Replication lag has converged, with no sustained network, authentication, or request errors | | Business acceptance | Produce, consume, lag, error rate, and critical business results meet the acceptance criteria | | Rollback readiness | The rollback owner, reconciliation method, and stop conditions are recorded | Kafka Linking remains connected to the source and routes writes during `LINKING`, so source-cluster connections alone do not indicate that workload Producers have not switched. For a low-frequency topic, do not use a short zero-traffic window as the only proof that a Producer has stopped. Check the workload Producer inventory and deployment configuration, and compare source and target write requests over a window longer than the normal message interval. Promote topics by business batch instead of promoting the entire migration at once. Validate each batch before continuing. > [!NOTE] > > During Mirror Topic promotion, a small number of writes that still reach the old routing path can briefly receive `OUT_OF_ORDER_SEQUENCE_NUMBER`. For non-transactional producers with idempotence enabled and normal retry settings, Kafka clients typically reset the sequence state and retry automatically, so applications usually do not need to intervene. Monitor final send failures. Investigate client configuration, Topic state, and residual routed traffic only if the error is ultimately returned to the application or continues after promotion; compensate only records confirmed as failed according to the application's idempotency policy. ## Complete the migration End a Kafka Linking migration only after all of these conditions are met: * Every Mirror Topic in the Kafka Link is `PROMOTED`. * Every Consumer Group in the Kafka Link has completed promotion. * Production, consumption, lag, error rate, and critical business results on the target AutoMQ instance pass acceptance, including the agreed observation window. After all conditions pass, delete the **Kafka Link itself** in AutoMQ Console. Deleting the Kafka Link marks the Kafka Linking migration as fully complete. > [!CAUTION] > > Do not delete the promoted Mirror Topics or Consumer Groups one by one. Deleting these resources deletes the corresponding topic or Group from the target AutoMQ instance and can cause message data or consumer offsets to be lost, or interrupt the workload. To complete the migration, delete only the Kafka Link itself. After deleting the Kafka Link, retain the source cluster in an idle state for an observation period. Stop new workload writes, but preserve the original data and required access. Reclaim the source cluster's network, storage, compute resources, and migration identity only after the target remains stable and rollback or data reconciliation is no longer needed. See [Executing migration](/automq-cloud/migrate-to-automq/executing-migration) for the operational steps. ## Use the migration checklist Keep at least the following evidence for each batch: * Stable source bootstrap endpoints and connectivity results for every advertised broker endpoint. * Migration identity permissions, certificate lifetime, and firewall approvals. * Topic, producer, Consumer Group, external offset source, owner, and dependency inventories. * Exact Mirror Topic coverage for every required Consumer Group topic, and saved offsets plus deletion results for any obsolete topic entries removed on the source. * Partition earliest offsets, end offsets, committed Group offsets, and replication lag before and after cutover. * The selected standard or transactional producer cutover order. * Consumer backoff settings and a retry budget that covers the planned cutover window. * Evidence that source Groups became `Empty`, target consumers stabilized, and business acceptance passed. * Mirror Topic promotion approval, execution time, observation result, and rollback boundary. * Promotion results for every Mirror Topic and Consumer Group, the Kafka Link deletion record, and approval to reclaim the source cluster. Include this evidence in the runbook for each migration batch. For the console steps to create a Kafka Link and run the migration, see [Executing migration](/automq-cloud/migrate-to-automq/executing-migration). # Integrating Metrics with Datadog Source: https://docs.automq.com/automq-cloud/monitoring-alert/integrating-metrics-with-datadog Send AutoMQ metrics to Datadog using a Gateway-style Datadog Agent or OTEL Collector. AutoMQ supports exporting metrics to [Datadog](https://www.datadoghq.com/) for monitoring and alerting. This guide covers two Gateway-style integration approaches based on where the collector runs: * **Kubernetes**: Use the Datadog Agent Helm chart's OTEL Agent Gateway to scrape Prometheus metrics from AutoMQ pods. * **Linux**: Use a Gateway OTEL Collector or Datadog DDOT Collector on Linux to scrape AutoMQ Prometheus metrics endpoints and forward metrics to Datadog. ## Prerequisites * A running AutoMQ Cloud BYOC cluster. BYOC clusters expose the AutoMQ Prometheus metrics endpoint by default. * A valid [Datadog API Key](https://docs.datadoghq.com/account_management/api-app-keys/) * Your Datadog Site URL (e.g., `datadoghq.com`, `us3.datadoghq.com`, `datadoghq.eu`) ## Option 1: Kubernetes with Datadog Agent Gateway In this approach, the Datadog Agent Helm chart runs a single OTEL Agent Gateway Deployment. The Gateway scrapes Prometheus metrics from AutoMQ pods using Kubernetes service discovery, reduces metric cardinality before ingest, then exports the metrics to Datadog. ```text theme={null} AutoMQ Pods (Prometheus metrics endpoint on port 9090) ↓ Prometheus scrape (Kubernetes service discovery) Datadog OTEL Agent Gateway ↓ Export to Datadog Datadog ``` ### Step 1: Confirm AutoMQ metrics export > [!NOTE] > > AutoMQ Cloud BYOC Kubernetes clusters created by the Console expose Prometheus metrics on the AutoMQ broker and controller pods by default. No AutoMQ Helm values changes are required in the standard BYOC flow. > > If you manage an AutoMQ Software deployment on Kubernetes and need to manually enable metrics export, see [Appendix: Manually enable AutoMQ metrics export for Kubernetes Software](#appendix-manually-enable-automq-metrics-export-for-kubernetes-software). ### Step 2: Create the Datadog Agent Gateway values file Create a `datadog-values.yaml` file with the OTEL Agent Gateway configuration. The Gateway uses Kubernetes service discovery to find AutoMQ broker and controller pods. Set `` to the Kubernetes namespace where your AutoMQ cluster runs. If you need to collect multiple AutoMQ namespaces with the same Datadog Agent, add each namespace to `kubernetes_sd_configs.namespaces.names`. The same collection profile can be used for AutoMQ Software and AutoMQ Cloud BYOC/CMP clusters. The standard dashboards show `cluster_id` as the required cluster filter; this dashboard filter reads the Datadog `service` tag derived from AutoMQ's Prometheus `job` label. The dashboards also include `env_id` and `instance_id` as optional filters when those labels are exposed by the AutoMQ metrics. The profile does not synthesize `env_id` or `instance_id` from Kubernetes metadata. If AutoMQ metrics already expose those labels, `honor_labels: true` preserves the AutoMQ-provided values. ```yaml theme={null} agents: enabled: false clusterAgent: enabled: false admissionController: enabled: false datadog: kubeStateMetricsCore: enabled: false orchestratorExplorer: enabled: false operator: enabled: false instrumentationCrd: enabled: false autoscaling: workload: enabled: false datadog-crds: crds: datadogMetrics: false datadogPodAutoscalers: false datadogPodAutoscalerClusterProfiles: false datadogInstrumentations: false otelAgentGateway: enabled: true replicas: 1 rbac: create: true rules: - apiGroups: [""] resources: ["pods"] verbs: ["get", "list", "watch"] config: | receivers: prometheus: config: scrape_configs: - job_name: "automq" scrape_interval: 15s honor_labels: true kubernetes_sd_configs: - role: pod namespaces: names: - selectors: - role: pod label: 'app.kubernetes.io/name=automq-enterprise,app.kubernetes.io/component in (broker,controller)' field: 'status.phase=Running' relabel_configs: - source_labels: [__meta_kubernetes_pod_container_name] action: keep regex: 'automq-(broker|controller)' - source_labels: [__meta_kubernetes_pod_container_port_number] action: keep regex: "9090" metric_relabel_configs: - source_labels: [__name__] action: keep regex: "^(consumer_(offset_lag_count|estimated_time_lag_milliseconds)|jvm_cpu_(count|time_seconds_total)|kafka_(node(_metadata|_info)?|broker_(active_count|fenced_count|network_io_bytes_total)|group_(count|stable_count|empty_count|dead_count|preparing_rebalance_count|completing_rebalance_count|commit_offset)|log_(size|end_offset)|message_count_total|network_io_bytes_total|partition_total_count|request_error_count_total|stream_topic_partition_count|tabletopic_(delay_milliseconds|fps_fields_per_second)|topic_(count|request_count_total)))$" - action: labeldrop regex: "^(active_controller|customer|exported_env_id|exported_instance_id|exported_job|instance|link_id|operation_name|operation_type|otel_scope_name|pool_type|request|request_type|size|source_node_id)$" exporters: datadog: api: key: ${env:DD_API_KEY} site: ${env:DD_SITE} processors: cumulativetodelta/automq_counters: initial_value: auto include: match_type: strict metrics: - kafka_network_io_bytes_total - kafka_message_count_total - kafka_topic_request_count_total - kafka_broker_network_io_bytes_total - kafka_request_error_count_total transform/automq_rollups: error_mode: ignore metric_statements: - context: metric statements: - copy_metric(name="automq_topic_log_size") where metric.name == "kafka_log_size" - aggregate_on_attributes("sum", ["env_id", "instance_id", "service", "topic"]) where metric.name == "automq_topic_log_size" - copy_metric(name="automq_topic_log_end_offset") where metric.name == "kafka_log_end_offset" - aggregate_on_attributes("sum", ["env_id", "instance_id", "service", "topic"]) where metric.name == "automq_topic_log_end_offset" - copy_metric(name="automq_topic_network_io_bytes_total") where metric.name == "kafka_network_io_bytes_total" - aggregate_on_attributes("sum", ["env_id", "instance_id", "service", "topic", "direction"]) where metric.name == "automq_topic_network_io_bytes_total" - copy_metric(name="automq_topic_message_count_total") where metric.name == "kafka_message_count_total" - aggregate_on_attributes("sum", ["env_id", "instance_id", "service", "topic", "direction"]) where metric.name == "automq_topic_message_count_total" - copy_metric(name="automq_topic_request_count_total") where metric.name == "kafka_topic_request_count_total" - aggregate_on_attributes("sum", ["env_id", "instance_id", "service", "topic", "type"]) where metric.name == "automq_topic_request_count_total" - copy_metric(name="automq_cluster_broker_network_io_bytes_total") where metric.name == "kafka_broker_network_io_bytes_total" - aggregate_on_attributes("sum", ["env_id", "instance_id", "service", "direction"]) where metric.name == "automq_cluster_broker_network_io_bytes_total" - copy_metric(name="automq_request_error_count_total") where metric.name == "kafka_request_error_count_total" - aggregate_on_attributes("sum", ["env_id", "instance_id", "service", "error"]) where metric.name == "automq_request_error_count_total" - copy_metric(name="automq_topic_partition_count") where metric.name == "kafka_stream_topic_partition_count" - aggregate_on_attributes("sum", ["env_id", "instance_id", "service", "topic"]) where metric.name == "automq_topic_partition_count" - copy_metric(name="automq_topic_rack_partition_count") where metric.name == "kafka_stream_topic_partition_count" - aggregate_on_attributes("sum", ["env_id", "instance_id", "service", "topic", "rack"]) where metric.name == "automq_topic_rack_partition_count" - copy_metric(name="automq_group_count") where metric.name == "kafka_group_count" - aggregate_on_attributes("sum", ["env_id", "instance_id", "service"]) where metric.name == "automq_group_count" - copy_metric(name="automq_group_stable_count") where metric.name == "kafka_group_stable_count" - aggregate_on_attributes("sum", ["env_id", "instance_id", "service"]) where metric.name == "automq_group_stable_count" - copy_metric(name="automq_group_empty_count") where metric.name == "kafka_group_empty_count" - aggregate_on_attributes("sum", ["env_id", "instance_id", "service"]) where metric.name == "automq_group_empty_count" - copy_metric(name="automq_group_dead_count") where metric.name == "kafka_group_dead_count" - aggregate_on_attributes("sum", ["env_id", "instance_id", "service"]) where metric.name == "automq_group_dead_count" - copy_metric(name="automq_group_preparing_rebalance_count") where metric.name == "kafka_group_preparing_rebalance_count" - aggregate_on_attributes("sum", ["env_id", "instance_id", "service"]) where metric.name == "automq_group_preparing_rebalance_count" - copy_metric(name="automq_group_completing_rebalance_count") where metric.name == "kafka_group_completing_rebalance_count" - aggregate_on_attributes("sum", ["env_id", "instance_id", "service"]) where metric.name == "automq_group_completing_rebalance_count" - copy_metric(name="automq_consumer_group_topic_commit_offset") where metric.name == "kafka_group_commit_offset" - copy_metric(name="automq_group_topic_offset_lag") where metric.name == "consumer_offset_lag_count" - copy_metric(name="automq_group_topic_estimated_time_lag_milliseconds") where metric.name == "consumer_estimated_time_lag_milliseconds" - aggregate_on_attributes("max", ["env_id", "instance_id", "service", "group", "topic"]) where metric.name == "automq_group_topic_estimated_time_lag_milliseconds" - context: datapoint statements: - set(datapoint.attributes["group"], datapoint.attributes["consumer_group"]) where metric.name == "automq_consumer_group_topic_commit_offset" and datapoint.attributes["consumer_group"] != nil - set(datapoint.attributes["consumer_group"], datapoint.attributes["group"]) where metric.name == "automq_group_topic_offset_lag" and datapoint.attributes["group"] != nil - context: metric statements: - aggregate_on_attributes("sum", ["env_id", "instance_id", "service", "consumer_group", "group", "topic"]) where metric.name == "automq_consumer_group_topic_commit_offset" - aggregate_on_attributes("sum", ["env_id", "instance_id", "service", "consumer_group", "group", "topic"]) where metric.name == "automq_group_topic_offset_lag" filter/drop_raw_replaced_metrics: metrics: metric: - 'name == "kafka_log_size"' - 'name == "kafka_log_end_offset"' - 'name == "kafka_network_io_bytes_total"' - 'name == "kafka_message_count_total"' - 'name == "kafka_broker_network_io_bytes_total"' - 'name == "kafka_topic_request_count_total"' - 'name == "kafka_request_error_count_total"' - 'name == "kafka_stream_topic_partition_count"' - 'name == "kafka_group_count"' - 'name == "kafka_group_stable_count"' - 'name == "kafka_group_empty_count"' - 'name == "kafka_group_dead_count"' - 'name == "kafka_group_preparing_rebalance_count"' - 'name == "kafka_group_completing_rebalance_count"' - 'name == "kafka_group_commit_offset"' - 'name == "consumer_offset_lag_count"' - 'name == "consumer_estimated_time_lag_milliseconds"' infraattributes: cardinality: 2 service: pipelines: metrics: receivers: [prometheus] processors: [cumulativetodelta/automq_counters, transform/automq_rollups, filter/drop_raw_replaced_metrics, infraattributes] exporters: [datadog] ``` This example uses the following components: | Component | Purpose | | - | - | | `otelAgentGateway` | Runs one OTEL Agent Gateway Deployment for this collection profile. A single Gateway performs the scrape and rollup before exporting metrics to Datadog. | | `prometheus` receiver | Uses Kubernetes service discovery to find running AutoMQ broker and controller pods in the selected namespace and scrape port `9090`. `honor_labels: true` preserves AutoMQ-provided labels such as Prometheus `job`, `env_id`, and `instance_id`. The container-name relabel rule keeps only AutoMQ broker/controller containers and excludes sidecars such as Schema Registry. | | `metric_relabel_configs` | Keeps only the exact raw metrics required by the standard-minimal dashboards or by the `automq_*` rollup processor. The profile does not copy `job` to `cluster_id`; Datadog maps the Prometheus `job` label to the `service` tag, and dashboards keep the `cluster_id` filter name while reading values from `service`. | | `cumulativetodelta/automq_counters` processor | Converts selected Prometheus cumulative counters to deltas before rollup. This avoids aggregating cumulative counter values from multiple AutoMQ nodes before a rate is calculated. | | `transform/automq_rollups` processor | Creates lower-cardinality `automq_*` rollup metrics before Datadog ingest. This profile uses Collector-side OTTL aggregation. | | `filter/drop_raw_replaced_metrics` processor | Drops the raw source metrics after their rollup metrics have been created, reducing Datadog custom metric volume while keeping the customer-facing dashboard panels functional. | | `datadog` exporter | Sends metrics to Datadog. The API key and site come from the Agent's environment variables. | | `infraattributes` processor | Optional. Adds Datadog infrastructure tags when the required resource attributes are available. | We recommend scheduling the OTEL Agent Gateway on general-purpose nodes or dedicated observability nodes. It does not need to run on the same nodes as AutoMQ brokers or controllers. If your Kubernetes cluster requires custom Gateway scheduling, resource sizing, pod annotations, or pod labels, configure the corresponding Datadog Helm values such as `otelAgentGateway.nodeSelector`, `otelAgentGateway.affinity`, `otelAgentGateway.tolerations`, `otelAgentGateway.podAnnotations`, `otelAgentGateway.additionalLabels`, and `otelAgentGateway.containers.otelAgent.resources`. For details, see the [Datadog DDOT Collector Gateway Helm installation guide](https://docs.datadoghq.com/opentelemetry/setup/ddot_collector/install/kubernetes_gateway/) and the [Datadog Helm chart values.yaml](https://github.com/DataDog/helm-charts/blob/main/charts/datadog/values.yaml). #### Standard dashboard collection profile The recommended configuration is designed for the AutoMQ customer-facing Datadog dashboards. It keeps only the minimum dimensions needed by those dashboards: | Metric area | Retained dimensions | | - | - | | Cluster health and capacity | `service` | | CPU and broker metadata | `service`, `broker_id` | | Requests, errors, latency, and broker traffic | `service`, `topic` | | Topic throughput, message count, size, and offsets | `service`, `topic` | | Topic partition distribution across racks | `service`, `topic`, `rack` | | Consumer group lag, offset, and throughput | `service`, `consumer_group` or `group`, `topic` | The standard-minimal profile does not keep raw partition-level series, topic-by-broker traffic / offset / size series, broker/node-level drilldown for JVM, connection, request, latency, or traffic series, `consumer_group * topic * broker` series, non-dashboard `kafka_stream_*` internal metrics, Kafka Linking metrics, or Detailed Metrics-only internal diagnostic dimensions. > [!NOTE] > > This example is the recommended standard-minimal collection profile for AutoMQ customer-facing dashboards. It reduces Datadog custom metric volume and cardinality by collecting only the exact raw metrics required by the standard AutoMQ dashboards or rollup processor, converting request, traffic, topic, partition, and consumer group sources to lower-cardinality `automq_*` rollups, and dropping the raw sources after the rollups are created. The standard-minimal profile keeps cluster, topic, consumer group, and rack dimensions, plus CPU and broker metadata, but it does not keep partition-level series, topic-by-broker series, broker/node-level drilldown series, or consumer-group/topic/broker series. > [!NOTE] > > This example includes a Prometheus scrape job and a metrics pipeline for AutoMQ. It also uses the optional `infraattributes` processor to add Datadog infrastructure tags when the required resource attributes are available. The OTLP receiver and other pipelines (traces, logs) are omitted. If you need to collect OTLP data from other applications through the same Collector, refer to the [Datadog OTEL Agent Gateway documentation](https://docs.datadoghq.com/opentelemetry/setup/ddot_collector/install/kubernetes/?tab=helm) to add the corresponding receivers and pipelines. ### Step 3: Deploy the Datadog Agent Add the Datadog Helm repository and create a Kubernetes secret for your API key: ```bash theme={null} helm repo add datadog https://helm.datadoghq.com helm repo update ``` ```bash theme={null} kubectl create namespace datadog kubectl -n datadog create secret generic datadog-secret \ --from-literal api-key= ``` Install the Datadog Agent using the values file from Step 2: ```bash theme={null} helm install datadog-agent datadog/datadog \ -f datadog-values.yaml \ -n datadog \ --set datadog.apiKeyExistingSecret=datadog-secret \ --set datadog.site= ``` Replace `` with your Datadog Site (e.g., `datadoghq.com`, `us3.datadoghq.com`, `datadoghq.eu`). ### Step 4: Verify the integration Verify that the Datadog Agent service account can discover pods: ```bash theme={null} kubectl auth can-i list pods \ --as=system:serviceaccount:datadog:datadog-agent \ --all-namespaces ``` Verify that the OTEL Agent Gateway Deployment is running: ```bash theme={null} kubectl -n datadog rollout status deployment/datadog-agent-datadog-otel-agent-gateway ``` Check the OTEL Collector logs and confirm that the AutoMQ scrape job has been added: ```bash theme={null} kubectl -n datadog logs deployment/datadog-agent-datadog-otel-agent-gateway --since=10m | grep -i automq ``` Then verify metrics in Datadog: 1. Open Datadog and go to **Metrics > Explorer**. 2. Search for AutoMQ metrics by typing a metric name prefix such as `kafka_broker_active_count`. 3. Filter by `service:` to confirm that the metrics belong to the expected AutoMQ cluster. In the imported dashboards, the filter is still named `cluster_id`, but it reads values from the Datadog `service` tag. If your AutoMQ environment exposes native `env_id` or `instance_id` labels, you can use them as additional filters. 4. New metrics may take 1–3 minutes to appear. ![AutoMQ metrics visible in Datadog Metrics Explorer after Kubernetes integration](https://mintcdn.com/automq/6t03b99H9kP_jCZq/automq-cloud/monitoring-alert/integrating-metrics-with-datadog/1.webp?fit=max\&auto=format\&n=6t03b99H9kP_jCZq\&q=85\&s=cc33eb0696a1165bb0ffad024c79fcc4) ![AutoMQ metrics detail view in Datadog Metrics Explorer](https://mintcdn.com/automq/6t03b99H9kP_jCZq/automq-cloud/monitoring-alert/integrating-metrics-with-datadog/2.webp?fit=max\&auto=format\&n=6t03b99H9kP_jCZq\&q=85\&s=4baf6578e89b2fcace99f4e5f6f95706) ### Step 5: Import AutoMQ Datadog dashboards After AutoMQ metrics appear in Datadog, download the Datadog dashboard JSON templates and import them into your Datadog organization. | Dashboard | JSON template | | - | - | | Cluster Overview | [Download JSON](/automq-cloud/monitoring-alert/integrating-metrics-with-datadog/automq-cluster-overview.datadog.json) | | Topic Metrics | [Download JSON](/automq-cloud/monitoring-alert/integrating-metrics-with-datadog/automq-topic-metrics.datadog.json) | | Group Metrics | [Download JSON](/automq-cloud/monitoring-alert/integrating-metrics-with-datadog/automq-group-metrics.datadog.json) | To import a dashboard, open Datadog, go to **Dashboards**, create or open a dashboard, choose the dashboard JSON import option, and paste or upload the downloaded JSON content. > [!NOTE] > > These dashboard templates are designed for the metric names, tags, and collection reduction profile shown in Step 2. Cluster, Topic, and Group views use the `automq_*` rollup metrics created by the OTEL transform processor. The standard dashboards show `cluster_id` as the required filter, mapped to the Datadog `service` tag, and expose `env_id` and `instance_id` as optional filters when those labels are present. The AutoMQ Version value should be discovered from the node metadata gauges (`kafka_node_metadata`, `kafka_node_info`, or `kafka_node`) and rendered by the dashboard generation/import workflow. Do not derive it from the Helm Chart/App version label because that label can differ from the runtime image version. > [!WARNING] > > AutoMQ metrics use Prometheus naming conventions with underscores (e.g., `kafka_broker_active_count`). Datadog's built-in Apache Kafka dashboards rely on the Datadog Kafka integration, which uses dot-separated names (e.g., `kafka.request.time`). As a result, AutoMQ metrics do not appear in those built-in dashboards. Use Datadog Metrics Explorer to query AutoMQ metrics directly, or build custom dashboards using the underscore-separated names. For available metrics, see [Prometheus Metrics](/automq/observability/prometheus-metrics). The screenshots below illustrate this naming difference — Datadog's built-in dashboard uses dot-separated format, while AutoMQ metrics use underscore-separated format: ![Datadog built-in dashboard showing dot-separated metric naming convention](https://mintcdn.com/automq/6t03b99H9kP_jCZq/automq-cloud/monitoring-alert/integrating-metrics-with-datadog/3.webp?fit=max\&auto=format\&n=6t03b99H9kP_jCZq\&q=85\&s=c807867578722f793d8fd4e5a9bbb0a5) ![AutoMQ metrics showing underscore-separated Prometheus naming convention](https://mintcdn.com/automq/6t03b99H9kP_jCZq/automq-cloud/monitoring-alert/integrating-metrics-with-datadog/4.webp?fit=max\&auto=format\&n=6t03b99H9kP_jCZq\&q=85\&s=4e3c81b8594c401afd169144093ba053) ## Option 2: Linux with Gateway OTEL Collector In this approach, one OTEL Collector or Datadog DDOT Collector runs as a Gateway on Linux and scrapes all AutoMQ Prometheus metrics endpoints with static targets. Use the same standard-minimal metric reduction profile as the Kubernetes approach. The Linux-specific difference is service discovery: use a static target list instead of Kubernetes service discovery. ```text theme={null} AutoMQ Prometheus metrics endpoints ↓ Prometheus scrape from /metrics Gateway OTEL Collector / DDOT Collector on Linux ↓ Forward to Datadog Datadog ``` ### Step 1: Confirm AutoMQ metrics export > [!NOTE] > > AutoMQ Cloud BYOC clusters expose the Prometheus metrics endpoint by default. No `server.properties` changes are required in the standard BYOC flow. ### Step 2: Install the Collector Choose one Collector distribution and keep the configuration path and lifecycle commands aligned with that choice. > [tab] Datadog DDOT Collector > > Install the Datadog Agent with the embedded DDOT Collector. The official Linux install flow manages the Collector through `datadog-agent` and uses `/etc/datadog-agent/otel-config.yaml` as the OpenTelemetry Collector configuration file. > > ```bash theme={null} > DD_API_KEY="" \ > DD_SITE="" \ > DD_OTELCOLLECTOR_ENABLED=true \ > DD_AGENT_MAJOR_VERSION=7 \ > bash -c "$(curl -L https://install.datadoghq.com/scripts/install_script_agent7.sh)" > > sudo datadog-agent status > ``` > > If the Datadog Agent is already installed, follow the [Datadog DDOT Collector documentation](https://docs.datadoghq.com/opentelemetry/setup/ddot_collector/install/linux/) for the matching Agent version. > [tab] Upstream otelcol-contrib > > Install an OpenTelemetry Collector distribution that includes the Prometheus receiver, Datadog exporter, transform processor, filter processor, cumulative-to-delta processor, memory limiter processor, batch processor, and health check extension. The examples below use `/etc/otelcol/config.yaml` and a custom `otelcol` systemd service. > > Confirm the Collector binary is available: > > ```bash theme={null} > --version > ``` ### Step 3: Configure the Collector Create the Collector configuration file. The following configuration is the Linux version of the standard-minimal profile: it uses static Prometheus scrape targets, keeps only the raw metrics needed by the standard dashboards or rollup processor, creates lower-cardinality `automq_*` rollup metrics, and drops the raw source metrics after the rollups are created. Run this configuration once per AutoMQ cluster from a Collector host that can reach every AutoMQ metrics endpoint. Do not deploy the same profile on every AutoMQ node with only `127.0.0.1:9090` as the target, because local collectors would roll up counters independently before exporting to Datadog. Use the configuration path for your selected Collector: * Datadog DDOT Collector: `/etc/datadog-agent/otel-config.yaml` * Upstream otelcol-contrib: `/etc/otelcol/config.yaml` ```bash theme={null} COLLECTOR_CONFIG_PATH="/etc/datadog-agent/otel-config.yaml" # Datadog DDOT Collector # COLLECTOR_CONFIG_PATH="/etc/otelcol/config.yaml" # Upstream otelcol-contrib sudo mkdir -p "$(dirname "$COLLECTOR_CONFIG_PATH")" ``` ```bash theme={null} COLLECTOR_CONFIG_PATH="/etc/datadog-agent/otel-config.yaml" # Datadog DDOT Collector # COLLECTOR_CONFIG_PATH="/etc/otelcol/config.yaml" # Upstream otelcol-contrib sudo tee "$COLLECTOR_CONFIG_PATH" > /dev/null << 'EOF' receivers: prometheus: config: scrape_configs: - job_name: "" scrape_interval: 15s honor_labels: true static_configs: - targets: - ":9090" - ":9090" - ":9090" labels: env_id: "" instance_id: "" metric_relabel_configs: - source_labels: [__name__] action: keep regex: "^(consumer_(offset_lag_count|estimated_time_lag_milliseconds)|jvm_cpu_(count|time_seconds_total)|kafka_(node(_metadata|_info)?|broker_(active_count|fenced_count|network_io_bytes_total)|group_(count|stable_count|empty_count|dead_count|preparing_rebalance_count|completing_rebalance_count|commit_offset)|log_(size|end_offset)|message_count_total|network_io_bytes_total|partition_total_count|request_error_count_total|stream_topic_partition_count|tabletopic_(delay_milliseconds|fps_fields_per_second)|topic_(count|request_count_total)))$" - action: labeldrop regex: "^(active_controller|customer|exported_env_id|exported_instance_id|exported_job|instance|link_id|operation_name|operation_type|otel_scope_name|pool_type|request|request_type|size|source_node_id)$" exporters: datadog: api: # Upstream otelcol-contrib: keep these environment references and set DD_API_KEY/DD_SITE before starting the service. # Datadog DDOT Collector: either set these environment variables for datadog-agent, or remove this api block to use the core Agent configuration. key: ${env:DD_API_KEY} site: ${env:DD_SITE} extensions: health_check: endpoint: 0.0.0.0:13133 processors: memory_limiter: check_interval: 1s limit_mib: 1024 spike_limit_mib: 256 batch: timeout: 10s send_batch_size: 10000 cumulativetodelta/automq_counters: initial_value: auto include: match_type: strict metrics: - kafka_network_io_bytes_total - kafka_message_count_total - kafka_topic_request_count_total - kafka_broker_network_io_bytes_total - kafka_request_error_count_total transform/automq_rollups: error_mode: ignore metric_statements: - context: metric statements: - copy_metric(name="automq_topic_log_size") where metric.name == "kafka_log_size" - aggregate_on_attributes("sum", ["env_id", "instance_id", "service", "topic"]) where metric.name == "automq_topic_log_size" - copy_metric(name="automq_topic_log_end_offset") where metric.name == "kafka_log_end_offset" - aggregate_on_attributes("sum", ["env_id", "instance_id", "service", "topic"]) where metric.name == "automq_topic_log_end_offset" - copy_metric(name="automq_topic_network_io_bytes_total") where metric.name == "kafka_network_io_bytes_total" - aggregate_on_attributes("sum", ["env_id", "instance_id", "service", "topic", "direction"]) where metric.name == "automq_topic_network_io_bytes_total" - copy_metric(name="automq_topic_message_count_total") where metric.name == "kafka_message_count_total" - aggregate_on_attributes("sum", ["env_id", "instance_id", "service", "topic", "direction"]) where metric.name == "automq_topic_message_count_total" - copy_metric(name="automq_topic_request_count_total") where metric.name == "kafka_topic_request_count_total" - aggregate_on_attributes("sum", ["env_id", "instance_id", "service", "topic", "type"]) where metric.name == "automq_topic_request_count_total" - copy_metric(name="automq_cluster_broker_network_io_bytes_total") where metric.name == "kafka_broker_network_io_bytes_total" - aggregate_on_attributes("sum", ["env_id", "instance_id", "service", "direction"]) where metric.name == "automq_cluster_broker_network_io_bytes_total" - copy_metric(name="automq_request_error_count_total") where metric.name == "kafka_request_error_count_total" - aggregate_on_attributes("sum", ["env_id", "instance_id", "service", "error"]) where metric.name == "automq_request_error_count_total" - copy_metric(name="automq_topic_partition_count") where metric.name == "kafka_stream_topic_partition_count" - aggregate_on_attributes("sum", ["env_id", "instance_id", "service", "topic"]) where metric.name == "automq_topic_partition_count" - copy_metric(name="automq_topic_rack_partition_count") where metric.name == "kafka_stream_topic_partition_count" - aggregate_on_attributes("sum", ["env_id", "instance_id", "service", "topic", "rack"]) where metric.name == "automq_topic_rack_partition_count" - copy_metric(name="automq_group_count") where metric.name == "kafka_group_count" - aggregate_on_attributes("sum", ["env_id", "instance_id", "service"]) where metric.name == "automq_group_count" - copy_metric(name="automq_group_stable_count") where metric.name == "kafka_group_stable_count" - aggregate_on_attributes("sum", ["env_id", "instance_id", "service"]) where metric.name == "automq_group_stable_count" - copy_metric(name="automq_group_empty_count") where metric.name == "kafka_group_empty_count" - aggregate_on_attributes("sum", ["env_id", "instance_id", "service"]) where metric.name == "automq_group_empty_count" - copy_metric(name="automq_group_dead_count") where metric.name == "kafka_group_dead_count" - aggregate_on_attributes("sum", ["env_id", "instance_id", "service"]) where metric.name == "automq_group_dead_count" - copy_metric(name="automq_group_preparing_rebalance_count") where metric.name == "kafka_group_preparing_rebalance_count" - aggregate_on_attributes("sum", ["env_id", "instance_id", "service"]) where metric.name == "automq_group_preparing_rebalance_count" - copy_metric(name="automq_group_completing_rebalance_count") where metric.name == "kafka_group_completing_rebalance_count" - aggregate_on_attributes("sum", ["env_id", "instance_id", "service"]) where metric.name == "automq_group_completing_rebalance_count" - copy_metric(name="automq_consumer_group_topic_commit_offset") where metric.name == "kafka_group_commit_offset" - copy_metric(name="automq_group_topic_offset_lag") where metric.name == "consumer_offset_lag_count" - copy_metric(name="automq_group_topic_estimated_time_lag_milliseconds") where metric.name == "consumer_estimated_time_lag_milliseconds" - aggregate_on_attributes("max", ["env_id", "instance_id", "service", "group", "topic"]) where metric.name == "automq_group_topic_estimated_time_lag_milliseconds" - context: datapoint statements: - set(datapoint.attributes["group"], datapoint.attributes["consumer_group"]) where metric.name == "automq_consumer_group_topic_commit_offset" and datapoint.attributes["consumer_group"] != nil - set(datapoint.attributes["consumer_group"], datapoint.attributes["group"]) where metric.name == "automq_group_topic_offset_lag" and datapoint.attributes["group"] != nil - context: metric statements: - aggregate_on_attributes("sum", ["env_id", "instance_id", "service", "consumer_group", "group", "topic"]) where metric.name == "automq_consumer_group_topic_commit_offset" - aggregate_on_attributes("sum", ["env_id", "instance_id", "service", "consumer_group", "group", "topic"]) where metric.name == "automq_group_topic_offset_lag" filter/drop_raw_replaced_metrics: metrics: metric: - 'name == "kafka_log_size"' - 'name == "kafka_log_end_offset"' - 'name == "kafka_network_io_bytes_total"' - 'name == "kafka_message_count_total"' - 'name == "kafka_broker_network_io_bytes_total"' - 'name == "kafka_topic_request_count_total"' - 'name == "kafka_request_error_count_total"' - 'name == "kafka_stream_topic_partition_count"' - 'name == "kafka_group_count"' - 'name == "kafka_group_stable_count"' - 'name == "kafka_group_empty_count"' - 'name == "kafka_group_dead_count"' - 'name == "kafka_group_preparing_rebalance_count"' - 'name == "kafka_group_completing_rebalance_count"' - 'name == "kafka_group_commit_offset"' - 'name == "consumer_offset_lag_count"' - 'name == "consumer_estimated_time_lag_milliseconds"' service: extensions: [health_check] pipelines: metrics: receivers: [prometheus] processors: [memory_limiter, cumulativetodelta/automq_counters, transform/automq_rollups, filter/drop_raw_replaced_metrics, batch] exporters: [datadog] EOF ``` > [!NOTE] > > With `honor_labels: true`, if the scraped AutoMQ endpoint already exposes a Prometheus `job` label, that target-provided value is preserved and `job_name` is not used for that label. Standard AutoMQ metrics normally expose `job` as the cluster identifier, and Datadog maps that label to the `service` tag used by the dashboard `cluster_id` filter. If the endpoint does not expose `job`, `job_name` becomes the fallback value. The static `env_id` and `instance_id` labels are optional; set them only when you want those Datadog dashboard filters to have values for this Linux collection path. > [!NOTE] > > This Gateway profile performs rollups in the Collector to reduce Datadog custom metrics cardinality. It is not equivalent to a Prometheus recording rule and cannot express `max by (..., partition)` across scrape targets followed by `sum by (...)`. If you need strict deduplication when the same partition gauge is temporarily exposed by multiple AutoMQ nodes during partition migration, add a Prometheus recording-rule / federation layer before Datadog, or keep the partition dimension and handle it explicitly in Datadog queries. ### Step 4: Start the Collector > [tab] Datadog DDOT Collector > > Restart the Datadog Agent and verify the embedded Collector status: > > ```bash theme={null} > sudo systemctl restart datadog-agent > sudo datadog-agent status > ``` > [tab] Upstream otelcol-contrib > > For a foreground smoke test, run the Collector directly: > > ```bash theme={null} > DD_API_KEY="" \ > DD_SITE="" \ > --config /etc/otelcol/config.yaml > ``` > > For a systemd deployment, create a dedicated service user and environment file: > > ```bash theme={null} > sudo useradd --system --home /var/lib/otelcol --shell /usr/sbin/nologin otelcol || true > sudo install -d -o otelcol -g otelcol /var/lib/otelcol > > sudo tee /etc/default/otelcol > /dev/null << 'EOF' > DD_API_KEY= > DD_SITE= > EOF > ``` > > Limit access to this file because it contains your Datadog API key. Also avoid pasting real keys into shared shell history or logs. > > ```bash theme={null} > sudo chmod 600 /etc/default/otelcol > ``` > > ```bash theme={null} > sudo tee /etc/systemd/system/otelcol.service > /dev/null << 'EOF' > [Unit] > Description=OpenTelemetry Collector for AutoMQ Datadog metrics > After=network-online.target > Requires=network-online.target > > [Service] > User=otelcol > Group=otelcol > EnvironmentFile=/etc/default/otelcol > ExecStart= --config /etc/otelcol/config.yaml > Restart=always > RestartSec=5 > NoNewPrivileges=true > ProtectSystem=full > ProtectHome=true > PrivateTmp=true > StateDirectory=otelcol > > [Install] > WantedBy=multi-user.target > EOF > > sudo systemctl daemon-reload > sudo systemctl enable otelcol > sudo systemctl start otelcol > ``` ### Step 5: Verify Open Datadog **Metrics > Explorer**, search for AutoMQ metrics such as `kafka_broker_active_count`, and filter by `service:`. In the imported dashboards, the filter is still named `cluster_id`, but it reads values from the Datadog `service` tag. If the expected service value does not appear, check one AutoMQ `/metrics` endpoint and confirm the actual `job` label because `honor_labels: true` preserves the target-provided `job` value. If your AutoMQ environment exposes native `env_id`, `instance_id`, or `broker_id` labels, you can use them as additional filters. New metrics may take 1–3 minutes to appear. ![AutoMQ metrics visible in Datadog Metrics Explorer after Linux Gateway OTEL Collector integration](https://mintcdn.com/automq/6t03b99H9kP_jCZq/automq-cloud/monitoring-alert/integrating-metrics-with-datadog/5.webp?fit=max\&auto=format\&n=6t03b99H9kP_jCZq\&q=85\&s=bf20f35143036758a80ec30a7b4028a7) ## Appendix: Manually enable AutoMQ metrics export for Kubernetes Software AutoMQ Cloud BYOC clusters expose the Prometheus metrics endpoint by default. Use this appendix only when you manage an AutoMQ Software deployment on Kubernetes and need to enable the endpoint manually. For AutoMQ Software deployments on Kubernetes via Helm, set the metrics exporter to Prometheus mode in your Helm values: ```yaml theme={null} global: config: | s3.telemetry.metrics.exporter.uri=prometheus://?host=0.0.0.0&port=9090 ``` This exposes Prometheus-format metrics on port 9090 of each AutoMQ pod. The Datadog Agent Gateway profile in this guide uses selector-based Kubernetes discovery, so it does not require Prometheus scrape annotations to discover AutoMQ pods. If you also use an annotation-based Prometheus or Datadog collector outside of this profile, add the following annotations to the AutoMQ Helm values: ```yaml theme={null} controller: annotations: prometheus.io/automq-scrape: "true" prometheus.io/automq-port: "9090" prometheus.io/automq-path: "/metrics" broker: annotations: prometheus.io/automq-scrape: "true" prometheus.io/automq-port: "9090" prometheus.io/automq-path: "/metrics" ``` ## References * [Datadog Agent Helm Chart](https://github.com/DataDog/helm-charts/tree/main/charts/datadog) * [Datadog OTEL Collector on Kubernetes](https://docs.datadoghq.com/opentelemetry/setup/ddot_collector/install/kubernetes/?tab=helm) * [Datadog DDOT Collector on Linux](https://docs.datadoghq.com/opentelemetry/setup/ddot_collector/install/linux/) * [OpenTelemetry Prometheus Receiver](https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/receiver/prometheusreceiver) # Monitor consumer lag Source: https://docs.automq.com/automq-cloud/monitoring-alert/monitor-consumer-lag Understand AutoMQ consumer lag metrics, how they are calculated, and when to use them. ## What consumer lag means Consumer lag occurs when a consumer group's committed position falls behind writes to a topic. An offset difference alone does not tell you how late the data is: the same difference can represent different delays at different write rates. For consumer groups using the Kafka classic group protocol, AutoMQ BYOC data plane (version 5.5.0 and later) provides offset distance and estimated time lag metrics. ## Metrics and dimensions Both metrics have `group`, `topic`, and `partition` labels. Each series describes one consumer group's position in one topic partition. | Metric | Meaning and calculation | Unit | | - | - | - | | `consumer_offset_lag_count` | The partition's log end offset (LEO) minus the consumer group's committed offset, clamped to `0` if negative. | offsets | | `consumer_estimated_time_lag_milliseconds` | The estimated time lag for the partition, based on an estimated timestamp at the committed offset. | milliseconds | ![The upper offset axis shows Offset Lag of 30 for one partition; the lower time axis shows an estimated time lag of about 5 minutes with LogAppendTime](https://mintcdn.com/automq/okZPgpSeK--UqMcO/automq-cloud/monitoring-alert/monitor-consumer-lag/consumer-lag-metrics.svg?fit=max\&auto=format\&n=okZPgpSeK--UqMcO\&q=85\&s=dd8333b38cfe758ec91e44f967392e57) The committed offset points to the next record to consume. LEO points to the next position to be written. For a group and topic view, deduplicate by partition and exclude `-1` before summing offset distances. Take the maximum time lag across partitions; do not add time lags together. ## Calculation and limitations AutoMQ periodically reads the group's committed offset and the partition's LEO, then calculates their difference within one collection round. To estimate time lag, it samples `(offset, timestamp)` pairs during writes and fetches. Sparse reference points held in memory provide an estimated timestamp for the committed offset. For topics using `LogAppendTime`, time lag is approximately the difference between the current time and that estimated timestamp. With `CreateTime`, the metric reflects a span of record timestamps, not the age of the data relative to the current time. Use these metrics to observe trends and locate backlog. They are not exact counts of records waiting to be consumed or precise end-to-end consumption delay. Compaction, transactions, and offset gaps affect the relationship between offset distance and record count. Sampling and interpolation affect the time estimate. Offset lag is `-1` when LEO is unavailable; time lag can also be `-1` when usable timestamp reference points are missing. Do not treat `-1` as zero lag. If a series is missing, also check whether the group has committed an offset and whether metrics are being collected. ## Use the metrics in dashboards and alerts You can use these metrics in Grafana or another monitoring system to build group, topic, or partition views and set alert thresholds based on your application's acceptable lag. For group views, sum offset distances across partitions and use the slowest partition's time lag. Monitor `-1` values as well so that unknown results do not disappear in an aggregate. For example: * **Dashboard:** To monitor the `order-processor` group on the `orders` topic, show the sum of partition offset distances, the maximum estimated time lag, and the number of partitions with a time lag of `-1`. If an aggregate rises, drill down to the affected partitions. * **Alert:** If `orders` uses `LogAppendTime` and you want an early warning when estimated time lag exceeds 5 minutes, alert when the slowest partition remains above `300000` milliseconds for 5 minutes. Alert separately on persistent `-1` values so an unavailable estimate does not appear healthy. For metric collection and a dashboard template, see [Prometheus monitoring and alerts](./monitoring-alert-via-prometheus). # Monitoring & Alert Via Prometheus Source: https://docs.automq.com/automq-cloud/monitoring-alert/monitoring-alert-via-prometheus AutoMQ offers cloud-native scalability and cost efficiency with Kafka compatibility. Monitor Kafka metrics effortlessly using Prometheus and Grafana, integrating custom alerts seamlessly. Metrics are crucial analytical data for system observability. AutoMQ supports exposing various native Apache Kafka® Metrics data through Prometheus. This article outlines the details of the Metrics exposed by AutoMQ. ## Metrics collection methods AutoMQ supports Prometheus-compatible monitoring through the following methods: 1. **Remote Write:** AutoMQ pushes metrics directly to a user-provided Prometheus Remote Write endpoint. Configure the endpoint and authentication when you create or update the instance. 2. **Exporter:** AutoMQ exposes a Prometheus-compatible scrape endpoint that your monitoring system pulls. Exporter service discovery depends on the deployment platform: * **Kubernetes deployments:** Discover the scrape endpoint by using standard Prometheus annotations on Kubernetes resources. * **Virtual machine deployments:** Discover the hosts by using the host tags provided by the cloud provider. Both methods provide metrics collection and delivery. Configure dashboards and alerts in your Prometheus-compatible monitoring system. AutoMQ also provides [Grafana dashboard templates](https://download.automq.com/automq-dashboard/dashboard-20260203.zip) and [Prometheus alert rule templates](#kafka-cluster-alert-templates). ## Prometheus Metrics Definitions For metric names, labels, and definitions, see [Prometheus Metrics in the AutoMQ open-source documentation](/automq/observability/prometheus-metrics). ## Grafana Dashboard Example As mentioned above, AutoMQ Cloud does not offer managed Grafana dashboard services. Users can refer to the Grafana templates provided by AutoMQ to quickly configure dashboards. The related dashboard templates can be downloaded from [this link](https://download.automq.com/automq-dashboard/dashboard-20260203.zip). The pre-configured Grafana dashboard templates offer metric monitoring across different dimensions: * **Cluster Overview:** Provides cluster-level monitoring, including node count, data size, cluster traffic, etc. It also includes metric overviews for Topic, Group, and Broker dimensions and offers drill-down capabilities for detailed monitoring. ![](https://mintcdn.com/automq/6t03b99H9kP_jCZq/automq-cloud/monitoring-alert/monitoring-alert-via-prometheus/2.webp?fit=max\&auto=format\&n=6t03b99H9kP_jCZq\&q=85\&s=a3515572a1427a00fd60ac7ca006b16c) * **Broker Metrics:** Offers broker-level monitoring, including connection count, partition count, node traffic, node requests, and more. ![](https://mintcdn.com/automq/6t03b99H9kP_jCZq/automq-cloud/monitoring-alert/monitoring-alert-via-prometheus/3.webp?fit=max\&auto=format\&n=6t03b99H9kP_jCZq\&q=85\&s=bbfcaa4a8532614efd6127c89a6441ea) * **Topic Metrics:** Provides topic-level metric monitoring, including message throughput, total data volume, partition count, and consumption latency. ![](https://mintcdn.com/automq/6t03b99H9kP_jCZq/automq-cloud/monitoring-alert/monitoring-alert-via-prometheus/4.webp?fit=max\&auto=format\&n=6t03b99H9kP_jCZq\&q=85\&s=234687b9bbed338e470c972ecc83689c) * **Group Metrics:** Delivers group-level metric monitoring, including consumption rate and consumption latency. ![](https://mintcdn.com/automq/6t03b99H9kP_jCZq/automq-cloud/monitoring-alert/monitoring-alert-via-prometheus/5.webp?fit=max\&auto=format\&n=6t03b99H9kP_jCZq\&q=85\&s=acfb68b146173651826db6a3482eec4c) ## Business Monitoring and Alerts After sending AutoMQ metrics to Prometheus, configure alerts for cluster capacity, topic writes, and consumer time lag according to your workload. ### Kafka Cluster Alert Templates These Prometheus alert templates cover cluster capacity, topic writes, and consumer freshness. Select the rules your applications need, then adjust the filters, thresholds, and duration to match the workload. Prometheus evaluates the rules; Alertmanager routes notifications. Confirm that your deployment exports the required metrics. Metrics and labels may vary by deployment and version. The examples assume `job` identifies a cluster. If `job` identifies a scrape target, use the label that identifies your cluster. | Alert | Example condition | Suitable workload | | - | - | - | | Broker CPU reaches 80% of the AutoMQ safety watermark | A broker's `automq_cpu_ratio` exceeds `0.8`. | You want notice before a broker reaches AutoMQ's CPU safety watermark. | | Broker network usage above 80% | A broker's `automq_network_ratio * 0.8` exceeds `0.8`. | You want to track underlying network utilization. | | Topic total write rate drop | The topic total over the current 5 minutes falls below 50% of the 5-minute window from 10 minutes earlier, provided that baseline rate was at least 5 MiB/s. | A topic receives steady writes. | | Consumer time lag above 2 minutes | The highest estimated lag among a group's topic partitions exceeds 120,000 ms. | Consumers normally follow the latest records. | | Consumer time lag up 10 minutes from yesterday | The group's highest estimated lag exceeds its value at the same time yesterday by 600,000 ms. | A group accumulates predictable lag during daily peaks. | #### Prometheus rule examples By default, the templates match all nonempty topics and consumer groups. Adjust the `topic` and `group` filters and comparison thresholds to match the resources and workload you want to monitor. ```yaml theme={null} groups: - name: automq_customer_alerts rules: - alert: AutoMQBrokerCPUSafetyWatermarkHigh expr: max by (job) (automq_cpu_ratio) > 0.8 for: 5m labels: severity: warning annotations: summary: "Cluster {{ $labels.job }} reached 80% of AutoMQ's CPU safety watermark on its busiest broker" - alert: AutoMQBrokerNetworkUsageHigh expr: max by (job) (automq_network_ratio * 0.8) > 0.8 for: 5m labels: severity: warning annotations: summary: "Cluster {{ $labels.job }} network usage exceeded 80% on its busiest broker" - alert: AutoMQTopicWriteRateDrop expr: | ( sum by (job, topic) (max by (job, topic, partition) ( rate(kafka_network_io_bytes_total{direction="in", topic=~".+"}[5m]) )) < 0.5 * sum by (job, topic) (max by (job, topic, partition) ( rate(kafka_network_io_bytes_total{direction="in", topic=~".+"}[5m] offset 10m) )) ) and on (job, topic) sum by (job, topic) (max by (job, topic, partition) ( rate(kafka_network_io_bytes_total{direction="in", topic=~".+"}[5m] offset 10m) )) >= 5 * 1024 * 1024 for: 5m labels: severity: warning annotations: summary: "Topic {{ $labels.topic }} total write rate dropped in cluster {{ $labels.job }}" - alert: AutoMQConsumerTimeLagHigh expr: | max by (job, group, topic) ( consumer_estimated_time_lag_milliseconds{group=~".+", topic=~".+"} >= 0 ) > 120000 for: 5m labels: severity: warning annotations: summary: "Consumer group {{ $labels.group }} in cluster {{ $labels.job }} is more than 2 minutes behind on topic {{ $labels.topic }}" - alert: AutoMQConsumerTimeLagAboveYesterday expr: | ( max by (job, group, topic) ( consumer_estimated_time_lag_milliseconds{group=~".+", topic=~".+"} >= 0 ) - max by (job, group, topic) ( consumer_estimated_time_lag_milliseconds{group=~".+", topic=~".+"} offset 1d >= 0 ) ) > 600000 for: 5m labels: severity: warning annotations: summary: "Consumer group {{ $labels.group }} in cluster {{ $labels.job }} exceeds yesterday's lag by 10 minutes on topic {{ $labels.topic }}" ``` Check the expressions against your metrics before routing notifications. An absent metric or an unavailable yesterday value does not satisfy these comparisons; configure a separate missing-metrics alert if you need to monitor data collection. ### Managed Connector Alert Templates AutoMQ also provides a series of alert templates for Managed Connector scenarios to monitor Connector task status, resource usage, and data processing anomalies. The list of alert rule templates is as follows: | **Alert Rule Item** | **Function and Scenario** | | - | - | | TasksFailed |
  • Alert Rule: Connector Task Failure Alert
  • Function and Scenario: Monitors if the number of failed Connector tasks is greater than 0, used to detect task anomalies promptly.
| | CPUUsage |
  • Alert Rule: High CPU Usage Alert
  • Function and Scenario: Monitors if the CPU usage of a Connector instance exceeds 80%, used to monitor resource pressure.
| | TotalRecordFailures |
  • Alert Rule: Record Processing Failure Alert
  • Function and Scenario: Monitors if the total number of failed records processed by Connector tasks is greater than 0, used to detect data processing anomalies.
| | FailedAuthenticationConnections |
  • Alert Rule: Authentication Failure Connection Alert
  • Function and Scenario: Monitors the number of failed authentication connections between Connector and Kafka cluster, used to detect connection configuration issues.
| A complete alert template YAML file can be found below for copying and importing. ```yaml theme={null} groups: - name: connect_alerts rules: - alert: TasksFailed expr: sum(kafka_connect_worker_metrics_connector_failed_task_count{connect_instance_id=~"", connector=~""}) > 0 for: 1m labels: severity: critical annotations: summary: "Connector tasks failed for {{ $labels.connector }} in connect instance {{ $labels.connect_instance_id }}" description: "The number of failed tasks for connector {{ $labels.connector }} is greater than 0." - alert: CPUUsage expr: rate(jvm_cpu_time_seconds_total{connect_instance_id=~""}[5m]) > 0.8 for: 1m labels: severity: warning annotations: summary: "High CPU usage {{ printf \"%0.2f\" $value }} for connect instance {{ $labels.connect_instance_id }}" description: "The CPU usage of connect instance {{ $labels.connect_instance_id }} is exceeding 80%." - alert: TotalRecordFailures expr: kafka_task_error_metrics_total_record_failures_total{connect_instance_id=~"", connector=~""} > 0 for: 1m labels: severity: warning annotations: summary: "Record failures detected for connector {{ $labels.connector }} task {{ $labels.task }}" description: "The total record failures for connector {{ $labels.connector }} task {{ $labels.task }} is greater than 0." - alert: FailedAuthenticationConnections expr: kafka_connect_metrics_failed_authentication_total{connect_instance_id=~"", client_id!=""} > 0 for: 1m labels: severity: warning annotations: summary: "Failed authentication connections for client {{ $labels.client_id }} in connect instance {{ $labels.connect_instance_id }}" description: "The number of failed authentication connections for client {{ $labels.client_id }} is greater than 0." ``` > [!TIP] > > When using the Managed Connector alert templates, replace `` and `` with your actual Connect instance ID and Connector name. # Release Notes Source: https://docs.automq.com/automq-cloud/release-notes Experience seamless cloud-native scalability and full Kafka API compatibility with AutoMQ, cutting costs while ensuring robust data infrastructure management across various cloud environments. # Version Numbers AutoMQ Cloud employs a versioning format of `{major version}.{minor version}.{patch version}` for its releases. * **Major version:** Indicates major upgrades or changes and is incremented when significant updates are made. This version may be backward incompatible. * **Minor version:** Represents the addition of new features that maintain backward compatibility. * **Patch version:** Represents fixes for issues while maintaining backward compatibility. # Historical Versions Each official release of AutoMQ Cloud corresponds to a specific [automq](https://github.com/AutoMQ/automq-for-kafka) kernel version and a compatible range of Apache Kafka versions. The current historical version information for AutoMQ Cloud is as follows: | **Environment Console Version** | **Data Plane Cluster Version** | **Compatible Apache Kafka Versions** | | - | - | - | | 8.3.1 | 1.0.0 \~ 5.5.x | 0.9.0.x \~ 3.9.x | | 8.1.2 | 1.0.0 \~ 5.3.5 | 0.9.0.x \~ 3.9.x | | 8.0.0 | 1.0.0 \~ 5.3.1 | 0.9.0.x \~ 3.9.x | | 7.8.7 | 1.0.0 \~ 5.3.1 | 0.9.0.x \~ 3.9.x | | 7.7.4 | 1.0.0 \~ 5.2.0 | 0.9.0.x \~ 3.9.x | | 7.6.0 | 1.0.0 \~ 5.1.0 | 0.9.0.x \~ 3.9.x | | 7.5.1 | 1.0.0 \~ 5.0.1 | 0.9.0.x \~ 3.9.x | | 7.4.0 | 1.0.0 \~ 5.0.0 | 0.9.0.x \~ 3.9.x | | 7.3.1 | 1.0.0 \~ 1.4.1 | 0.9.0.x \~ 3.9.x | | 7.2.0 | 1.0.0 \~ 1.4.0 | 0.9.0.x \~ 3.9.x | | 7.1.0 | 1.0.0 \~ 1.4.0-beta1 | 0.9.0.x \~ 3.9.x | | 7.0.0 | 1.0.0 \~ 1.4.0-beta1 | 0.9.0.x \~ 3.9.x | | 1.6.5 | 1.0.0 \~ 1.4.0-beta1 | 0.9.0.x \~ 3.9.x | | 1.5.10 | 1.0.0 \~ 1.4.0-beta1 | 0.9.0.x \~ 3.9.x | | 1.5.4 | 1.0.0 \~ 1.4.0-beta | 0.9.0.x \~ 3.9.x | | 1.5.3 | 1.0.0 \~ 1.3.5 | 0.9.0.x \~ 3.9.x | | 1.3.7 | 1.0.0 \~ 1.2.5 | 0.9.0.x \~ 3.8.x | | 1.3.2 | 1.0.0 \~ 1.2.2 | 0.9.0.x \~ 3.8.x | | 1.2.8 | 1.0.0 \~ 1.2.0 | 0.9.0.x \~ 3.8.x | | 1.2.1 | 1.0.0 \~ 1.1.1 | 0.9.0.x \~ 3.7.x | | 1.1.3 | 1.0.0 \~ 1.1.1 | 0.9.0.x \~ 3.7.x | | 1.1.1 | 1.0.0 \~ 1.1.0 | 0.9.0.x \~ 3.7.x | | 1.1.0 | 1.0.0 \~ 1.1.0 | 0.9.0.x \~ 3.7.x | | 1.0.0 | 1.0.0 \~ 1.0.4 | 0.9.0.x \~ 3.4.x | ## Historical Versions of Environment Console ### 8.3.1 * Supports modifying cloud resource tags in AWS environments. * Supports custom security groups. * Supports dynamic configuration changes for NFS WAL instances that use EFS or FSx for NetApp ONTAP, so you can adjust throughput specifications as needed. * Supports small instance specifications and vertical EC2 instance type changes in AWS environments. * Adds consumer lag metrics that do not require user-side aggregation, and adds metrics for consumer delay time. * Supports independent Schema Registry configuration management. * Refactors the Managed Connector model to support independent Worker cluster management and sharing one Worker cluster across multiple Connectors. ### 8.1.2 * Optimized the ops channel: a secure and controllable ops channel can be achieved based on ngrok. * Managed Connector supports custom node pools, custom K8S scheduling policies, Kafka multi-protocol selection control, and version upgrades, optimizing the experience of Plugin management and log query. * Support custom node pools when deploying clusters on EKS, removing the limitation of the AL2 system. * Support for FSx WAL instances in AWS environments. * Support for viewing the creation status of instances being created, exposing necessary error messages. * Optimized several defects in KafkaLinking to support more accurate automatic Group promotion. * Support for setting custom security groups when creating instances. * The installation and deployment console supports custom IAM policies for the console. ### 8.0.0 * Simplified the console installation and initialization process with Docker. * Provided a managed Kafka Connect service with built-in managed plugins for MongoDB, Clickhouse, and ClickZetta, supporting one-click data ETL. * Supported Pod Identity authentication for AWS EKS mode deployments. * Enabled Kafka Linking to access source clusters via SASL\_SSL and mTLS protocols. * Enhanced security by supporting certificate domain validation for deployments using SASL\_SSL and mTLS. * Supported cloud resource tags, allowing custom tags to be set for cloud resources used by AutoMQ. * Fixed other known defects and optimizations. ### 7.8.7 * Support for data plane version 5.3.1, with FSxWAL support in AWS environments. * Support for setting custom Tags in AWS environments. ### 7.7.4 * Support for Prometheus RemoteWrite integration with custom Labels. * Support for custom Placeholders in Kubernetes deployment. ### 7.6.0 * Support reducing cross-availability zone traffic for producers and consumers in AWS environments. * Support disaster recovery for object storage in Tencent Cloud environments. ### 7.5.1 * Support for extended custom Listener and AdvertisedListener mapping. ### 7.4.0 * Supports Kafka Linking for zero-downtime cluster migrations. * Supports deployment to Azure. ### 7.3.1 * Supports data plane version 1.4.1. * Supports the maintenance channel, enabling secure and controllable remote operation and maintenance. * Supports metric integration into the Kafka Topic. * TableTopic functionality integrates with Hive Metastore Catalog. * Supports instance lifecycle OpenAPI. ### 7.2.0 * Supports data plane version 1.4.0. * Optimize the failover mechanism in Kubernetes deployment to achieve faster recovery time. ### 7.1.0 * Supports data plane version 1.3.10. * Supports storage encryption on AWS cloud environments. * Enhance the rate-limiting mechanism of object storage to ensure smoother read and write traffic during rate-limiting triggers. ### 7.0.0 * Change the version number sequence starting from 7.0 to avoid confusion with the data plane cluster version. * Each BYOC environment supports multiple DeployProfiles. * Each DeployProfile supports multiple Buckets. * Support for SASL\_SSL and mTLS. * Support for SAML SSO and fine-grained RBAC control. * Supports deployment to Baidu Cloud. ### 1.6.5 * Optimize access point display in load balancing mode. * Support instance creation ranging from 60MiB/s to 10GiB/s. * Add a new customer information registration page. * Fix various issues from previous versions. ### 1.5.10 * Supports deployment on AWS EKS. * Update the supported data plane version to 1.4.0-beta1. * Fixed vulnerabilities in AWS base images (including critical vulnerabilities). ### 1.5.4 * New Table Topic feature, integrating Kafka messages into Iceberg tables and supporting AWS S3 Table Bucket. ### 1.5.3 * Added tag management feature, supporting the passthrough of cloud resource tags used by AutoMQ. * Introduced scheduled elasticity rules, supporting one-time and recurring scheduled elasticity rules for planned scaling. * Added inbound rule control for access points, allowing custom source CIDR allowlist settings. ### 1.3.7 * Fixed an issue where AWS CloudFormation could not install using an existing VPC subnet. ### 1.3.2 * Supports accessing the environment console using a fixed EIP in the AWS environment. * Support for creating 3AKU specification instances. On AWS, small specifications support Graviton-based EC2 instances. * Supports creating instances with S3 WAL type. * Fixed upgrade issues when using AWS CloudFormation installation method. ### 1.2.8 * Supports Prometheus RemoteWrite integration. * Supports querying offline Consumer Group lag data. * Supports custom version selection when upgrading instance versions. * Supports instance version 1.2.0, compatible with Apache Kafka 3.8.x. ### 1.2.1 * Adds service account functionality. * Supports Terraform Provider, allowing management of instances, Topics, and other resources through Terraform. * Supports CloudWatch integration, forwarding metrics data to CloudWatch. ### 1.1.3 * Data plane cluster upgrade supports version 1.1.1. ### 1.1.1 * Fixed an issue where migration task metrics were displayed inaccurately. ### 1.1.0 * Upgraded the AutoMQ environment console to CloudScape UI style. * AutoMQ clusters support ACL management and custom authorization. ### 1.0.0 * Available for purchase on Alibaba Cloud Marketplace. * Supports AutoMQ Kafka instance lifecycle management. * Supports Topic lifecycle management. * Supports Consumer Group lifecycle management. * Supports Metrics integration. * Supports user management and role authorization. ## Historical Versions of Data Plane Cluster ### 5.5.6 * Improves failover handling by using volume zones for discovery. * Improves Azure credential handling and DNS and volume operations. * Improves KafkaLinking fetch behavior, offset initialization, and metadata-change recovery. * Handles zero-byte reads from detached WAL devices. ### 5.5.5 * Maintenance release with security and stability improvements. ### 5.5.4 * Improves throughput and stability for high-throughput workloads. * Improves S3 WAL failover and recovery reliability. * Improves Kubernetes deployment compatibility and TLS and dynamic DNS configuration. ### 5.5.3 * Improves cluster availability and failover recovery. * Improves TLS and dynamic DNS support and client compatibility during partition movement. * Improves ListOffsets performance. ### 5.5.2 * Adds cross-AZ failover support for Alibaba Cloud Regional ESSD WAL. ### 5.5.1 * Improves stability during object-storage operations and failover recovery. ### 5.5.0 * Adds Consumer Lag time-lag collection and offset-timestamp query support. * Improves S3 WAL failover and Kubernetes scale-in reliability. ### 5.4.3 * Fixed an issue where ByteBuf could be released multiple times. * Fixed an issue where partitions could not be expanded after Linking Promoted. * Upgraded the Linux base image to fix CVE-2026-31431. ### 5.4.0 * ZeroZone supports EFS as a low-latency storage medium. * Fixed an issue where linking Topics with no data caused ZeroZone to fail cross-AZ consumption. * Fixed a memory leak issue in ZeroZone mode. ### 5.3.5 * Optimized Kafka Linking related functions: * Support for more accurate Group promotion. * Optimized performance. * Support for AWS FSx WAL instances. * Support for deployment based on EKS custom node pools, removing the limitation of the AL2 system. ### 5.3.1 * Support for FSWAL clusters in AWS environments. * Optimized several known kernel issues. ### 5.2.0 * Optimized Kubernetes deployment with support for custom Placeholders. * Fixed various kernel issues. ### 5.1.0 * Support reducing cross-availability zone traffic for producers and consumers in AWS environments. * Support disaster recovery for object storage in Tencent Cloud environments. ### 5.0.1 * Support for reporting the expiration date of data plane cluster TLS certificates through Metrics. * Support for extended custom Listener and AdvertisedListener mapping. ### 5.0.0 * Supports Kafka Linking for zero-downtime cluster migrations. * Supports Azure deployment. ### 1.4.1 * TableTopic supports the Hive Metastore Catalog. * Supports metric integration into the Kafka Topic. ### 1.4.0 * Optimize the failover mechanism in Kubernetes deployment to achieve faster recovery time. * Enhance the rate-limiting mechanism of object storage to ensure smoother read and write traffic during rate-limiting triggers. ### 1.4.0-beta1 * Fixed known issues with Table Topic. ### 1.4.0-beta * Support for Table Topic feature, integrating Kafka messages into Iceberg tables and supporting AWS S3 Table Bucket. ### 1.3.10 * Added fast-fail retry optimization for object storage requests. * Fixed the issue with writing large messages. ### 1.3.9 * Supports deployment on AWS EKS. ### 1.3.6 * Fix the issue of reading Compact Topics resulting in a StackOverflow in specific scenarios. ### 1.3.5 * Optimized server-side metadata management, supporting scheduled elasticity rules. ### 1.3.0 * Upgraded version, compatible with Apache Kafka 3.9 version. * Support multi-point writing capability to eliminate cross-AZ traffic. * AutoBalancer performance optimization significantly reduces scheduling frequency. ### 1.2.6 * Fix the issue of consumer stalling in scenarios with extreme concurrent cold reads. ### 1.2.5 * Fixed server-side SASL authentication errors. ### 1.2.4 * Optimized operating system memory fragmentation. ### 1.2.3 * Optimized Kraft's performance in large-scale clusters. ### 1.2.2 * Fixed a problem in AWS environments where mount path conflicts could lead to failover failures. ### 1.2.1 * Fixed an issue where upgrading from 1.1.x to 1.2.0 could result in end offset loss. * Fixed an issue in AWS environments where machines without mounted public IPs could not start properly. ### 1.2.0 * Upgraded version to be compatible with Apache Kafka 3.8. ### 1.1.7 * Optimized operating system memory fragmentation ### 1.1.6 * Fixed resource cleanup issue when client connection is dropped * Resolved compatibility issue with fetch.min.bytes parameter ### 1.1.1 * Optimized self-balancing strategy to reduce the probability of commit offset failure for client versions (\<3.x) ### 1.1.0 * Upgraded version to be compatible with Apache Kafka 3.7. ### 1.0.4 * Fixed several defects from version 1.0.0 upgrade * Enhanced user experience ## Additional Notes: * Maintain a consistent release cadence across processor architectures. # Obtaining Services Source: https://docs.automq.com/automq-cloud/support/obtaining-services AutoMQ Cloud provides comprehensive technical support through one-on-one expert services via online tickets, Slack, and service email, ensuring effective assistance for enterprise users. This article introduces how to obtain technical support and services when using the AutoMQ Cloud product. ## AutoMQ Cloud Technical Support After enterprise users purchase a paid subscription to AutoMQ Cloud, AutoMQ technical personnel will establish a one-on-one expert service guarantee system for enterprise customers, providing comprehensive technical consulting, communication, emergency response, and other support. Customers can choose the following channels to contact us based on their current communication preferences. > [tab] Online Ticket > > The AutoMQ official website offers a ticket system. Customers can visit the official [Contact Us](https://www.automq.com/contact) page to submit relevant information. > [tab] Slack > > AutoMQ offers a public consultation channel for Slack users. Customers using Slack can contact us by joining the [AutoMQ Slack Channel](https://go.automq.com/slack). > [tab] Service Email > > AutoMQ Cloud provides a public email for technical services. Customers can reach us at [support@automq.com](mailto:support@automq.com) for support. ## Other Media Channels 🌟GitHub: [https://github.com/AutoMQ](https://github.com/AutoMQ) 💻 Official Website: [https://www.automq.com](https://www.automq.com) 🔍 Video Channel: AutoMQ # Service Level Agreement Source: https://docs.automq.com/automq-cloud/support/service-level-agreement Experience superior cloud-native scalability and Kafka compatibility with AutoMQ. Ensure 99.95% service availability, cost-efficiently managing data streaming needs. **AutoMQ Cloud Service Level Agreement** **Effective Date: December 16, 2023** This Service Level Agreement (hereinafter referred to as "SLA") defines the service availability levels, shared responsibility boundaries, and compensation schemes provided by AutoMQ HK Limited to customers for the AutoMQ Cloud (hereinafter referred to as "AutoMQ"). Please note, unless otherwise agreed, this agreement does not apply to public beta, invite-only beta, and free test environments and instances. ## **Definitions** **Service Period** : A service period is one calendar month. **Total Minutes in a Single Instance Service Period** : Calculated as the total number of days in the service period for a single instance × 24 (hours) × 60 (minutes). **Instance Unavailability** : When an AutoMQ instance configured as expected fails to produce messages or encounters message production failures, and this condition lasts for more than one minute, the AutoMQ instance is considered unavailable for that minute. **Single Instance Unavailable Minutes** : The sum of minutes a single AutoMQ instance is unavailable within a service period. **Monthly Service Fee:** The total service fee paid by the customer for a single AutoMQ instance within a service cycle (i.e., a calendar month). If the customer pays for multiple months at once, the monthly service fee will be prorated according to the number of months purchased. ## **Service Availability** **2.1 Service Availability Calculation Method** The service availability of AutoMQ will be calculated for each AutoMQ instance based on the service cycle, using the following two dimensions: Service Availability = (Total minutes in the service cycle for a single instance - Unavailable minutes for a single instance) / Total minutes in the service cycle for a single instance × 100% **2.2 Service Availability Commitment** AutoMQ commits that the service availability for an instance within a service cycle will be no less than 99.95%. **2.3 If the above availability commitment is not met, the customer can receive compensation as stipulated in Section 3 of this agreement.** **Compensation does not cover service unavailability caused by the following reasons:** (1) Attacks on the customer's application by hackers; (2) Loss or leakage of data, credentials, passwords, etc., due to improper maintenance or confidentiality by the customer; (3) Customer's negligence or actions authorized by the customer; (4) Failure to follow AutoMQ product usage documentation or recommendations, such as incorrect changes or releases to AutoMQ instances via the console, API, or CLI; (5) Errors in AutoMQ instances caused by installing third-party software or configurations not provided by AutoMQ; (6) Brief service interruptions due to normal maintenance or upgrades of instances as described in the "AutoMQ Cloud Service Terms"; (7) Force majeure events. ## **Compensation Plan** **3.1 Compensation Standards** For AutoMQ instances, if the service availability falls below 99.95%, compensation can be obtained according to the standards in the table below. The compensation method is limited to vouchers or other deduction tools for purchasing AutoMQ instances. The total compensation amount shall not exceed the single-instance monthly service fee (excluding fees deducted using vouchers) paid by the customer for the AutoMQ instance in the month when the service availability commitment was not met. | **Service Availability** | **Compensation Voucher Amount** | | - | - | | Below 99.95% but equal to or above 99% | 15% of the monthly service fee | | Below 99% but equal to or above 95% | 30% of the monthly service fee | | Below 95% | 100% of the monthly service fee | **3.2 Compensation Application Deadline** Customers may submit compensation claims for AutoMQ instances that did not meet availability requirements within five (5) business days after the end of the month. **Compensation claims must be submitted within two (2) months following the month in which AutoMQ did not meet service availability. Claims submitted beyond this timeframe will not be processed.** ## **Others** **4.1 Service Agreement Amendments** This Service Level Agreement (SLA) takes effect on December 16, 2023. AutoMQ reserves the right to modify the terms of this SLA. If there are any changes to the SLA terms, AutoMQ will notify you 30 days in advance via website announcement or email. If you do not agree with the modifications to the SLA, you have the right to stop using AutoMQ services. Continued use of AutoMQ services will be deemed as acceptance of the modified SLA. **4.2 Responsibility Sharing Model** AutoMQ Cloud offers both SaaS and BYOC deployment models. Based on the deployment model, there are shared responsibilities between AutoMQ and the customer. Refer to the table below for details: **SaaS Model** In the SaaS model, AutoMQ instances are deployed in the service provider's account, and customers do not need to manage the underlying cloud resources of the instances. The related responsibility model is as follows: | **Responsibility** | **AutoMQ Service Provider** | **Customer** | | - | - | - | | Cluster Deployment | Responsible | - | | System Vulnerability Patching | Responsible | - | | Software Version Upgrades | Responsible | - | | Instance Capacity Expansion | Responsible | - | | Cloud Account Authorization | Responsible | - | | Network Connectivity Assurance | Responsible | - | | Service Availability SLA | Responsible | - | **BYOC Deployment Model** In the BYOC deployment model, AutoMQ instances are deployed in the customer's cloud account, allowing customers to manage and monitor the underlying cloud resources of the instances. The responsibility model is as follows: | **Responsibility** | **AutoMQ Service Provider** | **Customer** | | - | - | - | | Cluster Deployment | Responsible | - | | System Vulnerability Patching | Responsible | - | | Software Version Upgrades | Responsible | - | | Instance Capacity Expansion | Responsible | Responsible (ensure cloud resource availability) | | Cloud Account Authorization | Responsible | Responsible | | Network Connectivity Assurance | Responsible | Responsible | | Service Availability SLA | Responsible | - | # Terms of Service Source: https://docs.automq.com/automq-cloud/support/terms-of-service AutoMQ Cloud offers seamless Kafka compatibility, cloud-native scalability, and cost efficiency. Discover our comprehensive terms of service and user agreement. **User Agreement** Welcome to AutoMQ Cloud services. This AutoMQ Cloud Service End User Agreement ("this Agreement") is a legally binding agreement between **You ("User")** and **AutoMQ HK Limited ("Service Provider")** , regarding the Service Provider's provision of AutoMQ Cloud services ("the Service"). I. Effectiveness of the Agreement 1. User Confirmation: This Agreement is provided online by the Service Provider. Users should carefully read this Agreement before purchasing the Service and must keep the Agreement checked to proceed to the next purchase step. Once the User confirms this Agreement, it becomes legally binding and enforceable against both the Service Provider and the User. 2. User Activation: Users can activate the Service through Public Cloud marketplace products or other means. The Service Provider will provide an online version of this Agreement for the User's review at the relevant stage. **Once the User uses the Service in any of the aforementioned ways, the User agrees to all terms of this Agreement. If the User does not accept the terms of this Agreement, please do not use the Service.** II. Definitions 1. AutoMQ Cloud services refer to using the Service Provider's image to install AutoMQ Cloud software and provide technical support services, including fault response, upgrades, and migrations. III. License of Use 1. This service is protected by copyright law, international copyright treaties, and other relevant intellectual property laws, regulations, and treaties. This software product/service is licensed for use by authorized users and is not sold. 2. The ownership and all intellectual property rights (including but not limited to patent rights and their applications, trademark rights and their applications, copyrights, proprietary technology ownership, and usage rights, etc.) related to the source code, object code, and technical documentation of the software/service under this agreement belong to the service provider (AutoMQ HK Limited). 3. According to the terms of this agreement, the service provider grants the user a non-exclusive, non-transferable license to use this service. Users may not resell or otherwise transfer this license right for commercial gain. IV. Fees 1. Users must pay all fees in accordance with the service's pricing structure to use this service. The service provider reserves the right not to provide services and/or technical support to users who have not paid all fees as agreed, or to terminate services and/or technical support. 2. If the user renews the service and the name, specifications, or price of the service have been adjusted, the user agrees to comply with the new service name, specifications, or price effective at the time. If the user does not agree to the new service name, specifications, or price, they may choose not to renew, and the service will automatically terminate upon expiration. V. Rights and Obligations of the User 1. The user guarantees that all actions taken in utilizing this service comply with national laws and regulations, are legal and truthful, and do not infringe on the legal rights of any third party. 2. The user shall pay the fees for this service in full and on time; otherwise, the service provider reserves the right to terminate the user's access to this service at any time. The user shall bear full responsibility for any damages that may arise from the service provider's termination of the service. 3. The user guarantees that, except as explicitly permitted by law, they shall not reverse engineer, decompile, or disassemble this service. 4. The user is obligated to keep the service provider's trade secrets confidential, including but not limited to intellectual property, pricing, information technology, market strategies, and other related commercial secrets, and shall not disclose them to any third party. 5. The user understands and agrees that, due to the limitations of existing technology, the services provided by the service provider may have defects and cannot guarantee normal execution or the achievement of the user's expected results under all circumstances. VI. Rights and Obligations of the Service Provider 1. The service provider guarantees that it has the legal right to grant the user a license to use this service and ensures the legality of its copyright. 2. The service provider commits that its provision of this service to the user does not infringe on any third party's legal rights, including but not limited to third-party intellectual property rights. If its actions result in any legal proceedings or administrative procedures initiated by a third party against the user, the service provider shall bear the legal responsibility and consequences. 3. The provider is responsible for timely upgrading, maintaining, and managing this service. They will offer free consultation and technical support services to users via phone support and online customer service. 4. The provider commits to ensuring the stability and continuity of the services provided to users. If the provider's actions lead to an early termination of the user's service license, the provider must fulfill the corresponding refund obligations to the user (if any). If such actions result in losses for the user, the provider shall be fully liable for compensation. 5. The provider commits that the services provided to users shall not contain: 1. Any viruses, trojan horses, worms, time bombs, or other computer programs that are intended to damage, maliciously interfere with, secretly intercept or expropriate any system, data, or personal information; 2. Any known vulnerabilities, backdoors, malware; 3. Other unsafe content that may harm the security of the user's system. 6. **Limitation of Liability: To the maximum extent permitted by applicable law, the provider shall not be liable for any indirect, incidental, direct, special, punitive, or other damages (including but not limited to damages for personal injury or property damage, loss of profits, data loss, business interruption, computer crash or malfunction, loss of business information, damages for privacy disclosure due to failure to perform any duty including good faith or reasonable care, damages for negligence, or any financial losses or any other damages) arising out of or in connection with the use or inability to use the service, even if the provider has been advised of the possibility of such damages.** VII. Use and Disclosure of User Data 1. To serve users better, the service provider may use user data to offer services, including but not limited to sending users information about products and services. 2. Without user permission, the service provider will not disclose user data without authorization. However, user data may be partially or fully disclosed in the following situations: (1) With user consent, disclosed to third parties; (2) Disclosed to third parties or administrative or judicial institutions as required by relevant laws, or by administrative or judicial institutions; (3) Disclosed to third parties if the user violates relevant Chinese laws and regulations; (4) Sharing user data with third parties as necessary to provide the software or services requested by the user. VIII. Term and Termination 1. The term of the service shall be based on the actual term when the user submits the order and completes the purchase. 2. The service provider reserves the right to terminate the provision of this service without any liability under any of the following circumstances: (1) The user's purchased service has expired and has not been renewed; (2) The user has seriously violated the terms of this agreement and has not corrected such violations after being notified by the service provider. IX. Amendment of the Agreement 1. If any content of this agreement changes, the service provider should inform the user of the modified content through appropriate means. 2. If the user does not agree with the modifications to the relevant terms of this agreement made by the service provider, the user has the right to stop using this service. In such cases, the service provider should refund the remaining fees (if any) to the user and provide a reasonable period before terminating the service for the user to back up, download, save, reassign data, and perform other necessary tasks. If the user continues to use this service, it will be deemed that the user has accepted the modifications to the relevant terms of this agreement made by the service provider. X. Law and Dispute Resolution 1. The formation, execution, interpretation, and resolution of disputes regarding this agreement shall be governed by the laws of the People's Republic of China. 2. In the event of any dispute arising from the execution, performance, or interpretation of this Agreement, both parties shall strive to resolve the matter amicably through friendly consultation. If the consultation fails, either party may file a lawsuit with the People's Court at the location of the defendant. XI. Supplementary Provisions 1. If any term of this Agreement is deemed invalid or unenforceable, such term may be severed, and the remaining parts shall continue to be in full force and effect. 2. The titles of this Agreement are provided for convenience of reading only and shall not define, limit, interpret, or describe the scope or boundaries of the terms. 3. The service provider may, based on its own operational conditions and upon giving the user a prior notice of \[30] working days, transfer all its rights and obligations under this Agreement to a third party without obtaining the user's prior consent. The assignee of the service provider shall be bound by this Agreement, and the service provider and its assignee shall be jointly and severally liable for the performance of this Agreement. # Overview Source: https://docs.automq.com/automq-cloud/table-topic/overview AutoMQ Table Topic offers real-time data lake ingestion with Kafka compatibility, eliminating traditional ETL processes and providing elastic scaling and AWS integration. Enable with one click. AutoMQ Table Topic integrates with Iceberg, allowing streaming data to be ingested into data lakes for analysis and querying. This article introduces the technical architecture, principles, and core concepts of Table Topic functionality. ## Architecture and Advantages AutoMQ Table Topic enables real-time data lake ingestion and query analysis through its embedded streaming table architecture. The technical architecture is outlined below: ![Table Topic has several advantages over traditional ETL data lake ingestion solutions:](https://mintcdn.com/automq/6t03b99H9kP_jCZq/automq-cloud/table-topic/overview/1.webp?fit=max\&auto=format\&n=6t03b99H9kP_jCZq\&q=85\&s=ff707e0a5a445d471704ac57b8e6b9a8) Table Topic has several advantages over traditional ETL data lake ingestion solutions: * **Out of the Box:** With just one click, you can activate AutoMQ Table Topic to stream data into Iceberg tables for continuous, real-time analytics. * **Built-in Schema Registry:** The built-in Kafka Schema Registry is ready to use. Table Topic leverages registered schemas to automatically create Iceberg tables in your catalog services (e.g., AWS Glue) and supports automatic schema evolution. * **ETL-Free (Extract, Transform, Load):** Traditional data lake ingestion methods often require intermediary tools such as Kafka Connect or Flink. Table Topic eliminates such ETL pipelines, significantly reducing costs and operational complexity. * **Auto Scaling:** AutoMQ features a stateless and elastic architecture that allows brokers to scale up or down with dynamic partition reassignment. Table Topic leverages this framework to handle ingestion rates from hundreds of MiB/s to several GiB/s. * **AWS S3 Table Integration:** Table Topic integrates with S3 Table, leveraging its Data Catalog and maintenance features such as compression, snapshot management, and unreferenced file deletion. This integration also facilitates large-scale data analytics through AWS Athena. ## Constraints and Limitations Using the AutoMQ Table Topic feature requires meeting the following conditions: * **Version Constraint:** The AutoMQ instance version must be >= 1.4.1. * **Catalog Requirement:** To use Table Topic, users must provide an external, available Data Catalog service. Currently, AutoMQ supports the following Catalog types: * **AWS S3Table Catalog:** AWS S3 offers a new Table Bucket, equipped with built-in catalog management and data lake storage. * **AWS Glue Catalog:** AWS Glue provides unified catalog management in the cloud and supports integration with query tools such as Athena. * **Hive Catalog:** Customers can provide catalog support themselves based on the Hadoop ecosystem's Hive Metastore, or they can purchase cloud provider-hosted EMR HMS services. ## Workflow Users need to follow the configuration workflow when using the AutoMQ Table Topic feature as outlined below: 1. **Configure Data Catalog**: Select and configure your preferred Data Catalog service (e.g., AWS S3Table Catalog, AWS Glue Catalog, or Hive Catalog). 2. **Create Instance, Enable Table Topic, and Set Target Catalog**: When creating an AutoMQ instance, enable the Table Topic feature and specify the configured Data Catalog. 3. **Configure Topic to Enable Stream Table Rotation**: In the Topic configuration, enable the stream table rotation feature. > [!TIP] > > **Note:** > > When configuring a Topic for stream table processing, you can freely modify the default Topic parameter configurations. For detailed Table Topic configuration information, refer to [Table Topic Configuration▸](/automq/table-topic/table-topic-configuration). ## Practices Tutorial * [Table Topic Integration with AWS S3 Table▸](/automq-cloud/table-topic/table-topic-integration-with-aws-s3-table) * [Table Topic Integration with AWS Glue▸](/automq-cloud/table-topic/table-topic-integration-with-aws-glue) # Table Topic Integration with AWS Glue Source: https://docs.automq.com/automq-cloud/table-topic/table-topic-integration-with-aws-glue Integrate AutoMQ's Kafka-compatible Table Topic with AWS Glue for data lake ingestion, analytics, and querying without ETL. Scale with cloud-native and cost-efficient solutions. AutoMQ Table Topic supports integration with Iceberg, allowing for streaming data into the lake for analysis and queries, while eliminating the need for ETL configuration and maintenance. This document explains how to configure the integration of Table Topic with Glue in an AWS environment. ## Prerequisites To use the AutoMQ Table Topic feature in an AWS environment, the following conditions must be met: * **Version Constraints:** The AutoMQ instance must be version >= 1.4.1. * **Instance Constraints:** The Table Topic feature must be enabled at the time of creating the AutoMQ instance. It can only be used if enabled during creation, as it cannot be activated later. * **Resource Requirements:** On AWS, Table Topic allows you to use AWS Glue as a Data Catalog or AWS S3 Tablebucket as a Data Catalog. ## Operational Steps ### Step 1: Prepare a Data Lake Bucket When using Glue Catalog, data lake tables need to be stored in an S3 Bucket. We recommend creating an available Bucket in the target region in advance to store Iceberg table data for the long term. ### Step 2: Create an AutoMQ Instance and Enable the Table Topic Feature To use the AutoMQ Table Topic feature, it must be enabled during instance creation to facilitate streaming data into the lake. Refer to the following configuration when creating the instance: 1. Enable Table Topic. 2. Select **Glue** as the Catalog type. 3. Set the S3 Bucket used by Glue Catalog. We recommend selecting the data lake Bucket prepared in Step 1. > [!TIP] > > **Note:** > > After enabling the Table Topic for an AutoMQ instance, not all Topics will automatically activate the table transformation feature. Configuration is required at the individual Topic level to stream data into the lake as needed. > > To utilize Table Topics, you must enable them during the instance creation process. After an instance is created, this setting cannot be modified. ![AutoMQ instance creation page with Table Topic feature enabled](https://mintcdn.com/automq/4Uz-SDzI1srfDCLZ/automq-cloud/table-topic/table-topic-integration-with-aws-glue/3.webp?fit=max\&auto=format\&n=4Uz-SDzI1srfDCLZ\&q=85\&s=82b699afa289a1a26cf0991e711f2d6c) ### Step 3: Create a Topic and Configure a Materialized View Table Once the Table Topic feature is enabled in the AutoMQ instance, you can set up a materialized view table as necessary when creating a Topic. Follow these steps: 1. Navigate to the instance from Step 2, find the Topic list, and click **Create Topic**. 2. In the configuration for creating the Topic, enable Table Topic conversion and configure the following parameters: 1. **Namespace:** A namespace serves to segregate different Iceberg tables, analogous to a Database in the Data Catalog. It's advisable to assign parameter values based on business ownership. 2. **Schema Constraint Type:** This setting determines whether a Topic message complies with Schema constraints. Selecting **Schema** enables these constraints, requiring message Schemas to be registered in AutoMQ's built-in SchemaRegistry. Messages must then be strictly formatted according to the Schema, and upcoming Table Topics will use this Schema's fields to populate the Iceberg table. Choosing **Schemaless** signifies that the message content lacks explicit Schema constraints; in this scenario, the message Key and Value are used as a single field to populate the Iceberg table. ![Topic creation form with Table Topic conversion enabled, showing Namespace and Schema Constraint Type fields](https://mintcdn.com/automq/6t03b99H9kP_jCZq/automq-cloud/table-topic/table-topic-integration-with-aws-glue/4.webp?fit=max\&auto=format\&n=6t03b99H9kP_jCZq\&q=85\&s=1d492aa046b8bbf03695d72cb2c91028) 3. **Click Confirm** to create a Topic that supports streaming tables. ### Step 4: Produce Messages and Query Iceberg Table Data in Real-time After configuring the AutoMQ instance and creating the Table Topic, you can proceed with testing data production and real-time querying of data in Iceberg tables. 1. Click to enter the Topic details, navigate to the Produce Message tab, input the test message Key and message Value, and send the message. 2. Go to the [AWS Glue Console](https://ap-southeast-1.console.aws.amazon.com/glue/home) to view the Iceberg database and table created by AutoMQ. ![AWS Glue Console showing the Iceberg database and table created by AutoMQ](https://mintcdn.com/automq/6t03b99H9kP_jCZq/automq-cloud/table-topic/table-topic-integration-with-aws-glue/5.webp?fit=max\&auto=format\&n=6t03b99H9kP_jCZq\&q=85\&s=17a3eac67e35cce2622a99a8c4185af8) 1. **Click View Data** to enable AWS Athena to query the table data in Glue, allowing you to see how AutoMQ transforms Kafka messages into corresponding data records in real-time. Users can also utilize other query engines for analysis and computation. ![AWS Athena query results showing AutoMQ Kafka messages converted to Iceberg table records in real time](https://mintcdn.com/automq/6t03b99H9kP_jCZq/automq-cloud/table-topic/table-topic-integration-with-aws-glue/6.webp?fit=max\&auto=format\&n=6t03b99H9kP_jCZq\&q=85\&s=414822328ba0b09151ededc5cb98816e) # Table Topic Integration with AWS S3 Table Source: https://docs.automq.com/automq-cloud/table-topic/table-topic-integration-with-aws-s3-table Integrate AutoMQ with AWS S3 Table for streaming data lake analysis without ETL. Achieve cloud-native scalability and Kafka compatibility with AutoMQ's Table Topic feature. AutoMQ Table Topic integrates with Iceberg for streaming data analytics in lakes, removing the necessity for ETL configuration and upkeep. This article guides you through configuring the integration of Table Topic with the AWS S3 Table Bucket in an AWS environment. ## Prerequisites To utilize the AutoMQ Table Topic feature in an AWS environment, the following conditions must be fulfilled: * **Version Constraint:** The AutoMQ instance version must be >= 1.4.1. * **Instance Constraint:** The Table Topic feature needs to be enabled during the creation of the AutoMQ instance, as it cannot be enabled retrospectively once the instance is established. * **Resource Requirements:** On AWS, when using the Table Topic feature, you can leverage AWS Glue as the Data Catalog or utilize an AWS S3 Table Bucket for the Data Catalog. ## Operation Steps ### Step 1: Create an S3 Table Bucket To integrate AutoMQ with the S3 Table Bucket, you need to first create a Table Bucket through the AWS S3 console. Ensure it's in the same deployment region as AutoMQ. This Table Bucket will be configured when you create the AutoMQ instance. ![AWS S3 Console showing the Table Bucket creation page](https://mintcdn.com/automq/6t03b99H9kP_jCZq/automq-cloud/table-topic/table-topic-integration-with-aws-s3-table/1.webp?fit=max\&auto=format\&n=6t03b99H9kP_jCZq\&q=85\&s=7fd2ed18ae261c340f933fd9123269dc) ### Step 2: Create an AutoMQ Instance and Enable the Table Topic Feature The AutoMQ Table Topic feature must be enabled during the creation of the instance to support streaming data into the lake. Therefore, follow the instructions below when configuring the instance: 1. Enable Table Topic. 2. Select **S3 Table** as the Catalog type. 3. Set the S3 Table Bucket used by the Catalog. We recommend selecting the Table Bucket created in Step 1. > [!TIP] > > **Note:** > > After enabling Table Topic in an AutoMQ instance, not all Topics will automatically activate stream tables. You still need to configure each Topic individually to facilitate streaming data into the lake. > > To use Table Topic, you must enable it while creating the instance. Once the instance is created, this configuration cannot be altered. ![AutoMQ instance creation page with Table Topic feature enabled](https://mintcdn.com/automq/4Uz-SDzI1srfDCLZ/automq-cloud/table-topic/table-topic-integration-with-aws-s3-table/4.webp?fit=max\&auto=format\&n=4Uz-SDzI1srfDCLZ\&q=85\&s=e42fc5208dbba4daef30704da8b6c9bc) ### Step 3: Create Topic and Configure Stream Table Once Table Topic functionality is enabled in the AutoMQ instance, you can configure stream tables as needed during the Topic creation process. The specific steps are as follows: 1. Access the instance in Step 2, find the Topic list, and click **Create Topic**. 2. In the Topic creation configuration, enable Table Topic conversion and configure the following parameters: 3. **Namespace:** The namespace is used to isolate different Iceberg tables and corresponds to the Database in the Data Catalog. It is recommended to set this parameter based on business affiliation. 4. **Schema Constraint Type:** Specifies whether Topic messages comply with schema constraints. By selecting **Schema**, you activate schema constraints, which necessitate that message schemas be registered with the AutoMQ built-in SchemaRegistry. Any subsequent message sent must strictly conform to the schema, and the Table Topic will then utilize the fields from this schema to populate the Iceberg table. If **Schemaless** is chosen, it signifies that the message content lacks explicit schema constraints; in this scenario, the message Key and Value are collectively used to populate the Iceberg table. ![Topic creation form with Table Topic conversion enabled, showing Namespace and Schema Constraint Type fields](https://mintcdn.com/automq/1QgM5miUDiCjXCsL/automq-cloud/table-topic/table-topic-integration-with-aws-s3-table/5.webp?fit=max\&auto=format\&n=1QgM5miUDiCjXCsL\&q=85\&s=08bb2f08bca0440074b4ffa143c1bed4) 5. **Click Confirm** to create a Topic that supports streaming to tables. ### Step 4: Produce Messages and Query Iceberg Table Data in Real-Time After configuring the AutoMQ instance and creating Table Topics, you can test data production and query data in the Iceberg table. 1. Click to enter the Topic details, navigate to the Produce Messages tab, input the test message Key and message Value, and send the message. 2. Visit the [AWS](https://ap-southeast-1.console.aws.amazon.com/s3/table-buckets/)[S3 Console](https://ap-southeast-1.console.aws.amazon.com/s3/table-buckets/) to view the Iceberg database and tables written by AutoMQ. ![AWS S3 Console showing the Iceberg database and tables written by AutoMQ](https://mintcdn.com/automq/1QgM5miUDiCjXCsL/automq-cloud/table-topic/table-topic-integration-with-aws-s3-table/6.webp?fit=max\&auto=format\&n=1QgM5miUDiCjXCsL\&q=85\&s=8ef0be4639186870d817b008c48afb77) 3. **Click Query Table from Athena** to enable AWS Athena to query the table data in the Table Bucket. You can observe how AutoMQ converts Kafka messages into corresponding data table records in real-time. Users can also utilize other query engines for analysis and computation. ![AWS Athena query results showing AutoMQ Kafka messages converted to S3 Table Bucket records in real time](https://mintcdn.com/automq/1QgM5miUDiCjXCsL/automq-cloud/table-topic/table-topic-integration-with-aws-s3-table/7.webp?fit=max\&auto=format\&n=1QgM5miUDiCjXCsL\&q=85\&s=f390d44d03d94f6be405014659dafa87)