[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6DRKCFWR3TXQDYCNBPBPTCK":3,"skill-same:01M6DRKCFWR3TXQDYCNBPBPTCK":153},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":39,"linkOnly":40,"markdownContent":41,"markdownBody":42,"frontMatter":43,"refName":46,"commitSha":47,"skillDirectory":48,"forksCount":49,"repositoryHtmlUrl":50,"repositoryHomepageUrl":6,"ownerHtmlUrl":51,"ownerBlogUrl":52,"ownerDescription":53,"updatedAt":54,"install":55,"resources":68},"01M6DRKCFWR3TXQDYCNBPBPTCK","developing-kafka-java-client",null,"Use when the user wants to integrate a Kafka client into an existing application or scaffold a Java Kafka client project (Maven or Gradle based) for Confluent Cloud, local Docker, or WarpStream. Covers the Apache Kafka Java clients (KafkaProducer\u002FKafkaConsumer\u002FKafkaShareConsumer) with Avro, JSON Schema, or Protobuf serializers. Also use when the user wants to optimize Java Kafka client configuration for WarpStream. Do NOT trigger for Kafka Streams apps (use kafka-streams-programming), Flink, connectors, or Kafka Python client (use developing-kafka-python-client).","confluentinc\u002Fagent-skills","confluentinc","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F9439498?v=4","01M6DRHHXAPZ51S955GTK4NG5H","Confluent Inc.","01M6DRHJ1QGVS341XSPAW6G0QF",65,"Apache-2.0","https:\u002F\u002Fgithub.com\u002Fconfluentinc\u002Fagent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fdeveloping-kafka-java-client\u002FSKILL.md",[],[19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38],"developing kafka java client","java","kafka","optimize","kafka streams","confluent cloud","confluent","apps","trigger","gradle","project","local","python","do","integrate","maven","apache","protobuf","json schema","docker","2026-11-10 10:12:30",false,"---\nname: developing-kafka-java-client\ndescription: \"Use when the user wants to integrate a Kafka client into an existing application or scaffold a Java Kafka client project (Maven or Gradle based) for Confluent Cloud, local Docker, or WarpStream. Covers the Apache Kafka Java clients (KafkaProducer\u002FKafkaConsumer\u002FKafkaShareConsumer) with Avro, JSON Schema, or Protobuf serializers. Also use when the user wants to optimize Java Kafka client configuration for WarpStream. Do NOT trigger for Kafka Streams apps (use kafka-streams-programming), Flink, connectors, or Kafka Python client (use developing-kafka-python-client).\"\nmetadata:\n   version: \"1.0.0\"\n---\n\n\u003CHARD-GATE>\nDo NOT generate any code, scaffold any project, or modify any file until you have\nexplicitly asked and received answers for questions #1 (existing app or greenfield),\n#2 (target environment), and #3 (producer, consumer, or both). If the user's prompt\npartially answers some questions, still confirm your understanding before generating.\nThis applies to EVERY prompt regardless of how specific it appears.\n\u003C\u002FHARD-GATE>\n\nBegin by announcing: \"Using the Confluent Kafka Java Client skill to guide this project.\"\n\n# Confluent Kafka Java Client Creation\n\nGenerate a production-ready Java project for producing to and\u002For consuming from Kafka using the Apache Kafka Java clients (`KafkaProducer` \u002F `KafkaConsumer`) with Confluent Schema Registry serializers. Supports three target environments: **Confluent Cloud** (managed), **Local Docker**, and **WarpStream** (Kafka-compatible, object-storage-backed); two build tools: **Maven** (default) and **Gradle**; and three schema formats: **Avro** (default), **JSON Schema**, and **Protobuf**. The generated code follows Confluent's best practices.\n\n## Step 1: Gather Requirements\n\nBefore generating any code, work through the questions below. **Skip any question the user has already answered explicitly in their prompt** — do not re-ask just for form's sake. For example, \"build a producer and consumer on Confluent Cloud with synchronous sends using Gradle\" already answers #2, #3, #4, and #5; only #1, #6, #7, #8, #9, and #10 remain.\n\n**Mandatory confirmation gate — do not skip, even if the user answered every question.** Before writing any file, you MUST send one message that:\n1. Recaps the answers you extracted as a short bulleted list (e.g., \"Target: Confluent Cloud · Components: producer + consumer · Send pattern: async callback · Build: Maven · Schema: Avro · From scratch: yes\").\n2. Asks any remaining open questions inline.\n3. Explicitly asks the user to confirm or correct before you proceed.\n\nThen STOP and wait for the user's reply. Do not generate files in the same turn as the recap, and do not proceed on the assumption that a fully-specified prompt implies consent to generate immediately — the recap catches misinterpretations of the prompt and is required even when questions #1–#10 are all pre-answered. The only way to skip the gate is if the user has already confirmed the recap earlier in this conversation.\n\nDo not assume defaults for #1, #2, or #3 — if any of these are not answered by the prompt, you must ask.\n\n1. **Are you adding Kafka to an existing application, or starting from scratch?**\n   - If the user has existing Java code (mentions an existing project, has a `pom.xml`\u002F`build.gradle`, uses Spring Boot\u002FQuarkus\u002FMicronaut, etc.), do **not** scaffold a new project. Instead: (a) identify their existing producer or data-sending code, (b) ask whether they already have schemas registered in Schema Registry, (c) add Schema Registry integration to their existing code following the patterns in the reference files. Generate only the files they are missing (e.g., `KafkaConfig.java`, `src\u002Fmain\u002Favro\u002Fvalue.avsc`) and modify their existing code inline. Add the Confluent Maven repository and serializer dependencies to their existing build file.\n   - If the user already produces to Kafka without Schema Registry (e.g., `StringSerializer` with hand-rolled JSON), help them migrate: (1) generate an Avro\u002FJSON schema from their existing message structure, (2) register it, and (3) replace their raw `String`\u002F`byte[]` serializer with a Confluent Schema Registry serializer. Do not discard their existing code.\n   - If starting from scratch, proceed with the full scaffold below.\n2. **Target environment?** — Confluent Cloud, local Kafka (Docker), or WarpStream. **Always prompt for this, even if the user didn't mention it.** If they mention \"local\", \"docker\", \"self-hosted\", or just want to try Kafka without a cloud account, choose **local Docker**. If they mention \"Confluent Cloud\", \"CC\", or have existing cloud credentials, choose **Confluent Cloud**. If they mention \"WarpStream\", choose **WarpStream**. Default to Confluent Cloud if they confirm they don't have a preference, but always ask first.\n   - **If WarpStream:** Read `references\u002Fwarpstream-optimization.md` and apply the Java client overrides from that reference. Key changes: disable idempotence, dramatically increase batch sizes and in-flight requests, set large fetch sizes, add `ws_az=\u003Caz>` to `client.id` for zone-aware routing. Prefer null message keys for sticky partitioning unless entity-based ordering is required.\n3. **Producer, consumer, or both?**\n4. **Send pattern?** (Only if producer is requested.) The Java `KafkaProducer.send()` always returns a `Future\u003CRecordMetadata>` — the producer is inherently asynchronous. The choice is how you handle the result. Help the user choose:\n   - **Async with callback** (recommended default): `producer.send(record, callback)`. Non-blocking; the `Callback` handles per-record delivery reports and errors. Best throughput for most applications. Use `references\u002FAvroProducer.java`.\n   - **Synchronous**: `producer.send(record).get()`. Blocks until the broker acks each record. Lowest throughput but strongest per-message confirmation and simplest error handling. Best for batch\u002FETL scripts and steps that must confirm one write before the next. Use `references\u002FAvroProducerSync.java`.\n   - (Fire-and-forget — `producer.send(record)` with no callback and no `.get()` — is mentioned for completeness but **not** recommended: delivery failures are silently dropped.)\n   If the user mentions batch, ETL, or \"confirm each write\", default to **synchronous**. Otherwise default to **async callback**.\n5. **Build tool?** — **Maven** (default, `pom.xml`) or **Gradle** (`build.gradle`). If the user mentions Gradle, an existing `build.gradle`, or Kotlin DSL, use Gradle (`references\u002Fbuild.gradle`). Otherwise default to Maven (`references\u002Fpom.xml`).\n6. **Do you have an existing schema you'd like to use?** If yes, ask the user to paste it or provide the file path, then use it instead of generating one. If no, proceed to ask about their data fields.\n7. **What kind of data are you producing?** (Only if the user doesn't have an existing schema. Get field names and types so you can generate a matching schema and sample data.)\n8. **Topic name?** (Default: `demo-topic`)\n9. **Consumer group ID?** (Only if consumer; default: `java-consumer-group`)\n10. **Consumer API or Share Consumer API?** (Only if consumer is requested.) Help the user choose, explaining the key distinction: with the regular **Consumer API** (`KafkaConsumer`, consumer groups) each partition is assigned to exactly one consumer, so parallelism is capped at the partition count and per-key ordering is preserved. With the **Share Consumer API** (`KafkaShareConsumer`, share groups — \"Queues for Kafka\") **multiple share consumers can consume from the same partition**, giving **queue-like messaging semantics** where multiple consumers cooperatively process messages concurrently and you can scale consumers beyond the partition count (the trade-off: no per-key ordering, and each record must be acknowledged). **Default to the regular Consumer API.** Choose the Share Consumer API when the user asks for queue\u002Fwork-queue semantics, competing consumers, cooperative concurrent processing, or scaling consumers independently of partitions. If the user picks the Share Consumer API, read `references\u002Fshare-consumer.md` before generating — it requires Kafka 4.x clients (the reference build files already pin `kafka.version=4.2.1` \u002F `confluent.version=8.2.1`) and cluster-side feature enablement.\n\nDon't ask whether to use Schema Registry — always include it. **Default to Avro** (idiomatic for the JVM: generated `SpecificRecord` classes give compile-time type safety and a compact wire format). Offer JSON Schema or Protobuf if the user prefers — ask only if they hint at a preference; otherwise use Avro. If the target is WarpStream and the user is using WarpStream's built-in schema registry, note that it only supports Avro and Protobuf (`GET \u002Fschemas\u002Ftypes` returns `[\"AVRO\",\"PROTOBUF\"]`) — Avro is already the default, so no change is needed unless they want Protobuf.\n\n### Common Agent Mistakes\n\n| Thought | Reality |\n|---------|---------|\n| \"The user said Spring Boot, so I'll scaffold a fresh Maven project\" | If they have an existing app, modify it in place — add deps to their build file and integrate the serializer. Do not scaffold a competing project. |\n| \"I'll default to JSON Schema like the Python skill\" | This skill defaults to **Avro** on the JVM. Generated `SpecificRecord` classes are idiomatic and type-safe. Only use JSON Schema\u002FProtobuf if the user prefers. |\n| \"I'll leave `auto.register.schemas` at its default\" | The serializer default is `true`. Always set it to **`false`** and register explicitly via `CachedSchemaRegistryClient.register(...)`. Silent auto-registration is a production hazard. |\n| \"I'll create a `KafkaProducer` inside the send method\" | One `KafkaProducer` instance, created in `main()`, passed as a parameter. Producers are thread-safe and expensive to create. |\n| \"I'll write the schema ID into a record header like the Python sync producer\" | Java Confluent serializers embed the schema ID in the **wire format** (magic byte + 4-byte ID) automatically. Do not hand-roll headers. |\n| \"Avro just needs the `.avsc` on the classpath\" | Avro `SpecificRecord` classes are **generated at build time** by `avro-maven-plugin` (Maven) or the `com.github.davidmc24.gradle.plugin.avro` plugin (Gradle) from `src\u002Fmain\u002Favro\u002F*.avsc`. The producer imports the generated class (e.g., `com.example.kafka.Transaction`). Run `mvn generate-sources` \u002F `.\u002Fgradlew generateAvroJava` before referencing it. |\n| \"I'll catch and swallow `WakeupException` errors generally\" | `WakeupException` is the **expected** signal from `consumer.wakeup()` in a shutdown hook. Catch it narrowly to break the poll loop, then `close()` in `finally`. |\n| \"Consumer means `KafkaConsumer` — I'll skip asking about the Share Consumer API\" | When a consumer is requested, always ask Consumer API vs Share Consumer API (question #10). Default to the regular Consumer API, but offer the Share Consumer API (`KafkaShareConsumer`) for queue-like\u002Fcooperative consumption. |\n| \"I'll forget the Confluent Maven repo — the serializers are on Maven Central\" | `io.confluent:kafka-avro-serializer` and friends resolve from `https:\u002F\u002Fpackages.confluent.io\u002Fmaven\u002F`. The build file MUST declare that repository. |\n| \"`schema.registry.url` goes on the `KafkaProducer` config only\" | The serializer reads `schema.registry.url` (and `basic.auth.*`) from the **same** producer\u002Fconsumer `Properties`. Put SR config in the client properties so the serializer picks it up. |\n\n## Step 1b: Confirm Understanding\n\nAfter gathering all answers, present a confirmation summary before generating any code:\n\n```\nBefore I generate the project, let me confirm:\n- Project type: [Greenfield scaffold \u002F Migration of existing code]\n- Environment: [Confluent Cloud (SASL_SSL) \u002F Local Docker (PLAINTEXT) \u002F WarpStream]\n- Schema format: [Avro (default) \u002F JSON Schema \u002F Protobuf]\n- Build tool: [Maven \u002F Gradle]\n- Components: [Producer only \u002F Consumer only \u002F Both]\n- Send pattern: [Async callback \u002F Synchronous] (if producer)\n- Consumer API: [Consumer API \u002F Share Consumer API] (if consumer)\n- Schema: [brief description of user's data fields]\n- Topic: [topic name]\n- Consumer group: [group ID] (if consumer)\n\nDoes this look right?\n```\n\nWait for user confirmation before proceeding to Step 2. If the user corrects anything, update your understanding and re-confirm.\n\n## Step 2: Generate the Project\n\n### Decision Flowchart\n\n```dot\ndigraph decisions {\n  \"Q1: Existing app?\" -> \"Migration path:\\nmodify existing code +\\nadd deps to build file\" [label=\"yes\"];\n  \"Q1: Existing app?\" -> \"Q2: Environment?\" [label=\"no \u002F greenfield\"];\n  \"Q2: Environment?\" -> \"Cloud config\\n(SASL_SSL)\" [label=\"Confluent Cloud\"];\n  \"Q2: Environment?\" -> \"Local Docker config\\n(PLAINTEXT) + docker-compose.yml\" [label=\"local \u002F docker \u002F OSS\"];\n  \"Q2: Environment?\" -> \"WarpStream config\\n(apply overrides from\\nreferences\u002Fwarpstream-optimization.md)\" [label=\"WarpStream\"];\n  \"Cloud config\\n(SASL_SSL)\" -> \"Q4: Send pattern?\";\n  \"Local Docker config\\n(PLAINTEXT) + docker-compose.yml\" -> \"Q4: Send pattern?\";\n  \"WarpStream config\\n(apply overrides from\\nreferences\u002Fwarpstream-optimization.md)\" -> \"Q4: Send pattern?\";\n  \"Q4: Send pattern?\" -> \"AvroProducer.java\\n(send + Callback)\" [label=\"async callback\"];\n  \"Q4: Send pattern?\" -> \"AvroProducerSync.java\\n(send().get())\" [label=\"synchronous\"];\n}\n```\n\nCreate this file structure in the user's chosen directory (Maven layout shown; for Gradle the source tree is identical, only the build file differs):\n\n```\n\u003Cproject-dir>\u002F\n├── pom.xml                       # Maven (or build.gradle for Gradle)\n├── docker-compose.yml            # (local Docker path only)\n├── .properties.example           # template for credentials\n├── README.md\n└── src\u002F\n    ├── main\u002F\n    │   ├── java\u002Fcom\u002Fexample\u002Fkafka\u002F\n    │   │   ├── KafkaConfig.java   # shared config loading + connectivity verification\n    │   │   ├── AvroProducer.java  # (if producer requested; or AvroProducerSync.java)\n    │   │   └── AvroConsumer.java  # (if consumer requested; or AvroShareConsumer.java for the Share Consumer API)\n    │   └── avro\u002F\n    │       └── value.avsc         # Avro schema (codegen source; value.schema.json \u002F value.proto for other formats)\n    └── test\u002F\n        └── java\u002Fcom\u002Fexample\u002Fkafka\u002F\n            └── AppTest.java       # unit tests (always generated)\n```\n\n### Security\n\nNEVER read, open, or display `.properties` files. They contain API keys and secrets. Only generate `.properties.example` with placeholder values. If the user asks you to debug a connection issue, ask them to verify their `.properties` values themselves — do not read the file. Add `.properties` to `.gitignore`.\n\n### Core Principles\n\nThese principles matter because they prevent the most common production issues with Kafka Java clients:\n\n1. **Reuse the producer\u002Fconsumer instance.** Creating a `KafkaProducer` per message is expensive — each one opens TCP connections, does SASL handshakes, and fetches metadata. `KafkaProducer` is thread-safe; create one and share it. The send helper accepts the producer as a parameter, never instantiates one.\n\n2. **Always use Schema Registry, with Avro by default.** Schema Registry enforces a producer\u002Fconsumer contract; without it, schema changes silently break consumers. This skill defaults to **Avro** because generated `SpecificRecord` classes give the JVM compile-time type safety and a compact wire format. JSON Schema and Protobuf are supported alternatives.\n\n   **Register schemas as a separate explicit step** before producing. Use a dedicated `registerSchema()` method that calls `schemaRegistryClient.register(subject, parsedSchema)` and lets errors (auth failures, network errors, permission denials) propagate immediately — never swallow them. Then configure the serializer with `auto.register.schemas=false` and `use.latest.version=true`. This ensures the serializer never silently auto-registers and aligns with production practice where CI\u002FCD registers schemas, not application startup.\n\n   Use the serializer matching the chosen format:\n   - **Avro (default):** `io.confluent.kafka.serializers.KafkaAvroSerializer` \u002F `KafkaAvroDeserializer`. Set `specific.avro.reader=true` on the consumer so it deserializes into the generated `SpecificRecord` class.\n   - **JSON Schema:** `io.confluent.kafka.serializers.json.KafkaJsonSchemaSerializer` \u002F `KafkaJsonSchemaDeserializer`. Set `json.value.type` on the consumer to the POJO class. See `references\u002FJsonSchemaProducer.java` and `references\u002FJsonSchemaConsumer.java`.\n   - **Protobuf:** `io.confluent.kafka.serializers.protobuf.KafkaProtobufSerializer` \u002F `KafkaProtobufDeserializer`. Generate classes from a `.proto` via `protobuf-maven-plugin` and set `specific.protobuf.value.type` on the consumer.\n\n3. **Choose the send pattern deliberately.** `KafkaProducer.send()` returns `Future\u003CRecordMetadata>` and is always asynchronous internally:\n   - **Async with callback** (`references\u002FAvroProducer.java`): `producer.send(record, (metadata, exception) -> {...})`. Non-blocking, best throughput. Recommended default.\n   - **Synchronous** (`references\u002FAvroProducerSync.java`): `producer.send(record).get()`. Blocks per record; strongest confirmation, lowest throughput. Best for batch\u002FETL.\n   The consumer is a single-threaded `poll()` loop in both cases.\n\n4. **Graceful shutdown.** Producers must `flush()` then `close()` (in a `finally` block) so buffered records are not lost. Consumers use the **wakeup pattern**: register `Runtime.getRuntime().addShutdownHook(new Thread(consumer::wakeup))`, run the poll loop until `consumer.wakeup()` raises `WakeupException`, catch it narrowly to break the loop, and `close()` in `finally`. `close()` commits offsets and leaves the consumer group cleanly, avoiding unnecessary rebalances.\n\n5. **Support Confluent Cloud, local Docker, and WarpStream.** For Confluent Cloud, configure `SASL_SSL` with `PLAIN` mechanism via `sasl.jaas.config` and load API keys from `.properties`. For local Docker, use `PLAINTEXT` with no authentication. For WarpStream, use `SASL_SSL` or `PLAINTEXT` per the user's deployment and apply the Java overrides from `references\u002Fwarpstream-optimization.md`. The `KAFKA_ENV` setting (`cloud`, `local`, or `warpstream`) controls which path `KafkaConfig` uses. Load all settings from the `.properties` file via `java.util.Properties` (falling back to process environment variables for any key absent from the file).\n\n6. **Verify connectivity before running.** Use `AdminClient.listTopics()` to confirm the broker is reachable and the topic exists before producing or consuming. Verify Schema Registry connectivity with an HTTP health check against `\u002Fsubjects`.\n\n7. **Always set a message key for domain events.** Pass the entity identifier as the `ProducerRecord` key for any message representing an entity or event stream (order events, user actions, device telemetry, transactions). Kafka partitions by key, so same-key messages land on the same partition and preserve ordering — critical for streams like `OrderCreated → OrderUpdated → OrderCancelled`. Ask the user which field identifies the entity and use it as the key. Only use a `null` key if the user explicitly states ordering does not matter.\n\n   **WarpStream exception:** On WarpStream, null keys enable sticky partitioning, which builds larger batches and significantly improves throughput and cost. When the use case does **not** require per-entity ordering (independent telemetry, stateless metrics, logs), recommend a null key and explain the throughput benefit. When per-entity ordering **is** required, still set a key — correctness takes priority. Ask the user whether their events need per-key ordering to decide.\n\n### KafkaConfig.java\n\nThis class handles configuration loading (via `java.util.Properties`, reading the `.properties` file and falling back to process environment variables) and connectivity verification. Use `references\u002FKafkaConfig.java` as the template. It builds the base client `Properties` (SASL_SSL vs PLAINTEXT by `KAFKA_ENV`), the Schema Registry config keys the serializers read, and the `verifyKafkaSetup` \u002F `verifySchemaRegistry` helpers.\n\n### Producer Patterns\n\nWhen the user chooses **async callback**, use `references\u002FAvroProducer.java`. When the user chooses **synchronous**, use `references\u002FAvroProducerSync.java`. For JSON Schema, use `references\u002FJsonSchemaProducer.java`. Key points common to all:\n- The send helper takes a `KafkaProducer` parameter — it never creates one. The producer is created once in `main()`.\n- `registerSchema()` registers explicitly via `CachedSchemaRegistryClient` and returns the schema ID; errors propagate. The serializer is configured with `auto.register.schemas=false`, `use.latest.version=true`.\n- The schema ID is embedded automatically in the Confluent wire format — do not add it as a header.\n- `flush()` then `close()` in a `finally` block.\n\n### Consumer Pattern\n\n**Regular Consumer API (default).** Read `references\u002Fconsumer.md`, then use `references\u002FAvroConsumer.java` (or `references\u002FJsonSchemaConsumer.java` for JSON Schema). Key points:\n- Deserialize via the Schema Registry deserializer — no raw `String`\u002FJSON fallback.\n- Avro: set `specific.avro.reader=true` and consume into the generated `SpecificRecord` type.\n- On AK 4.0+ set `group.protocol=consumer` to use the next-gen rebalance protocol (KIP-848), which eliminates stop-the-world rebalances. See `references\u002Fconsumer.md`.\n- Disable `enable.auto.commit` and commit explicitly after processing; weigh `commitSync` vs `commitAsync` per `references\u002Fconsumer.md`.\n- Wakeup-based graceful shutdown: shutdown hook calls `consumer.wakeup()`; the loop catches `WakeupException` and `close()`s in `finally`.\n- Continuous `poll(Duration.ofMillis(1000))` loop until shutdown.\n\n**Share Consumer API (\"Queues for Kafka\").** If the user chose the Share Consumer API in question #10, read `references\u002Fshare-consumer.md` and use `references\u002FAvroShareConsumer.java` instead of `AvroConsumer.java`. It uses `KafkaShareConsumer` so multiple instances in the same share group cooperatively consume from the same partition (queue-like semantics). Same Schema Registry deserializer and wakeup shutdown as above, plus: per-record `acknowledge(record, AcknowledgeType.ACCEPT\u002FRELEASE\u002FREJECT)` and cluster-side feature enablement (`share.version=1` locally; \"Queues for Kafka\" enabled on Confluent Cloud). The reference build files already pin Kafka 4.x clients, so no version change is needed — just keep them. Tell the user about the feature requirement.\n\n### Schemas\n\nGenerate a schema matching the user's data domain.\n\n**Avro (default):** place the schema at `src\u002Fmain\u002Favro\u002Fvalue.avsc` so the build plugin generates the `SpecificRecord` class. Use `references\u002Fvalue.avsc` as the starting point and adapt to the user's domain. The record `name` becomes the generated Java class name and `namespace` its package (e.g., `name: \"Transaction\"`, `namespace: \"com.example.kafka\"` → `com.example.kafka.Transaction`). Follow `references\u002Fschema-generation-rules.md` strictly.\n\n**JSON Schema:** place at `src\u002Fmain\u002Fresources\u002Fvalue.schema.json` and pair it with a POJO. **Protobuf:** place a `.proto` under `src\u002Fmain\u002Fproto\u002F`.\n\n#### Multi-Event Topics (Advanced)\n\nWhen the user describes multiple event types on a single topic, follow `references\u002Fmulti-event-guide.md`. Only suggest multi-event\u002Funion schemas when the user explicitly describes multiple event types on one topic.\n\n### docker-compose.yml (Local Docker Path Only)\n\nWhen the user chooses local Docker, you MUST generate a `docker-compose.yml` using `references\u002Fdocker-compose.yml` as the template. It starts a single-node Kafka broker (`confluentinc\u002Fconfluent-local`, KRaft mode) and Confluent Schema Registry. The user runs `docker compose up -d`.\n\n**IMPORTANT:** `confluentinc\u002Fconfluent-local` has built-in listener names `PLAINTEXT` (29092), `PLAINTEXT_HOST` (9092), `CONTROLLER` (29093). Do NOT invent custom listener names — that conflicts with the image's internal config and causes boot loops. Only override `KAFKA_ADVERTISED_LISTENERS` and `KAFKA_LISTENERS` using those exact names. The internal `PLAINTEXT` listener must advertise the `kafka` hostname so Schema Registry can reach the broker inside the Docker network.\n\n### .properties.example\n\nGenerate the appropriate `.properties.example` for the target environment. It is a standard Java properties file (`key=value`), loaded by `KafkaConfig` via `java.util.Properties`:\n\n**Confluent Cloud:**\n```\nKAFKA_ENV=cloud\nBOOTSTRAP_SERVER=pkc-xxxxx.us-east-1.aws.confluent.cloud:9092\nAPI_KEY=your-api-key\nAPI_SECRET=your-api-secret\nTOPIC=demo-topic\nSCHEMA_REGISTRY_URL=https:\u002F\u002Fpsrc-xxxxx.us-east-2.aws.confluent.cloud\nSR_API_KEY=your-sr-api-key\nSR_API_SECRET=your-sr-api-secret\nCLIENT_ID=java-client\nGROUP_ID=java-consumer-group\n```\n\n**Local Docker:**\n```\nKAFKA_ENV=local\nBOOTSTRAP_SERVER=localhost:9092\nTOPIC=demo-topic\nSCHEMA_REGISTRY_URL=http:\u002F\u002Flocalhost:8081\nCLIENT_ID=java-client\nGROUP_ID=java-consumer-group\n```\n\n**WarpStream:**\n```\nKAFKA_ENV=warpstream\nBOOTSTRAP_SERVER=your-warpstream-bootstrap-url:9092\nTOPIC=demo-topic\nSCHEMA_REGISTRY_URL=http:\u002F\u002Fyour-schema-registry:8081\nCLIENT_ID=java-client,ws_az=us-east-1a\nGROUP_ID=java-consumer-group\n# If your WarpStream deployment requires SASL auth, uncomment:\n# API_KEY=your-api-key\n# API_SECRET=your-api-secret\n# If using Confluent Cloud Schema Registry, uncomment:\n# SR_API_KEY=your-sr-api-key\n# SR_API_SECRET=your-sr-api-secret\n```\n\n### Build File\n\n**Maven (default):** use `references\u002Fpom.xml`. It declares the Confluent Maven repository, `kafka-clients`, the Avro serializer + `avro` + `avro-maven-plugin` (codegen from `src\u002Fmain\u002Favro`), a logging binding, and JUnit 5 + Mockito for tests. Configuration is loaded with the JDK's built-in `java.util.Properties` — no extra dependency. Comments show how to swap in the JSON Schema or Protobuf serializer.\n\n**Gradle:** use `references\u002Fbuild.gradle`. Same dependencies plus the `com.github.davidmc24.gradle.plugin.avro` plugin for codegen.\n\nEvery dependency imported anywhere in the generated code must appear in the build file. The user should be able to `mvn package` \u002F `.\u002Fgradlew build` and run with zero unresolved-symbol or `ClassNotFoundException` errors.\n\n### README.md\n\nGenerate a README following `references\u002Freadme-template.md`. Adapt it to what was actually generated — omit producer sections if only a consumer was requested, omit Docker sections for Confluent Cloud projects, and use the correct build-tool commands.\n\n### Tests\n\nAlways generate unit tests at `src\u002Ftest\u002Fjava\u002Fcom\u002Fexample\u002Fkafka\u002FAppTest.java`. Use `references\u002FAppTest.java` as the template. The tests must run without a live Kafka cluster or Schema Registry — use `MockProducer`\u002F`MockConsumer` from `kafka-clients` and Mockito for the Schema Registry client.\n\nThe tests verify these properties:\n\n1. **KafkaConfig**: `baseProperties()` produces `SASL_SSL` + `PLAIN` (`sasl.jaas.config` set) when `KAFKA_ENV=cloud`, or `PLAINTEXT` with no SASL when `KAFKA_ENV=local`. `verifyKafkaSetup()` returns the right boolean against a mocked `AdminClient`.\n2. **Producer** (if generated): the send helper accepts a producer parameter (never creates one), exactly one `KafkaProducer` is instantiated in the class, and sending a batch through a `MockProducer` records one history entry per message with the expected key. For the sync variant, verify the send result is resolved (`.get()`).\n3. **Consumer** (if generated): uses a Schema Registry deserializer (`KafkaAvroDeserializer` \u002F `KafkaJsonSchemaDeserializer` \u002F `KafkaProtobufDeserializer`) — not a raw `StringDeserializer` for values — and uses the wakeup + `close()` shutdown pattern. A `MockConsumer` seeded with records yields the expected deserialized values.\n4. **Schema file**: the Avro `value.avsc` parses as a `record` with a top-level `doc` and a `doc` on every field (mirror `references\u002Fschema-generation-rules.md`). For JSON Schema, check `type: object`, `title`, descriptions, and `format: date-time` on timestamp fields.\n\nAfter generating all files, run `mvn test` (or `.\u002Fgradlew test`) to verify the tests pass. If any test fails, fix the generated code (not the tests) until they pass.\n\n## Step 3: Guide the User\n\nAfter generating the files, give instructions based on the target environment. Adapt to what was generated.\n\n**Confluent Cloud:**\n1. Copy `.properties.example` to `.properties` and fill in Confluent Cloud credentials (bootstrap server, API keys, Schema Registry URL — all in the Confluent Cloud Console under cluster\u002Fenvironment settings).\n2. Generate Avro classes and build: `mvn generate-sources && mvn package` (or `.\u002Fgradlew build`).\n3. If a producer was generated, the schema is registered explicitly on first run via `registerSchema()` (`auto.register.schemas=false`). If only a consumer was generated, register the schema manually in the Console under Schema Registry for the topic's value subject.\n4. Run the producer: `mvn exec:java -Dexec.mainClass=com.example.kafka.AvroProducer` (or `.\u002Fgradlew run`).\n5. Run the consumer: `mvn exec:java -Dexec.mainClass=com.example.kafka.AvroConsumer`.\n\n**Local Docker:**\n1. Start Kafka + Schema Registry: `docker compose up -d`.\n2. Copy `.properties.example` to `.properties` (defaults are pre-filled for local Docker).\n3. Build: `mvn package` (or `.\u002Fgradlew build`).\n4. Create the topic if auto-creation is disabled: `docker compose exec kafka kafka-topics --create --topic demo-topic --bootstrap-server localhost:29092`.\n5. Run the producer \u002F consumer as above.\n6. When done: `docker compose down` (add `-v` to remove stored data).\n\n**WarpStream:**\n1. Copy `.properties.example` to `.properties` and fill in the WarpStream bootstrap server, Schema Registry URL, and (if applicable) credentials. Set `CLIENT_ID` to include `ws_az=\u003Cavailability-zone>` for zone-aware routing.\n2. Build: `mvn package` (or `.\u002Fgradlew build`).\n3. Create the topic if it doesn't exist.\n4. Run the producer \u002F consumer as above.\n\n**If a Share Consumer was generated** (`AvroShareConsumer.java`): before running, the share feature must be enabled on the cluster and the share group's start position configured (see `references\u002Fshare-consumer.md`). Locally: `docker compose exec kafka kafka-features --bootstrap-server localhost:9092 upgrade --feature share.version=1`, then `kafka-configs --bootstrap-server localhost:9092 --alter --group \u003Cgroup> --add-config share.auto.offset.reset=earliest`. On Confluent Cloud, confirm \"Queues for Kafka\" is enabled on the (Dedicated) cluster. Run the share consumer with `mvn exec:java -Dexec.mainClass=com.example.kafka.AvroShareConsumer` and start **multiple instances with the same `GROUP_ID`** to see cooperative consumption.\n\nRemind WarpStream users that produce latency (~250ms p50) is higher than standard Kafka — this is expected. If throughput is low, verify the overrides from `references\u002Fwarpstream-optimization.md` are applied (especially `enable.idempotence=false` and large batch\u002Ffetch sizes).\n","\u003CHARD-GATE>\nDo NOT generate any code, scaffold any project, or modify any file until you have\nexplicitly asked and received answers for questions #1 (existing app or greenfield),\n#2 (target environment), and #3 (producer, consumer, or both). If the user's prompt\npartially answers some questions, still confirm your understanding before generating.\nThis applies to EVERY prompt regardless of how specific it appears.\n\u003C\u002FHARD-GATE>\n\nBegin by announcing: \"Using the Confluent Kafka Java Client skill to guide this project.\"\n\n# Confluent Kafka Java Client Creation\n\nGenerate a production-ready Java project for producing to and\u002For consuming from Kafka using the Apache Kafka Java clients (`KafkaProducer` \u002F `KafkaConsumer`) with Confluent Schema Registry serializers. Supports three target environments: **Confluent Cloud** (managed), **Local Docker**, and **WarpStream** (Kafka-compatible, object-storage-backed); two build tools: **Maven** (default) and **Gradle**; and three schema formats: **Avro** (default), **JSON Schema**, and **Protobuf**. The generated code follows Confluent's best practices.\n\n## Step 1: Gather Requirements\n\nBefore generating any code, work through the questions below. **Skip any question the user has already answered explicitly in their prompt** — do not re-ask just for form's sake. For example, \"build a producer and consumer on Confluent Cloud with synchronous sends using Gradle\" already answers #2, #3, #4, and #5; only #1, #6, #7, #8, #9, and #10 remain.\n\n**Mandatory confirmation gate — do not skip, even if the user answered every question.** Before writing any file, you MUST send one message that:\n1. Recaps the answers you extracted as a short bulleted list (e.g., \"Target: Confluent Cloud · Components: producer + consumer · Send pattern: async callback · Build: Maven · Schema: Avro · From scratch: yes\").\n2. Asks any remaining open questions inline.\n3. Explicitly asks the user to confirm or correct before you proceed.\n\nThen STOP and wait for the user's reply. Do not generate files in the same turn as the recap, and do not proceed on the assumption that a fully-specified prompt implies consent to generate immediately — the recap catches misinterpretations of the prompt and is required even when questions #1–#10 are all pre-answered. The only way to skip the gate is if the user has already confirmed the recap earlier in this conversation.\n\nDo not assume defaults for #1, #2, or #3 — if any of these are not answered by the prompt, you must ask.\n\n1. **Are you adding Kafka to an existing application, or starting from scratch?**\n   - If the user has existing Java code (mentions an existing project, has a `pom.xml`\u002F`build.gradle`, uses Spring Boot\u002FQuarkus\u002FMicronaut, etc.), do **not** scaffold a new project. Instead: (a) identify their existing producer or data-sending code, (b) ask whether they already have schemas registered in Schema Registry, (c) add Schema Registry integration to their existing code following the patterns in the reference files. Generate only the files they are missing (e.g., `KafkaConfig.java`, `src\u002Fmain\u002Favro\u002Fvalue.avsc`) and modify their existing code inline. Add the Confluent Maven repository and serializer dependencies to their existing build file.\n   - If the user already produces to Kafka without Schema Registry (e.g., `StringSerializer` with hand-rolled JSON), help them migrate: (1) generate an Avro\u002FJSON schema from their existing message structure, (2) register it, and (3) replace their raw `String`\u002F`byte[]` serializer with a Confluent Schema Registry serializer. Do not discard their existing code.\n   - If starting from scratch, proceed with the full scaffold below.\n2. **Target environment?** — Confluent Cloud, local Kafka (Docker), or WarpStream. **Always prompt for this, even if the user didn't mention it.** If they mention \"local\", \"docker\", \"self-hosted\", or just want to try Kafka without a cloud account, choose **local Docker**. If they mention \"Confluent Cloud\", \"CC\", or have existing cloud credentials, choose **Confluent Cloud**. If they mention \"WarpStream\", choose **WarpStream**. Default to Confluent Cloud if they confirm they don't have a preference, but always ask first.\n   - **If WarpStream:** Read `references\u002Fwarpstream-optimization.md` and apply the Java client overrides from that reference. Key changes: disable idempotence, dramatically increase batch sizes and in-flight requests, set large fetch sizes, add `ws_az=\u003Caz>` to `client.id` for zone-aware routing. Prefer null message keys for sticky partitioning unless entity-based ordering is required.\n3. **Producer, consumer, or both?**\n4. **Send pattern?** (Only if producer is requested.) The Java `KafkaProducer.send()` always returns a `Future\u003CRecordMetadata>` — the producer is inherently asynchronous. The choice is how you handle the result. Help the user choose:\n   - **Async with callback** (recommended default): `producer.send(record, callback)`. Non-blocking; the `Callback` handles per-record delivery reports and errors. Best throughput for most applications. Use `references\u002FAvroProducer.java`.\n   - **Synchronous**: `producer.send(record).get()`. Blocks until the broker acks each record. Lowest throughput but strongest per-message confirmation and simplest error handling. Best for batch\u002FETL scripts and steps that must confirm one write before the next. Use `references\u002FAvroProducerSync.java`.\n   - (Fire-and-forget — `producer.send(record)` with no callback and no `.get()` — is mentioned for completeness but **not** recommended: delivery failures are silently dropped.)\n   If the user mentions batch, ETL, or \"confirm each write\", default to **synchronous**. Otherwise default to **async callback**.\n5. **Build tool?** — **Maven** (default, `pom.xml`) or **Gradle** (`build.gradle`). If the user mentions Gradle, an existing `build.gradle`, or Kotlin DSL, use Gradle (`references\u002Fbuild.gradle`). Otherwise default to Maven (`references\u002Fpom.xml`).\n6. **Do you have an existing schema you'd like to use?** If yes, ask the user to paste it or provide the file path, then use it instead of generating one. If no, proceed to ask about their data fields.\n7. **What kind of data are you producing?** (Only if the user doesn't have an existing schema. Get field names and types so you can generate a matching schema and sample data.)\n8. **Topic name?** (Default: `demo-topic`)\n9. **Consumer group ID?** (Only if consumer; default: `java-consumer-group`)\n10. **Consumer API or Share Consumer API?** (Only if consumer is requested.) Help the user choose, explaining the key distinction: with the regular **Consumer API** (`KafkaConsumer`, consumer groups) each partition is assigned to exactly one consumer, so parallelism is capped at the partition count and per-key ordering is preserved. With the **Share Consumer API** (`KafkaShareConsumer`, share groups — \"Queues for Kafka\") **multiple share consumers can consume from the same partition**, giving **queue-like messaging semantics** where multiple consumers cooperatively process messages concurrently and you can scale consumers beyond the partition count (the trade-off: no per-key ordering, and each record must be acknowledged). **Default to the regular Consumer API.** Choose the Share Consumer API when the user asks for queue\u002Fwork-queue semantics, competing consumers, cooperative concurrent processing, or scaling consumers independently of partitions. If the user picks the Share Consumer API, read `references\u002Fshare-consumer.md` before generating — it requires Kafka 4.x clients (the reference build files already pin `kafka.version=4.2.1` \u002F `confluent.version=8.2.1`) and cluster-side feature enablement.\n\nDon't ask whether to use Schema Registry — always include it. **Default to Avro** (idiomatic for the JVM: generated `SpecificRecord` classes give compile-time type safety and a compact wire format). Offer JSON Schema or Protobuf if the user prefers — ask only if they hint at a preference; otherwise use Avro. If the target is WarpStream and the user is using WarpStream's built-in schema registry, note that it only supports Avro and Protobuf (`GET \u002Fschemas\u002Ftypes` returns `[\"AVRO\",\"PROTOBUF\"]`) — Avro is already the default, so no change is needed unless they want Protobuf.\n\n### Common Agent Mistakes\n\n| Thought | Reality |\n|---------|---------|\n| \"The user said Spring Boot, so I'll scaffold a fresh Maven project\" | If they have an existing app, modify it in place — add deps to their build file and integrate the serializer. Do not scaffold a competing project. |\n| \"I'll default to JSON Schema like the Python skill\" | This skill defaults to **Avro** on the JVM. Generated `SpecificRecord` classes are idiomatic and type-safe. Only use JSON Schema\u002FProtobuf if the user prefers. |\n| \"I'll leave `auto.register.schemas` at its default\" | The serializer default is `true`. Always set it to **`false`** and register explicitly via `CachedSchemaRegistryClient.register(...)`. Silent auto-registration is a production hazard. |\n| \"I'll create a `KafkaProducer` inside the send method\" | One `KafkaProducer` instance, created in `main()`, passed as a parameter. Producers are thread-safe and expensive to create. |\n| \"I'll write the schema ID into a record header like the Python sync producer\" | Java Confluent serializers embed the schema ID in the **wire format** (magic byte + 4-byte ID) automatically. Do not hand-roll headers. |\n| \"Avro just needs the `.avsc` on the classpath\" | Avro `SpecificRecord` classes are **generated at build time** by `avro-maven-plugin` (Maven) or the `com.github.davidmc24.gradle.plugin.avro` plugin (Gradle) from `src\u002Fmain\u002Favro\u002F*.avsc`. The producer imports the generated class (e.g., `com.example.kafka.Transaction`). Run `mvn generate-sources` \u002F `.\u002Fgradlew generateAvroJava` before referencing it. |\n| \"I'll catch and swallow `WakeupException` errors generally\" | `WakeupException` is the **expected** signal from `consumer.wakeup()` in a shutdown hook. Catch it narrowly to break the poll loop, then `close()` in `finally`. |\n| \"Consumer means `KafkaConsumer` — I'll skip asking about the Share Consumer API\" | When a consumer is requested, always ask Consumer API vs Share Consumer API (question #10). Default to the regular Consumer API, but offer the Share Consumer API (`KafkaShareConsumer`) for queue-like\u002Fcooperative consumption. |\n| \"I'll forget the Confluent Maven repo — the serializers are on Maven Central\" | `io.confluent:kafka-avro-serializer` and friends resolve from `https:\u002F\u002Fpackages.confluent.io\u002Fmaven\u002F`. The build file MUST declare that repository. |\n| \"`schema.registry.url` goes on the `KafkaProducer` config only\" | The serializer reads `schema.registry.url` (and `basic.auth.*`) from the **same** producer\u002Fconsumer `Properties`. Put SR config in the client properties so the serializer picks it up. |\n\n## Step 1b: Confirm Understanding\n\nAfter gathering all answers, present a confirmation summary before generating any code:\n\n```\nBefore I generate the project, let me confirm:\n- Project type: [Greenfield scaffold \u002F Migration of existing code]\n- Environment: [Confluent Cloud (SASL_SSL) \u002F Local Docker (PLAINTEXT) \u002F WarpStream]\n- Schema format: [Avro (default) \u002F JSON Schema \u002F Protobuf]\n- Build tool: [Maven \u002F Gradle]\n- Components: [Producer only \u002F Consumer only \u002F Both]\n- Send pattern: [Async callback \u002F Synchronous] (if producer)\n- Consumer API: [Consumer API \u002F Share Consumer API] (if consumer)\n- Schema: [brief description of user's data fields]\n- Topic: [topic name]\n- Consumer group: [group ID] (if consumer)\n\nDoes this look right?\n```\n\nWait for user confirmation before proceeding to Step 2. If the user corrects anything, update your understanding and re-confirm.\n\n## Step 2: Generate the Project\n\n### Decision Flowchart\n\n```dot\ndigraph decisions {\n  \"Q1: Existing app?\" -> \"Migration path:\\nmodify existing code +\\nadd deps to build file\" [label=\"yes\"];\n  \"Q1: Existing app?\" -> \"Q2: Environment?\" [label=\"no \u002F greenfield\"];\n  \"Q2: Environment?\" -> \"Cloud config\\n(SASL_SSL)\" [label=\"Confluent Cloud\"];\n  \"Q2: Environment?\" -> \"Local Docker config\\n(PLAINTEXT) + docker-compose.yml\" [label=\"local \u002F docker \u002F OSS\"];\n  \"Q2: Environment?\" -> \"WarpStream config\\n(apply overrides from\\nreferences\u002Fwarpstream-optimization.md)\" [label=\"WarpStream\"];\n  \"Cloud config\\n(SASL_SSL)\" -> \"Q4: Send pattern?\";\n  \"Local Docker config\\n(PLAINTEXT) + docker-compose.yml\" -> \"Q4: Send pattern?\";\n  \"WarpStream config\\n(apply overrides from\\nreferences\u002Fwarpstream-optimization.md)\" -> \"Q4: Send pattern?\";\n  \"Q4: Send pattern?\" -> \"AvroProducer.java\\n(send + Callback)\" [label=\"async callback\"];\n  \"Q4: Send pattern?\" -> \"AvroProducerSync.java\\n(send().get())\" [label=\"synchronous\"];\n}\n```\n\nCreate this file structure in the user's chosen directory (Maven layout shown; for Gradle the source tree is identical, only the build file differs):\n\n```\n\u003Cproject-dir>\u002F\n├── pom.xml                       # Maven (or build.gradle for Gradle)\n├── docker-compose.yml            # (local Docker path only)\n├── .properties.example           # template for credentials\n├── README.md\n└── src\u002F\n    ├── main\u002F\n    │   ├── java\u002Fcom\u002Fexample\u002Fkafka\u002F\n    │   │   ├── KafkaConfig.java   # shared config loading + connectivity verification\n    │   │   ├── AvroProducer.java  # (if producer requested; or AvroProducerSync.java)\n    │   │   └── AvroConsumer.java  # (if consumer requested; or AvroShareConsumer.java for the Share Consumer API)\n    │   └── avro\u002F\n    │       └── value.avsc         # Avro schema (codegen source; value.schema.json \u002F value.proto for other formats)\n    └── test\u002F\n        └── java\u002Fcom\u002Fexample\u002Fkafka\u002F\n            └── AppTest.java       # unit tests (always generated)\n```\n\n### Security\n\nNEVER read, open, or display `.properties` files. They contain API keys and secrets. Only generate `.properties.example` with placeholder values. If the user asks you to debug a connection issue, ask them to verify their `.properties` values themselves — do not read the file. Add `.properties` to `.gitignore`.\n\n### Core Principles\n\nThese principles matter because they prevent the most common production issues with Kafka Java clients:\n\n1. **Reuse the producer\u002Fconsumer instance.** Creating a `KafkaProducer` per message is expensive — each one opens TCP connections, does SASL handshakes, and fetches metadata. `KafkaProducer` is thread-safe; create one and share it. The send helper accepts the producer as a parameter, never instantiates one.\n\n2. **Always use Schema Registry, with Avro by default.** Schema Registry enforces a producer\u002Fconsumer contract; without it, schema changes silently break consumers. This skill defaults to **Avro** because generated `SpecificRecord` classes give the JVM compile-time type safety and a compact wire format. JSON Schema and Protobuf are supported alternatives.\n\n   **Register schemas as a separate explicit step** before producing. Use a dedicated `registerSchema()` method that calls `schemaRegistryClient.register(subject, parsedSchema)` and lets errors (auth failures, network errors, permission denials) propagate immediately — never swallow them. Then configure the serializer with `auto.register.schemas=false` and `use.latest.version=true`. This ensures the serializer never silently auto-registers and aligns with production practice where CI\u002FCD registers schemas, not application startup.\n\n   Use the serializer matching the chosen format:\n   - **Avro (default):** `io.confluent.kafka.serializers.KafkaAvroSerializer` \u002F `KafkaAvroDeserializer`. Set `specific.avro.reader=true` on the consumer so it deserializes into the generated `SpecificRecord` class.\n   - **JSON Schema:** `io.confluent.kafka.serializers.json.KafkaJsonSchemaSerializer` \u002F `KafkaJsonSchemaDeserializer`. Set `json.value.type` on the consumer to the POJO class. See `references\u002FJsonSchemaProducer.java` and `references\u002FJsonSchemaConsumer.java`.\n   - **Protobuf:** `io.confluent.kafka.serializers.protobuf.KafkaProtobufSerializer` \u002F `KafkaProtobufDeserializer`. Generate classes from a `.proto` via `protobuf-maven-plugin` and set `specific.protobuf.value.type` on the consumer.\n\n3. **Choose the send pattern deliberately.** `KafkaProducer.send()` returns `Future\u003CRecordMetadata>` and is always asynchronous internally:\n   - **Async with callback** (`references\u002FAvroProducer.java`): `producer.send(record, (metadata, exception) -> {...})`. Non-blocking, best throughput. Recommended default.\n   - **Synchronous** (`references\u002FAvroProducerSync.java`): `producer.send(record).get()`. Blocks per record; strongest confirmation, lowest throughput. Best for batch\u002FETL.\n   The consumer is a single-threaded `poll()` loop in both cases.\n\n4. **Graceful shutdown.** Producers must `flush()` then `close()` (in a `finally` block) so buffered records are not lost. Consumers use the **wakeup pattern**: register `Runtime.getRuntime().addShutdownHook(new Thread(consumer::wakeup))`, run the poll loop until `consumer.wakeup()` raises `WakeupException`, catch it narrowly to break the loop, and `close()` in `finally`. `close()` commits offsets and leaves the consumer group cleanly, avoiding unnecessary rebalances.\n\n5. **Support Confluent Cloud, local Docker, and WarpStream.** For Confluent Cloud, configure `SASL_SSL` with `PLAIN` mechanism via `sasl.jaas.config` and load API keys from `.properties`. For local Docker, use `PLAINTEXT` with no authentication. For WarpStream, use `SASL_SSL` or `PLAINTEXT` per the user's deployment and apply the Java overrides from `references\u002Fwarpstream-optimization.md`. The `KAFKA_ENV` setting (`cloud`, `local`, or `warpstream`) controls which path `KafkaConfig` uses. Load all settings from the `.properties` file via `java.util.Properties` (falling back to process environment variables for any key absent from the file).\n\n6. **Verify connectivity before running.** Use `AdminClient.listTopics()` to confirm the broker is reachable and the topic exists before producing or consuming. Verify Schema Registry connectivity with an HTTP health check against `\u002Fsubjects`.\n\n7. **Always set a message key for domain events.** Pass the entity identifier as the `ProducerRecord` key for any message representing an entity or event stream (order events, user actions, device telemetry, transactions). Kafka partitions by key, so same-key messages land on the same partition and preserve ordering — critical for streams like `OrderCreated → OrderUpdated → OrderCancelled`. Ask the user which field identifies the entity and use it as the key. Only use a `null` key if the user explicitly states ordering does not matter.\n\n   **WarpStream exception:** On WarpStream, null keys enable sticky partitioning, which builds larger batches and significantly improves throughput and cost. When the use case does **not** require per-entity ordering (independent telemetry, stateless metrics, logs), recommend a null key and explain the throughput benefit. When per-entity ordering **is** required, still set a key — correctness takes priority. Ask the user whether their events need per-key ordering to decide.\n\n### KafkaConfig.java\n\nThis class handles configuration loading (via `java.util.Properties`, reading the `.properties` file and falling back to process environment variables) and connectivity verification. Use `references\u002FKafkaConfig.java` as the template. It builds the base client `Properties` (SASL_SSL vs PLAINTEXT by `KAFKA_ENV`), the Schema Registry config keys the serializers read, and the `verifyKafkaSetup` \u002F `verifySchemaRegistry` helpers.\n\n### Producer Patterns\n\nWhen the user chooses **async callback**, use `references\u002FAvroProducer.java`. When the user chooses **synchronous**, use `references\u002FAvroProducerSync.java`. For JSON Schema, use `references\u002FJsonSchemaProducer.java`. Key points common to all:\n- The send helper takes a `KafkaProducer` parameter — it never creates one. The producer is created once in `main()`.\n- `registerSchema()` registers explicitly via `CachedSchemaRegistryClient` and returns the schema ID; errors propagate. The serializer is configured with `auto.register.schemas=false`, `use.latest.version=true`.\n- The schema ID is embedded automatically in the Confluent wire format — do not add it as a header.\n- `flush()` then `close()` in a `finally` block.\n\n### Consumer Pattern\n\n**Regular Consumer API (default).** Read `references\u002Fconsumer.md`, then use `references\u002FAvroConsumer.java` (or `references\u002FJsonSchemaConsumer.java` for JSON Schema). Key points:\n- Deserialize via the Schema Registry deserializer — no raw `String`\u002FJSON fallback.\n- Avro: set `specific.avro.reader=true` and consume into the generated `SpecificRecord` type.\n- On AK 4.0+ set `group.protocol=consumer` to use the next-gen rebalance protocol (KIP-848), which eliminates stop-the-world rebalances. See `references\u002Fconsumer.md`.\n- Disable `enable.auto.commit` and commit explicitly after processing; weigh `commitSync` vs `commitAsync` per `references\u002Fconsumer.md`.\n- Wakeup-based graceful shutdown: shutdown hook calls `consumer.wakeup()`; the loop catches `WakeupException` and `close()`s in `finally`.\n- Continuous `poll(Duration.ofMillis(1000))` loop until shutdown.\n\n**Share Consumer API (\"Queues for Kafka\").** If the user chose the Share Consumer API in question #10, read `references\u002Fshare-consumer.md` and use `references\u002FAvroShareConsumer.java` instead of `AvroConsumer.java`. It uses `KafkaShareConsumer` so multiple instances in the same share group cooperatively consume from the same partition (queue-like semantics). Same Schema Registry deserializer and wakeup shutdown as above, plus: per-record `acknowledge(record, AcknowledgeType.ACCEPT\u002FRELEASE\u002FREJECT)` and cluster-side feature enablement (`share.version=1` locally; \"Queues for Kafka\" enabled on Confluent Cloud). The reference build files already pin Kafka 4.x clients, so no version change is needed — just keep them. Tell the user about the feature requirement.\n\n### Schemas\n\nGenerate a schema matching the user's data domain.\n\n**Avro (default):** place the schema at `src\u002Fmain\u002Favro\u002Fvalue.avsc` so the build plugin generates the `SpecificRecord` class. Use `references\u002Fvalue.avsc` as the starting point and adapt to the user's domain. The record `name` becomes the generated Java class name and `namespace` its package (e.g., `name: \"Transaction\"`, `namespace: \"com.example.kafka\"` → `com.example.kafka.Transaction`). Follow `references\u002Fschema-generation-rules.md` strictly.\n\n**JSON Schema:** place at `src\u002Fmain\u002Fresources\u002Fvalue.schema.json` and pair it with a POJO. **Protobuf:** place a `.proto` under `src\u002Fmain\u002Fproto\u002F`.\n\n#### Multi-Event Topics (Advanced)\n\nWhen the user describes multiple event types on a single topic, follow `references\u002Fmulti-event-guide.md`. Only suggest multi-event\u002Funion schemas when the user explicitly describes multiple event types on one topic.\n\n### docker-compose.yml (Local Docker Path Only)\n\nWhen the user chooses local Docker, you MUST generate a `docker-compose.yml` using `references\u002Fdocker-compose.yml` as the template. It starts a single-node Kafka broker (`confluentinc\u002Fconfluent-local`, KRaft mode) and Confluent Schema Registry. The user runs `docker compose up -d`.\n\n**IMPORTANT:** `confluentinc\u002Fconfluent-local` has built-in listener names `PLAINTEXT` (29092), `PLAINTEXT_HOST` (9092), `CONTROLLER` (29093). Do NOT invent custom listener names — that conflicts with the image's internal config and causes boot loops. Only override `KAFKA_ADVERTISED_LISTENERS` and `KAFKA_LISTENERS` using those exact names. The internal `PLAINTEXT` listener must advertise the `kafka` hostname so Schema Registry can reach the broker inside the Docker network.\n\n### .properties.example\n\nGenerate the appropriate `.properties.example` for the target environment. It is a standard Java properties file (`key=value`), loaded by `KafkaConfig` via `java.util.Properties`:\n\n**Confluent Cloud:**\n```\nKAFKA_ENV=cloud\nBOOTSTRAP_SERVER=pkc-xxxxx.us-east-1.aws.confluent.cloud:9092\nAPI_KEY=your-api-key\nAPI_SECRET=your-api-secret\nTOPIC=demo-topic\nSCHEMA_REGISTRY_URL=https:\u002F\u002Fpsrc-xxxxx.us-east-2.aws.confluent.cloud\nSR_API_KEY=your-sr-api-key\nSR_API_SECRET=your-sr-api-secret\nCLIENT_ID=java-client\nGROUP_ID=java-consumer-group\n```\n\n**Local Docker:**\n```\nKAFKA_ENV=local\nBOOTSTRAP_SERVER=localhost:9092\nTOPIC=demo-topic\nSCHEMA_REGISTRY_URL=http:\u002F\u002Flocalhost:8081\nCLIENT_ID=java-client\nGROUP_ID=java-consumer-group\n```\n\n**WarpStream:**\n```\nKAFKA_ENV=warpstream\nBOOTSTRAP_SERVER=your-warpstream-bootstrap-url:9092\nTOPIC=demo-topic\nSCHEMA_REGISTRY_URL=http:\u002F\u002Fyour-schema-registry:8081\nCLIENT_ID=java-client,ws_az=us-east-1a\nGROUP_ID=java-consumer-group\n# If your WarpStream deployment requires SASL auth, uncomment:\n# API_KEY=your-api-key\n# API_SECRET=your-api-secret\n# If using Confluent Cloud Schema Registry, uncomment:\n# SR_API_KEY=your-sr-api-key\n# SR_API_SECRET=your-sr-api-secret\n```\n\n### Build File\n\n**Maven (default):** use `references\u002Fpom.xml`. It declares the Confluent Maven repository, `kafka-clients`, the Avro serializer + `avro` + `avro-maven-plugin` (codegen from `src\u002Fmain\u002Favro`), a logging binding, and JUnit 5 + Mockito for tests. Configuration is loaded with the JDK's built-in `java.util.Properties` — no extra dependency. Comments show how to swap in the JSON Schema or Protobuf serializer.\n\n**Gradle:** use `references\u002Fbuild.gradle`. Same dependencies plus the `com.github.davidmc24.gradle.plugin.avro` plugin for codegen.\n\nEvery dependency imported anywhere in the generated code must appear in the build file. The user should be able to `mvn package` \u002F `.\u002Fgradlew build` and run with zero unresolved-symbol or `ClassNotFoundException` errors.\n\n### README.md\n\nGenerate a README following `references\u002Freadme-template.md`. Adapt it to what was actually generated — omit producer sections if only a consumer was requested, omit Docker sections for Confluent Cloud projects, and use the correct build-tool commands.\n\n### Tests\n\nAlways generate unit tests at `src\u002Ftest\u002Fjava\u002Fcom\u002Fexample\u002Fkafka\u002FAppTest.java`. Use `references\u002FAppTest.java` as the template. The tests must run without a live Kafka cluster or Schema Registry — use `MockProducer`\u002F`MockConsumer` from `kafka-clients` and Mockito for the Schema Registry client.\n\nThe tests verify these properties:\n\n1. **KafkaConfig**: `baseProperties()` produces `SASL_SSL` + `PLAIN` (`sasl.jaas.config` set) when `KAFKA_ENV=cloud`, or `PLAINTEXT` with no SASL when `KAFKA_ENV=local`. `verifyKafkaSetup()` returns the right boolean against a mocked `AdminClient`.\n2. **Producer** (if generated): the send helper accepts a producer parameter (never creates one), exactly one `KafkaProducer` is instantiated in the class, and sending a batch through a `MockProducer` records one history entry per message with the expected key. For the sync variant, verify the send result is resolved (`.get()`).\n3. **Consumer** (if generated): uses a Schema Registry deserializer (`KafkaAvroDeserializer` \u002F `KafkaJsonSchemaDeserializer` \u002F `KafkaProtobufDeserializer`) — not a raw `StringDeserializer` for values — and uses the wakeup + `close()` shutdown pattern. A `MockConsumer` seeded with records yields the expected deserialized values.\n4. **Schema file**: the Avro `value.avsc` parses as a `record` with a top-level `doc` and a `doc` on every field (mirror `references\u002Fschema-generation-rules.md`). For JSON Schema, check `type: object`, `title`, descriptions, and `format: date-time` on timestamp fields.\n\nAfter generating all files, run `mvn test` (or `.\u002Fgradlew test`) to verify the tests pass. If any test fails, fix the generated code (not the tests) until they pass.\n\n## Step 3: Guide the User\n\nAfter generating the files, give instructions based on the target environment. Adapt to what was generated.\n\n**Confluent Cloud:**\n1. Copy `.properties.example` to `.properties` and fill in Confluent Cloud credentials (bootstrap server, API keys, Schema Registry URL — all in the Confluent Cloud Console under cluster\u002Fenvironment settings).\n2. Generate Avro classes and build: `mvn generate-sources && mvn package` (or `.\u002Fgradlew build`).\n3. If a producer was generated, the schema is registered explicitly on first run via `registerSchema()` (`auto.register.schemas=false`). If only a consumer was generated, register the schema manually in the Console under Schema Registry for the topic's value subject.\n4. Run the producer: `mvn exec:java -Dexec.mainClass=com.example.kafka.AvroProducer` (or `.\u002Fgradlew run`).\n5. Run the consumer: `mvn exec:java -Dexec.mainClass=com.example.kafka.AvroConsumer`.\n\n**Local Docker:**\n1. Start Kafka + Schema Registry: `docker compose up -d`.\n2. Copy `.properties.example` to `.properties` (defaults are pre-filled for local Docker).\n3. Build: `mvn package` (or `.\u002Fgradlew build`).\n4. Create the topic if auto-creation is disabled: `docker compose exec kafka kafka-topics --create --topic demo-topic --bootstrap-server localhost:29092`.\n5. Run the producer \u002F consumer as above.\n6. When done: `docker compose down` (add `-v` to remove stored data).\n\n**WarpStream:**\n1. Copy `.properties.example` to `.properties` and fill in the WarpStream bootstrap server, Schema Registry URL, and (if applicable) credentials. Set `CLIENT_ID` to include `ws_az=\u003Cavailability-zone>` for zone-aware routing.\n2. Build: `mvn package` (or `.\u002Fgradlew build`).\n3. Create the topic if it doesn't exist.\n4. Run the producer \u002F consumer as above.\n\n**If a Share Consumer was generated** (`AvroShareConsumer.java`): before running, the share feature must be enabled on the cluster and the share group's start position configured (see `references\u002Fshare-consumer.md`). Locally: `docker compose exec kafka kafka-features --bootstrap-server localhost:9092 upgrade --feature share.version=1`, then `kafka-configs --bootstrap-server localhost:9092 --alter --group \u003Cgroup> --add-config share.auto.offset.reset=earliest`. On Confluent Cloud, confirm \"Queues for Kafka\" is enabled on the (Dedicated) cluster. Run the share consumer with `mvn exec:java -Dexec.mainClass=com.example.kafka.AvroShareConsumer` and start **multiple instances with the same `GROUP_ID`** to see cooperative consumption.\n\nRemind WarpStream users that produce latency (~250ms p50) is higher than standard Kafka — this is expected. If throughput is low, verify the overrides from `references\u002Fwarpstream-optimization.md` are applied (especially `enable.idempotence=false` and large batch\u002Ffetch sizes).\n",{"name":5,"metadata":44,"description":7},{"version":45},"1.0.0","main","204b36f10e9be41819557988e8f5291711fda986","skills\u002Fdeveloping-kafka-java-client",11,"https:\u002F\u002Fgithub.com\u002Fconfluentinc\u002Fagent-skills","https:\u002F\u002Fgithub.com\u002Fconfluentinc","https:\u002F\u002Fconfluent.io","Real-time streams powered by Apache Kafka®","2026-11-12 05:14:44",{"source":8,"skillName":5,"commands":56,"prompt":66,"zipAvailable":67},[57,60,63],{"tool":58,"command":59},"npx","npx skills add confluentinc\u002Fagent-skills --skill developing-kafka-java-client",{"tool":61,"command":62},"bunx","bunx skills add confluentinc\u002Fagent-skills --skill developing-kafka-java-client",{"tool":64,"command":65},"pnpm","pnpm dlx skills add confluentinc\u002Fagent-skills --skill developing-kafka-java-client","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fconfluentinc\u002Fagent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fdeveloping-kafka-java-client\u002FSKILL.md",true,[69,75,81,85,89,93,97,101,105,109,113,117,121,125,129,133,137,141,145,149],{"path":70,"resourceType":71,"resourceTypeDesc":72,"sizeBytes":73,"sourceHtmlUrl":74},"evals\u002Fevals.json","REFERENCE","参考文档",15165,"https:\u002F\u002Fgithub.com\u002Fconfluentinc\u002Fagent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fdeveloping-kafka-java-client\u002Fevals\u002Fevals.json",{"path":76,"resourceType":77,"resourceTypeDesc":78,"sizeBytes":79,"sourceHtmlUrl":80},"references\u002FAppTest.java","SCRIPT","脚本",6105,"https:\u002F\u002Fgithub.com\u002Fconfluentinc\u002Fagent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fdeveloping-kafka-java-client\u002Freferences\u002FAppTest.java",{"path":82,"resourceType":77,"resourceTypeDesc":78,"sizeBytes":83,"sourceHtmlUrl":84},"references\u002FAvroConsumer.java",4208,"https:\u002F\u002Fgithub.com\u002Fconfluentinc\u002Fagent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fdeveloping-kafka-java-client\u002Freferences\u002FAvroConsumer.java",{"path":86,"resourceType":77,"resourceTypeDesc":78,"sizeBytes":87,"sourceHtmlUrl":88},"references\u002FAvroProducer.java",5319,"https:\u002F\u002Fgithub.com\u002Fconfluentinc\u002Fagent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fdeveloping-kafka-java-client\u002Freferences\u002FAvroProducer.java",{"path":90,"resourceType":77,"resourceTypeDesc":78,"sizeBytes":91,"sourceHtmlUrl":92},"references\u002FAvroProducerSync.java",4838,"https:\u002F\u002Fgithub.com\u002Fconfluentinc\u002Fagent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fdeveloping-kafka-java-client\u002Freferences\u002FAvroProducerSync.java",{"path":94,"resourceType":77,"resourceTypeDesc":78,"sizeBytes":95,"sourceHtmlUrl":96},"references\u002FAvroShareConsumer.java",5404,"https:\u002F\u002Fgithub.com\u002Fconfluentinc\u002Fagent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fdeveloping-kafka-java-client\u002Freferences\u002FAvroShareConsumer.java",{"path":98,"resourceType":71,"resourceTypeDesc":72,"sizeBytes":99,"sourceHtmlUrl":100},"references\u002Fbuild.gradle",1929,"https:\u002F\u002Fgithub.com\u002Fconfluentinc\u002Fagent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fdeveloping-kafka-java-client\u002Freferences\u002Fbuild.gradle",{"path":102,"resourceType":71,"resourceTypeDesc":72,"sizeBytes":103,"sourceHtmlUrl":104},"references\u002Fconsumer.md",5100,"https:\u002F\u002Fgithub.com\u002Fconfluentinc\u002Fagent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fdeveloping-kafka-java-client\u002Freferences\u002Fconsumer.md",{"path":106,"resourceType":71,"resourceTypeDesc":72,"sizeBytes":107,"sourceHtmlUrl":108},"references\u002Fdocker-compose.yml",690,"https:\u002F\u002Fgithub.com\u002Fconfluentinc\u002Fagent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fdeveloping-kafka-java-client\u002Freferences\u002Fdocker-compose.yml",{"path":110,"resourceType":77,"resourceTypeDesc":78,"sizeBytes":111,"sourceHtmlUrl":112},"references\u002FJsonSchemaConsumer.java",3938,"https:\u002F\u002Fgithub.com\u002Fconfluentinc\u002Fagent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fdeveloping-kafka-java-client\u002Freferences\u002FJsonSchemaConsumer.java",{"path":114,"resourceType":77,"resourceTypeDesc":78,"sizeBytes":115,"sourceHtmlUrl":116},"references\u002FJsonSchemaProducer.java",4734,"https:\u002F\u002Fgithub.com\u002Fconfluentinc\u002Fagent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fdeveloping-kafka-java-client\u002Freferences\u002FJsonSchemaProducer.java",{"path":118,"resourceType":77,"resourceTypeDesc":78,"sizeBytes":119,"sourceHtmlUrl":120},"references\u002FKafkaConfig.java",7823,"https:\u002F\u002Fgithub.com\u002Fconfluentinc\u002Fagent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fdeveloping-kafka-java-client\u002Freferences\u002FKafkaConfig.java",{"path":122,"resourceType":71,"resourceTypeDesc":72,"sizeBytes":123,"sourceHtmlUrl":124},"references\u002Fmulti-event-guide.md",3826,"https:\u002F\u002Fgithub.com\u002Fconfluentinc\u002Fagent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fdeveloping-kafka-java-client\u002Freferences\u002Fmulti-event-guide.md",{"path":126,"resourceType":71,"resourceTypeDesc":72,"sizeBytes":127,"sourceHtmlUrl":128},"references\u002Fpom.xml",4709,"https:\u002F\u002Fgithub.com\u002Fconfluentinc\u002Fagent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fdeveloping-kafka-java-client\u002Freferences\u002Fpom.xml",{"path":130,"resourceType":71,"resourceTypeDesc":72,"sizeBytes":131,"sourceHtmlUrl":132},"references\u002Freadme-template.md",2429,"https:\u002F\u002Fgithub.com\u002Fconfluentinc\u002Fagent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fdeveloping-kafka-java-client\u002Freferences\u002Freadme-template.md",{"path":134,"resourceType":71,"resourceTypeDesc":72,"sizeBytes":135,"sourceHtmlUrl":136},"references\u002Fschema-generation-rules.md",3172,"https:\u002F\u002Fgithub.com\u002Fconfluentinc\u002Fagent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fdeveloping-kafka-java-client\u002Freferences\u002Fschema-generation-rules.md",{"path":138,"resourceType":71,"resourceTypeDesc":72,"sizeBytes":139,"sourceHtmlUrl":140},"references\u002Fshare-consumer.md",4985,"https:\u002F\u002Fgithub.com\u002Fconfluentinc\u002Fagent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fdeveloping-kafka-java-client\u002Freferences\u002Fshare-consumer.md",{"path":142,"resourceType":71,"resourceTypeDesc":72,"sizeBytes":143,"sourceHtmlUrl":144},"references\u002Fvalue.avsc",1112,"https:\u002F\u002Fgithub.com\u002Fconfluentinc\u002Fagent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fdeveloping-kafka-java-client\u002Freferences\u002Fvalue.avsc",{"path":146,"resourceType":71,"resourceTypeDesc":72,"sizeBytes":147,"sourceHtmlUrl":148},"references\u002Fvalue.schema.json",1056,"https:\u002F\u002Fgithub.com\u002Fconfluentinc\u002Fagent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fdeveloping-kafka-java-client\u002Freferences\u002Fvalue.schema.json",{"path":150,"resourceType":71,"resourceTypeDesc":72,"sizeBytes":151,"sourceHtmlUrl":152},"references\u002Fwarpstream-optimization.md",8003,"https:\u002F\u002Fgithub.com\u002Fconfluentinc\u002Fagent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fdeveloping-kafka-java-client\u002Freferences\u002Fwarpstream-optimization.md",[154,162,184,205,228,243],{"skillNo":155,"name":156,"nameZh":6,"description":157,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":158,"categories":159,"keywords":160,"publishedAt":161},"01M78MXR8SPS27PBP215HPD5VZ","confluent-cloud-provider-integration","Guide a user through setting up and validating a Confluent Cloud provider integration, so fully-managed connectors and Tableflow reach cloud provider (CSP) resources via a short-lived assumed identity, not long-term access keys. Covers AWS (IAM AssumeRole), Azure (Entra ID multi-tenant app plus service principal), and Google Cloud (service account impersonation), with state tracking across the Confluent and CSP UIs\u002FCLIs. Use when a user says \"set up\u002Fcreate a provider integration\", \"provider integration for an S3 \u002F DynamoDB \u002F GCS \u002F BigQuery connector\", \"connect a connector without access keys\", \"IAM role for a Confluent connector\", \"Entra ID service principal for Confluent\", or asks about provider.integration.id or authentication.method. Do NOT trigger for configuring a connector that already has a working integration, for Confluent RBAC or API-key management, for CDC or Tableflow pipelines end-to-end, or for authoring an agent skill; this skill stops once the integration is created and validated.","https:\u002F\u002Fgithub.com\u002Fconfluentinc\u002Fagent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fconfluent-cloud-provider-integration\u002FSKILL.md",[],[],"2026-11-15 14:19:17",{"skillNo":163,"name":164,"nameZh":6,"description":165,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":166,"categories":167,"keywords":168,"publishedAt":39},"01M6DRM9K8G3X7H4N445JGEVPT","msk-migration","Use this skill to assess and plan a migration from AWS MSK (Managed Streaming for Apache Kafka) to Confluent Cloud. Triggers on user intent like \"migrate MSK to Confluent Cloud\", \"move off MSK\", \"MSK to CC cutover\", \"Zero-Cut migration from MSK\", \"kcp scan my MSK\", or any discussion of MSK-to-CC assessment, planning, cluster sizing, Cluster Linking setup, Gateway-based switchover, or post-cutover validation. Do NOT trigger for non-MSK Kafka sources (open-source Kafka, Aiven, Confluent Platform, Redpanda) — this skill is MSK-only. Do NOT trigger for greenfield Confluent Cloud projects with no existing Kafka source. Do NOT trigger for general Kafka programming questions (producer\u002Fconsumer code, Kafka Streams) unrelated to migration.","https:\u002F\u002Fgithub.com\u002Fconfluentinc\u002Fagent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fmsk-migration\u002FSKILL.md",[],[169,170,32,171,172,23,24,25,173,174,175,35,176,177,178,179,180,181,182,183],"msk migration","migration","code","gateway","cc","cut","intent","unrelated","plan","streaming","migrate","only","open","assessment","projects",{"skillNo":185,"name":186,"nameZh":6,"description":187,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":188,"categories":189,"keywords":190,"publishedAt":39},"01M6DRM48N8ZCGTA0MSNADJXJ9","kafka-streams-programming","Architect, build, and debug Kafka Streams apps (JVM-embedded stream processing). Use when user mentions KStream, KTable, topology, TopologyTestDriver, StreamsBuilder, interactive queries, GlobalKTable, joins\u002Fwindows\u002Faggregations, or debugging issues (rebalancing, state stores, lag, deserialization errors). Also use when user wants to optimize Kafka Streams for WarpStream or tune Kafka Streams client configuration for WarpStream. Do NOT trigger for Flink, connectors, CDC, or plain producer\u002Fconsumer.","https:\u002F\u002Fgithub.com\u002Fconfluentinc\u002Fagent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fkafka-streams-programming\u002FSKILL.md",[],[191,192,23,21,193,194,195,196,197,22,198,199,26,200,32,201,202,203,204,27],"programming","kafka streams programming","debugging","windows","architect","topology","cdc","jvm","stream processing","issues","connectors","interactive","debug","use",{"skillNo":206,"name":207,"nameZh":6,"description":208,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":209,"categories":210,"keywords":211,"publishedAt":39},"01M6DRKX6HCEW6QC3TSJD47R3X","kafka-schema-registry","Scan a project to identify Kafka applications, extract schemas from data models, tag PII fields, generate Terraform for Confluent Schema Registry registration, and produce a migration report with rollout ordering. Use this skill when a user asks to analyze a folder or repo for Kafka usage, extract schemas, audit producer\u002Fconsumer configurations, or generate Terraform for Schema Registry.","https:\u002F\u002Fgithub.com\u002Fconfluentinc\u002Fagent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fkafka-schema-registry\u002FSKILL.md",[],[21,212,213,214,215,216,217,218,170,219,220,204,221,222,223,224,29,225,226,227],"kafka schema registry","schema","registry","audit","data","models","report","analyze","rollout","produce","applications","repo","scan","registration","pii","generate",{"skillNo":229,"name":230,"nameZh":6,"description":231,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":232,"categories":233,"keywords":234,"publishedAt":39},"01M6DRKR2J9MFM4HSSPJBX26SD","flink-udf","Build and deploy Apache Flink user-defined functions (UDFs) in Java for stream processing over Kafka. Use this skill when users want to create scalar UDFs, user-defined table functions (UDTFs), or process table functions (PTFs) in Java, deploy them to Confluent Cloud or local Docker environments, and invoke them from Flink SQL or the Table API. Trigger on: Flink UDF, custom Flink function, process table function, PTF, UDTF, Flink user defined, extend Flink SQL, stateful stream processing with Flink. Do NOT trigger for: Kafka Streams UDFs (use kafka-streams-programming skill), general Flink job development without custom functions, CDC streaming data piplines that include Flink (prefer the confluent-cloud-cdc-tableflow skill), Flink connector setup, or Kafka producer\u002Fconsumer code.","https:\u002F\u002Fgithub.com\u002Fconfluentinc\u002Fagent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fflink-udf\u002FSKILL.md",[],[235,236,38,237,21,199,32,27,238,35,239,178,191,240,241,171,20,204,242,30],"flink","flink udf","development","create","functions","Connector","api","general",{"skillNo":244,"name":245,"nameZh":6,"description":246,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":247,"categories":248,"keywords":249,"publishedAt":39},"01M6DRKJ5YMXKVD7BG52K68NK6","developing-kafka-python-client","Use when the user wants to build a Python Kafka producer or consumer, add Schema Registry to existing Python code, migrate from raw JSON to schema-backed serialization, or scaffold a confluent-kafka-python project for Confluent Cloud, local Docker, or WarpStream. Also use when user wants to optimize Python Kafka client configuration for WarpStream.","https:\u002F\u002Fgithub.com\u002Fconfluentinc\u002Fagent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fdeveloping-kafka-python-client\u002FSKILL.md",[],[250,31,21,214,251,24,252,25,253,254,255,256,22,171,179,204,213,30,38,29],"developing kafka python client","user","serialization","configuration","cloud","json","build"]