Token导航 LogoToken导航TokenDH.com
开发需要联网github未标认证来源可访问clear审计未展示

confluent-schema-registry汇合模式注册表

Agent Skill

confluent-schema-registry 用于处理 GitHub 仓库、Issue、Pull Request 和代码协作信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要围绕仓库状态、代码变更或协作事项进行整理时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

总安装

447

周安装

19

GitHub Stars

134

下载量

157
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

3

许可证

MIT

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:confluent-schema-registry(汇合模式注册表)
来源仓库:https://github.com/anton-abyzov/specweave
仓库路径:skills/confluent-schema-registry
安装命令:
npx skills add https://github.com/anton-abyzov/specweave --skill confluent-schema-registry
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。不同来源提供的安装方式可能略有差异;本站展示可直接复制的安装命令,安装前请核对来源页面。

skills.shnpx skills
npx skills add https://github.com/anton-abyzov/specweave --skill confluent-schema-registry

简介

Schema Registry 管理 Avro、Protobuf 与 JSON Schema 演化。

  • 支持向前向后兼容规则与全局唯一 schema ID。
  • 集成 Kafka 生产者消费者,保障数据一致性。
  • 需配置注册中心地址与访问凭证。
  • confluent-schema-registry 属于开发类 Skill,可作为该场景下的辅助能力补充。

SKILL.md

Confluent Schema Registry Skill

Expert knowledge of Confluent Schema Registry for managing Avro, Protobuf, and JSON Schema schemas in Kafka ecosystems.

What I Know

Schema Formats

Avro (Most Popular):

  • Binary serialization format
  • Schema evolution support
  • Smaller message size vs JSON
  • Self-describing with schema ID in header
  • Best for: High-throughput applications, data warehousing

Protobuf (Google Protocol Buffers):

  • Binary serialization
  • Strong typing with.proto files
  • Language-agnostic (Java, Python, Go, C++, etc.)
  • Efficient encoding
  • Best for: Polyglot environments, gRPC integration

JSON Schema:

  • Human-readable text format
  • Easy debugging
  • Widely supported
  • Larger message size
  • Best for: Development, debugging, REST APIs

Compatibility Modes

ModeProducer CanConsumer CanUse Case
BACKWARDRemove fields, add optional fieldsRead old data with new schemaMost common, safe for consumers
FORWARDAdd fields, remove optional fieldsRead new data with old schemaSafe for producers
FULLAdd/remove optional fields onlyBi-directional compatibilityBoth producers and consumers upgrade independently
NONEAny changeMust coordinate upgradesDevelopment only, NOT production
BACKWARD_TRANSITIVEBACKWARD across all versionsRead any old dataStrictest backward compatibility
FORWARD_TRANSITIVEFORWARD across all versionsRead any new dataStrictest forward compatibility
FULL_TRANSITIVEFULL across all versionsComplete bi-directionalStrictest overall

Default: BACKWARD (recommended for production)

Schema Evolution Strategies

Adding Fields:

// V1
{
  "type": "record",
  "name": "User",
  "fields": [
    {"name": "id", "type": "long"},
    {"name": "name", "type": "string"}
  ]
}

// V2 - BACKWARD compatible (added optional field with default)
{
  "type": "record",
  "name": "User",
  "fields": [
    {"name": "id", "type": "long"},
    {"name": "name", "type": "string"},
    {"name": "email", "type": ["null", "string"], "default": null}
  ]
}

Removing Fields (BACKWARD compatible):

// V1
{"name": "address", "type": "string"}

// V2 - Remove field (old consumers will ignore it)
// Field removed from schema

Changing Field Types (Breaking Change!):

// ❌ BREAKING - Cannot change string to int
{"name": "age", "type": "string"} → {"name": "age", "type": "int"}

// ✅ SAFE - Use union types
{"name": "age", "type": ["string", "int"], "default": "unknown"}

When to Use This Skill

Activate me when you need help with:

  • Schema evolution strategies ("How do I evolve my Avro schema?")
  • Compatibility mode selection ("Which compatibility mode for production?")
  • Schema validation ("Validate my Avro schema")
  • Best practices ("Schema Registry best practices")
  • Schema registration ("Register Avro schema with Schema Registry")
  • Debugging schema issues ("Schema compatibility error")
  • Format comparison ("Avro vs Protobuf vs JSON Schema")

Best Practices

1. Always Use Compatible Evolution

DO:

  • Add optional fields with defaults
  • Remove optional fields
  • Use union types for flexibility
  • Test schema changes in staging first

DON'T:

  • Change field types
  • Remove required fields
  • Rename fields (add new + deprecate old)
  • Use NONE compatibility in production

2. Schema Naming Conventions

Hierarchical Namespaces:

com.company.domain.EntityName
com.acme.ecommerce.Order
com.acme.ecommerce.OrderLineItem

Subject Naming (Kafka topics):

  • <topic-name>-value - For record values
  • <topic-name>-key - For record keys
  • Example: orders-value, orders-key

3. Schema Registry Configuration

Producer (with Avro):

const { Kafka } = require('kafkajs');
const { SchemaRegistry } = require('@kafkajs/confluent-schema-registry');

const registry = new SchemaRegistry({
  host: 'https://schema-registry:8081',
  auth: {
    username: 'SR_API_KEY',
    password: 'SR_API_SECRET'
  }
});

// Register schema
const schema = `
{
  "type": "record",
  "name": "User",
  "fields": [
    {"name": "id", "type": "long"},
    {"name": "name", "type": "string"}
  ]
}
`;

const { id } = await registry.register({
  type: SchemaType.AVRO,
  schema
});

// Encode message with schema
const payload = await registry.encode(id, {
  id: 1,
  name: 'John Doe'
});

await producer.send({
  topic: 'users',
  messages: [{ value: payload }]
});

Consumer (with Avro):

const consumer = kafka.consumer({ groupId: 'user-processor' });

await consumer.subscribe({ topic: 'users' });

await consumer.run({
  eachMessage: async ({ message }) => {
    // Decode message (schema ID is in header)
    const decodedMessage = await registry.decode(message.value);
    console.log(decodedMessage); // { id: 1, name: 'John Doe' }
  }
});

4. Schema Validation Workflow

Before Registering:

  1. Validate schema syntax (Avro JSON,.proto, JSON Schema)
  2. Check compatibility with existing versions
  3. Test with sample data
  4. Register in dev/staging first
  5. Deploy to production after validation

CLI Validation:

# Check compatibility (before registering)
curl -X POST http://localhost:8081/compatibility/subjects/users-value/versions/latest \
  -H "Content-Type: application/vnd.schemaregistry.v1+json" \
  -d '{"schema": "{...}"}'

# Register schema
curl -X POST http://localhost:8081/subjects/users-value/versions \
  -H "Content-Type: application/vnd.schemaregistry.v1+json" \
  -d '{"schema": "{...}"}'

Common Issues & Solutions

Issue 1: Schema Compatibility Error

Error:

Schema being registered is incompatible with an earlier schema

Root Cause: Violates compatibility mode (e.g., removed required field with BACKWARD mode)

Solution:

  1. Check current compatibility mode: curl http://localhost:8081/config/users-value
  2. Fix schema to be compatible OR change mode (carefully!)
  3. Validate before registering: curl -X POST http://localhost:8081/compatibility/subjects/users-value/versions/latest \ -d '{"schema": "{...}"}'

Issue 2: Schema Not Found

Error:

Subject 'users-value' not found

Root Cause: Schema not registered yet OR wrong subject name

Solution:

  1. List all subjects: curl http://localhost:8081/subjects
  2. Register schema if missing
  3. Check subject naming convention (<topic>-key or <topic>-value)

Issue 3: Message Deserialization Failed

Error:

Unknown magic byte!

Root Cause: Message not encoded with Schema Registry (missing magic byte + schema ID)

Solution:

  1. Ensure producer uses Schema Registry encoder
  2. Check message format: [magic_byte(1) + schema_id(4) + payload]
  3. Use @kafkajs/confluent-schema-registry library

Schema Evolution Decision Tree

Need to change schema?
├─ Adding new field?
│  ├─ Required field? → Add with default value (BACKWARD)
│  └─ Optional field? → Add with default null (BACKWARD)
│
├─ Removing field?
│  ├─ Required field? → ❌ BREAKING CHANGE (coordinate upgrade)
│  └─ Optional field? → ✅ BACKWARD compatible
│
├─ Changing field type?
│  ├─ Compatible types (e.g., int → long)? → Use union types
│  └─ Incompatible types? → ❌ BREAKING CHANGE (add new field, deprecate old)
│
└─ Renaming field?
   └─ ❌ BREAKING CHANGE → Add new field + mark old as deprecated

Avro vs Protobuf vs JSON Schema Comparison

FeatureAvroProtobufJSON Schema
EncodingBinaryBinaryText (JSON)
Message SizeSmall (90% smaller)Small (80% smaller)Large (baseline)
Human ReadableNoNoYes
Schema EvolutionExcellentGoodFair
Language SupportJava, Python, C++20+ languagesUniversal
PerformanceVery FastVery FastSlower
DebuggingHarderHarderEasy
Best ForData warehousing, ETLPolyglot, gRPCREST APIs, dev

Recommendation:

  • Production: Avro (best balance)
  • Polyglot teams: Protobuf
  • Development/Debugging: JSON Schema

References


Invoke me when you need schema management, evolution strategies, or compatibility guidance!

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

04

需要参考平台分布和安装热度时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

补充不同宿主或平台的使用分布数据

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Claude Code

29.7%
按下载量换算47

Cursor

23.5%
按下载量换算37

Antigravity

15.27%
按下载量换算24

Gemini CLI

12.13%
按下载量换算19

OpenCode

7.34%
按下载量换算12

Codex

3.39%
按下载量换算5

安全审计

暂无安全审计结果可展示。

权限和风险

需要联网

该 Skill 可能需要联网访问来源站点、仓库或外部 API;具体网络访问范围需要结合源码和 README 复核。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。

来源信息

继续浏览同类 Skills