Skip to main content

Installation

View as Markdown

The Confluent Schema Registry plugin is used to generate a catalog from a Confluent Schema Registry and import your schemas into EventCatalog.

You can map your schemas from your Confluent Schema Registry to commands, events in your catalog, and assign these to services and domains.

Installation​

Run the command below to install the EventCatalog Confluent Schema Registry plugin.

"Don't have an EventCatalog project yet?"

If you don't have an EventCatalog project yet, you can follow the instructions in the Getting Started guide.

npm i @eventcatalog/generator-confluent-schema-registry

Configuration​

To use the plugin you need to configure it in your eventcatalog.config.js file.

Add the plugin to the generators array.

In this example we import all schemas from a Confluent Schema Registry.

You can also create topics, and assign schemas to producers/consumers and domains. (see examples).

eventcatalog.config.js
// ...
generators: [
// 1. Import all schemas from a Confluent Schema Registry
[
'@eventcatalog/generator-confluent-schema-registry',
{
// The URL of your Confluent Schema Registry
schemaRegistryUrl: 'http://localhost:8081',
// Do you want to include all versions of a schema? (default: false)
includeAllVersions: true
},
],
];

Configure API keys​

The EventCatalog Confluent Schema Registry plugin is open source under the MIT License and doesn't need a license key. If your config still sets licenseKey or an EVENTCATALOG_LICENSE_KEY_* variable, you can remove it; it's ignored.

The plugin needs your Confluent Schema Registry API keys (found in the Confluent Cloud console) in your environment variables.

Create a .env file in the root, and add your keys to the project.

.env
# Confluent Schema Registry API Keys
CONFLUENT_SCHEMA_REGISTRY_KEY=your-confluent-schema-registry-key
CONFLUENT_SCHEMA_REGISTRY_SECRET=your-confluent-schema-registry-key-secret

Run the plugin​

Run the plugin to import your schemas into EventCatalog.

This command will run the generators in your eventcatalog.config.js file.

npm run generate

View your catalog​

Run your catalog locally to see the changes

npm run dev

Build your catalog for production​

npm run build

Any questions or need help?​

If you get stuck, find an issue or need help, please raise an issue on GitHub or join our Discord community.

You can also find some examples of the plugin in action in our examples repository: eventcatalog/examples.