gcp-dataflow-scd-kafka-migration

Configures and deploys Apache Beam streaming pipelines on Google Cloud Dataflow with Managed Kafka and BigQuery.

Updated Jul 7, 2026
One-click install
npx skills add https://github.com/ricardolui/gcp-custom-agent-skills --skill gcp-dataflow-scd-kafka-migration-ricardolui
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: gcp-dataflow-scd-kafka-migration
Source: https://github.com/ricardolui/gcp-custom-agent-skills/tree/main/gcp-dataflow-scd-kafka-migration
Command: npx skills add https://github.com/ricardolui/gcp-custom-agent-skills --skill gcp-dataflow-scd-kafka-migration-ricardolui

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Deploying low-latency Apache Beam streaming pipelines on Google Cloud Dataflow involves subtle failure modes: JDK incompatibility with Managed Kafka OAuth, GCS staging hangs, Python version mismatches, BigQuery Storage Write API serialization errors, and worker OOM under heavy throughput. This Skill provides field-proven configurations and resolutions for all of them. ## Core Features & Use Cases - Three-Flag Performance Tuning: Configure worker machine type, state caching, and harness threads to bypass the Python GIL and prevent OOM errors under high throughput. - Managed Kafka Ingestion: Set up SASL/OAUTHBEARER authentication with the JDK 21 harness override and correct Java expansion service classpath dependencies. - SCD Type 1 Enrichment: Implement slowly changing dimensions via dual-source ingestion, GlobalWindows triggers, and AsMultimap side inputs for sub-second CDC-based enrichment. - Reliable BigQuery Writes: Use the Storage Write API with strict local schema loading and a defensive type-conformity DoFn to prevent serialization crashes. - Use Case: A data engineer building a payments pipeline that consumes transactions from Google Managed Kafka, enriches them with merchant dimension data via Pub/Sub CDC streams, and writes conformed records to BigQuery can follow this guide to avoid the six most common production failures. ## Quick Start Ask the assistant to help you configure and launch a Dataflow streaming pipeline that reads from Google Managed Kafka and writes to BigQuery using the Storage Write API.

Frequently Asked Questions about gcp-dataflow-scd-kafka-migration

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I connect Apache Beam on Dataflow to Google Managed Kafka?

Use the Java expansion service with the managed-kafka-auth-login-handler and kafka-clients packages on the classpath, and authenticate via SASL/OAUTHBEARER. You must also override the Java harness to JDK 21 with --sdk_harness_container_image_overrides to avoid GcpLoginCallbackHandler crashes.

How do I implement slowly changing dimensions in a Dataflow streaming pipeline?

Load the baseline dimension table from BigQuery as a bounded source, merge it with CDC updates from Pub/Sub, apply GlobalWindows with a Repeatedly AfterCount(1) trigger in ACCUMULATING mode, and expose it as an AsMultimap side input. In the enrichment DoFn, take the last element per key to get the latest record.

Why does Dataflow fail with UnsupportedOperationException getSubject when using Managed Kafka?

The Python worker's Java sidecar runs on JDK 17+, where Subject.getSubject is unsupported, breaking GcpLoginCallbackHandler OAuth callbacks. Fix it by forcing the Java harness to JDK 21 with --sdk_harness_container_image_overrides=.*java.*,apache/beam_java21_sdk:2.73.0.

Why does BigQuery Storage Write API throw TypeError an integer is required?

The Storage Write API compiles a strict protobuf schema, so uncast float-strings like "1.0", literal "null" strings, or missing fields cause RowCoder serialization failures. Pass records through a defensive ConformToSchemaDoFn that casts values to the target schema types immediately before writing.

How do I fix Dataflow worker OOM and high pipeline lag under heavy throughput?

Scale workers to n2-standard-8 for 8 vCPUs and 32 GB RAM, set --max_cache_memory_usage_mb=8192 to cache Beam state in memory, and set --number_of_worker_harness_threads=8 to bypass the Python GIL and use all vCPUs in parallel.

Can I test Google Managed Kafka connectivity from my local machine?

No. Managed Kafka bootstrap servers reside in a service-producer VPC and are only resolvable within that private network. All development testing, load generation, and pipeline execution must run inside the targeted VPC.