이 콘텐츠는 선택한 언어로 제공되지 않습니다.
Apicurio Registry User Guide
Manage schemas and APIs in Apicurio Registry 3.1
Abstract
Preface 링크 복사링크가 클립보드에 복사되었습니다!
Providing feedback on Red Hat documentation
We appreciate your feedback on our documentation.
To propose improvements, open a Jira issue and describe your suggested changes. Provide as much detail as possible to enable us to address your request quickly.
Prerequisite
-
You have a Red Hat Customer Portal account. This account enables you to log in to the Red Hat Jira Software instance.
If you do not have an account, you will be prompted to create one.
Procedure
- Click the following link: Create issue.
- In the Summary text box, enter a brief description of the issue.
In the Description text box, provide the following information:
- The URL of the page where you found the issue.
-
A detailed description of the issue.
You can leave the information in any other fields at their default values.
- Click Create to submit the Jira issue to the documentation team.
Thank you for taking the time to provide feedback.
Chapter 1. Introduction to Apicurio Registry 링크 복사링크가 클립보드에 복사되었습니다!
This chapter introduces Apicurio Registry concepts and features and provides details on the supported artifact types that are stored in the registry:
- Section 1.1, “What is Apicurio Registry?”
- Section 1.2, “Schema and API artifacts in Apicurio Registry”
- Section 1.3, “Manage content using the Apicurio Registry web console”
- Section 1.4, “Apicurio Registry REST API for clients”
- Section 1.5, “Apicurio Registry storage options”
- Section 1.6, “Validate Kafka messages using schemas and Java client serializers/deserializers”
- Section 1.7, “Stream data to external systems with Kafka Connect converters”
- Section 1.8, “Apicurio Registry demonstration examples”
- Section 1.9, “Apicurio Registry available distributions”
1.1. What is Apicurio Registry? 링크 복사링크가 클립보드에 복사되었습니다!
Apicurio Registry is a datastore for sharing standard event schemas and API designs across event-driven and API architectures. You can use Apicurio Registry to decouple the structure of your data from your client applications, and to share and manage your data types and API descriptions at runtime using a REST interface.
Client applications can dynamically push or pull the latest schema updates to or from Apicurio Registry at runtime without needing to redeploy. Developer teams can query Apicurio Registry for existing schemas required for services already deployed in production, and can register new schemas required for new services in development.
You can enable client applications to use schemas and API designs stored in Apicurio Registry by specifying the Apicurio Registry URL in your client application code. Apicurio Registry can store schemas used to serialize and deserialize messages, which are referenced from your client applications to ensure that the messages that they send and receive are compatible with those schemas.
Using Apicurio Registry to decouple your data structure from your applications reduces costs by decreasing overall message size, and creates efficiencies by increasing consistent reuse of schemas and API designs across your organization. Apicurio Registry provides a web console to make it easy for developers and administrators to manage registry content.
You can configure optional rules to govern the evolution of your Apicurio Registry content. These include rules to ensure that uploaded content is valid, or is compatible with other versions. Any configured rules must pass before new versions can be uploaded to Apicurio Registry, which ensures that time is not wasted on invalid or incompatible schemas or API designs.
Red Hat build of Apicurio Registry is based on the Apicurio Registry open source community project. For details, see https://github.com/apicurio/apicurio-registry.
Apicurio Registry capabilities
- Multiple payload formats for standard event schema and API specifications such as Apache Avro, JSON Schema, Google Protobuf, AsyncAPI, OpenAPI, and more.
- Pluggable Apicurio Registry storage options for storing content in Apache Kafka or PostgreSQL database.
- Rules for content validation, compatibility, and integrity to govern how Apicurio Registry content evolves over time.
- Apicurio Registry content management using web console, REST API, command line, Maven plug-in, or language SDKs.
- Full Apache Kafka schema registry support, including integration with Kafka Connect for external systems.
- Kafka client serializers/deserializers (SerDes) to validate message types at runtime.
- Compatibility with existing Confluent schema registry client applications.
- Cloud-native Quarkus Java runtime for low memory footprint and fast deployment times.
- Operator-based installation of Apicurio Registry on OpenShift/Kubernetes.
- OpenID Connect (OIDC) authentication using Red Hat build of Keycloak.
1.2. Schema and API artifacts in Apicurio Registry 링크 복사링크가 클립보드에 복사되었습니다!
The items stored in Apicurio Registry, such as event schemas and API designs, are known as registry artifacts. The following shows an example of an Apache Avro schema artifact in JSON format for a simple share price application:
Example Avro schema
When a schema or API design is added as an artifact in Apicurio Registry, client applications can then use that schema or API design to validate that the client messages conform to the correct data structure at runtime.
Artifacts have metadata, both generated and editable. Standard metadata for an artifact includes (but may not be limited to):
1.2.1. Generated or immutable properties 링크 복사링크가 클립보드에 복사되었습니다!
- groupId
- artifactId
- artifactType
- createdOn
- modifiedBy
- modifiedOn
1.2.2. Editable properties 링크 복사링크가 클립보드에 복사되었습니다!
- name
- description
- labels
- owner
Artifact Versions
Every artifact is composed of zero or more _artifact version_s. Only artifact versions have actual content (as well as metadata). These versions represent the evolution of the content of an artifact, and are immutable. You can think of an Artifact as an ordered sequence of Versions, typically with the most recent version representing the "current" schema or API design content.
Artifact Versions have metadata, both generated and editable. Standard metadata for an artifact version includes (but may not be limited to):
1.2.3. Generated or immutable properties 링크 복사링크가 클립보드에 복사되었습니다!
- groupId
- artifactId
- version
- globalId
- contentId
- owner
- createdOn
- modifiedBy
- modifiedOn
1.2.4. Editable properties 링크 복사링크가 클립보드에 복사되었습니다!
- name
- description
- labels
- state
Groups of schemas and APIs
An artifact group is an optional named collection of schema or API artifacts. Each group contains a logically related set of schemas or API designs, typically managed by a single entity, belonging to a particular application or organization.
You can create optional artifact groups when adding your schemas and API designs to organize them in Apicurio Registry. For example, you could create groups to match your development and production application environments, or your sales and engineering organizations.
Schema and API groups can contain multiple artifact types. For example, you could have Protobuf, Avro, JSON Schema, OpenAPI, or AsyncAPI artifacts all in the same group.
Groups have metadata, both generated and editable. Standard metadata for a group includes (but may not be limited to):
1.2.5. Generated or immutable properties 링크 복사링크가 클립보드에 복사되었습니다!
- groupId
- owner
- createdOn
- modifiedBy
- modifiedOn
1.2.6. Editable properties 링크 복사링크가 클립보드에 복사되었습니다!
- description
- labels
You can create schema and API artifacts and groups using the Apicurio Registry web console, REST API, command line, Maven plug-in, or Java client application.
Specifying a group is optional when using the Apicurio Registry web console, and the default group is used automatically. When using the REST API or Maven plug-in, specify the default group in the API path if you do not want to create a unique group.
References to other schemas and APIs
Some Apicurio Registry artifact types can include artifact references from one artifact file to another. You can create efficiencies by defining reusable schema or API components, and then referencing them from multiple locations. For example, you can specify a reference in JSON Schema or OpenAPI using a $ref statement, or in Google Protobuf using an import statement, or in Apache Avro using a nested namespace.
The following example shows a simple Avro schema named TradeKey that includes a reference to another schema named Exchange using a nested namespace:
Tradekey schema with nested Exchange schema
Exchange schema
An artifact reference is stored in Apicurio Registry as a collection of artifact metadata that maps from an artifact type-specific reference to an internal Apicurio Registry reference. Each artifact reference in Apicurio Registry is composed of the following:
- Group ID
- Artifact ID
- Artifact version
- Artifact reference name
You can manage artifact references using the Apicurio Registry core REST API, Maven plug-in, and Java serializers/deserializers (SerDes). Apicurio Registry stores the artifact references along with the artifact content. Apicurio Registry also maintains a collection of all artifact references so you can search them or list all references for a specific artifact.
Supported artifact types
Apicurio Registry currently supports artifact references for the following artifact types only:
- Avro
- Protobuf
- JSON Schema
- OpenAPI
- AsyncAPI
1.3. Manage content using the Apicurio Registry web console 링크 복사링크가 클립보드에 복사되었습니다!
You can use the Apicurio Registry web console to browse and search the schema and API artifacts and optional groups stored in the registry, and to add new schema and API artifacts, groups, and versions. You can search for artifacts by label, name, group, and description. You can view an artifact’s content or its available versions, or download an artifact file locally.
You can also configure optional rules for registry content, globally, for groups, and for each schema and API artifact. These optional rules for content validation and compatibility are applied when new schema and API artifacts or versions are uploaded to the registry.
For more details, see Chapter 12, Apicurio Registry content rule reference.
Figure 1.1. Apicurio Registry web console
The Apicurio Registry web console is available from http://MY_REGISTRY_UI_URL/.
1.4. Apicurio Registry REST API for clients 링크 복사링크가 클립보드에 복사되었습니다!
Client applications can use the Core Registry API v3 to manage the schema and API artifacts in Apicurio Registry. This API provides operations for the following features:
- Admin
-
Export or import Apicurio Registry data in a
.zipfile, and manage logging levels for the Apicurio Registry at runtime. - Groups
- Manage groups of artifacts in Apicurio Registry. You can create groups to better organize your artifacts.
- Group Rules
- Configure rules to govern the content evolution of schemas or API artifacts within a specific group to prevent invalid or incompatible content from being added to Apicurio Registry. Group rules override any global rules configured.
- Artifacts
- Manage schema and API artifacts stored in Apicurio Registry.
- Artifact metadata
- Manage details about a schema or API artifact. You can edit details such as artifact name, description, or labels. Details such as artifact group, and when the artifact was created or modified are read-only.
- Artifact rules
- Configure rules to govern the content evolution of a specific schema or API artifact to prevent invalid or incompatible content from being added to Apicurio Registry. Artifact rules override any group and/or global rules configured.
- Artifact versions
- Manage the sequence of versions that make up the content of a schema or API artifact. You can also manage the lifecycle state of an artifact version: enabled, disabled, or deprecated.
- Global rules
- Configure rules to govern the content evolution of all schema and API artifacts to prevent invalid or incompatible content from being added to Apicurio Registry. Global rules are applied only if an artifact and its group do not have rules configured.
- Search
- Browse or search for schema and API artifacts and versions, for example, by name, group, description, or label.
- System
- Get the Apicurio Registry version and the limits on resources for the Apicurio Registry server.
- Users
- Get the current Apicurio Registry user.
Compatibility with other schema registry REST APIs
Apicurio Registry also provides compatibility with the following schema registries by including implementations of their respective REST APIs:
- Apicurio Registry Core Registry API v2
- Confluent Schema Registry API v7
Applications using Confluent client libraries can use Apicurio Registry as a drop-in replacement. For more details, see Replacing Confluent Schema Registry.
1.5. Apicurio Registry storage options 링크 복사링크가 클립보드에 복사되었습니다!
Apicurio Registry provides the following options for the underlying storage of registry data:
| Storage option | Description |
|---|---|
| PostgreSQL database | PostgreSQL is the recommended data storage option for performance, stability, and data management (backup/restore, and so on) in a production environment. |
| Apache Kafka | Kafka storage is provided for production environments where database management expertise is not available, or where storage in Kafka is a specific requirement. |
1.6. Validate Kafka messages using schemas and Java client serializers/deserializers 링크 복사링크가 클립보드에 복사되었습니다!
Kafka producer applications can use serializers to encode messages that conform to a specific event schema. Kafka consumer applications can then use deserializers to validate that messages have been serialized using the correct schema, based on a specific schema ID.
Figure 1.2. Apicurio Registry and Kafka client SerDes architecture
Apicurio Registry provides Kafka client serializers/deserializers (SerDes) to validate the following message types at runtime:
- Apache Avro
- Google Protobuf
- JSON Schema
The Apicurio Registry Maven repository and source code distributions include the Kafka SerDes implementations for these message types, which Kafka client application developers can use to integrate with Apicurio Registry.
These implementations include custom Java classes for each supported message type, for example, io.apicurio.registry.serde.avro, which client applications can use to pull schemas from Apicurio Registry at runtime for validation.
1.7. Stream data to external systems with Kafka Connect converters 링크 복사링크가 클립보드에 복사되었습니다!
You can use Apicurio Registry with Apache Kafka Connect to stream data between Kafka and external systems. Using Kafka Connect, you can define connectors for different systems to move large volumes of data into and out of Kafka-based systems.
Figure 1.3. Apicurio Registry and Kafka Connect architecture
Apicurio Registry provides the following features for Kafka Connect:
- Storage for Kafka Connect schemas
- Kafka Connect converters for Apache Avro and JSON Schema
- Core Registry API to manage schemas
You can use the Avro and JSON Schema converters to map Kafka Connect schemas into Avro or JSON schemas. These schemas can then serialize message keys and values into the compact Avro binary format or human-readable JSON format. The converted JSON is less verbose because the messages do not contain the schema information, only the schema ID.
Apicurio Registry can manage and track the Avro and JSON schemas used in the Kafka topics. Because the schemas are stored in Apicurio Registry and decoupled from the message content, each message must only include a tiny schema identifier. For an I/O bound system like Kafka, this means more total throughput for producers and consumers.
The Avro and JSON Schema serializers and deserializers (SerDes) provided by Apicurio Registry are used by Kafka producers and consumers in this use case. Kafka consumer applications that you write to consume change events can use the Avro or JSON SerDes to deserialize these events. You can install the Apicurio Registry SerDes in any Kafka-based system and use them along with Kafka Connect, or with a Kafka Connect-based system such as Debezium.
1.8. Apicurio Registry demonstration examples 링크 복사링크가 클립보드에 복사되었습니다!
Apicurio Registry provides open source example applications that demonstrate how to use Apicurio Registry in different use case scenarios. For example, these include storing schemas used by Kafka serializer and deserializer (SerDes) Java classes. These classes fetch the schema from Apicurio Registry for use when producing or consuming operations to serialize, deserialize, or validate the Kafka message payload.
These applications demonstrate use cases such as the following examples:
- Apache Avro Kafka SerDes
- Apache Avro Maven plug-in
- Apache Camel Quarkus and Kafka
- CloudEvents
- Confluent Kafka SerDes
- Custom ID strategy
- Event-driven architecture with Debezium
- Google Protobuf Kafka SerDes
- JSON Schema Kafka SerDes
- REST clients
1.9. Apicurio Registry available distributions 링크 복사링크가 클립보드에 복사되었습니다!
Apicurio Registry provides the following components as part of its distribution.
| Distribution | Location | Release category |
|---|---|---|
| Apicurio Registry Operator | OpenShift web console under Operators → OperatorHub | General Availability |
| Container image for Apicurio Registry Operator | General Availability | |
| Container image for Apicurio Registry (Back End) | General Availability | |
| Container image for Apicurio Registry (User Interface) | General Availability |
| Distribution | Location | Release category |
|---|---|---|
| Example custom resource definitions for installation | General Availability | |
| Maven repository | General Availability | |
| Source code | General Availability | |
| Kafka Connect converters | General Availability |
You must have a subscription for Red Hat Integration and be logged into the Red Hat Customer Portal to access the available Apicurio Registry distributions.
Chapter 2. Apicurio Registry content rules 링크 복사링크가 클립보드에 복사되었습니다!
This chapter introduces the optional rules used to govern Apicurio Registry content and provides details on the available rule configuration:
2.1. Govern Apicurio Registry content using rules 링크 복사링크가 클립보드에 복사되었습니다!
To govern the evolution of artifact content added to Apicurio Registry, you can configure optional rules. All configured global rules, group-specific rules, or artifact-specific rules must pass before a new artifact version can be added to Apicurio Registry. Configured artifact-specific rules override any configured group-specific rules, which in turn override any configured global rules.
The goal of these rules is to prevent invalid content from being added to Apicurio Registry and to control the evolution of an artifact (by e.g. checking the compatibility of a new artifact version against previous versions). For example, content can be invalid for the following reasons:
-
Invalid syntax for a given artifact type, for example,
AVROorPROTOBUF. - Valid syntax, but semantics violate a specification.
- Incompatibility, when new content includes breaking changes relative to the current artifact version.
- Artifact reference integrity, for example, a duplicate or non-existent artifact reference mapping.
You can enable optional content rules using the Apicurio Registry web console, REST API commands, or by using one of the SDKs.
2.1.1. When rules are applied 링크 복사링크가 클립보드에 복사되었습니다!
Rules are applied only when content is added to Apicurio Registry. This includes the following REST operations:
- Adding an artifact
- Adding an artifact version
If a rule is violated, Apicurio Registry returns an HTTP error. The response body includes the violated rule and a message showing what went wrong.
2.1.2. Order of precedence of rules 링크 복사링크가 클립보드에 복사되었습니다!
The order of precedence for artifact-specific and global rules is as follows:
- Artifact-specific rules have the highest priority
- Group-specific rules have the next highest priority
- Global rules have the lowest priority
If a rule is configured at a higher level (e.g. at the global level), but you want that rule to be disabled at a lower level, you must configure the same rule (so that it overrides it) at the lower level and set its rules value to NONE.
2.1.3. How rules work 링크 복사링크가 클립보드에 복사되었습니다!
Each rule has a name and configuration information. Apicurio Registry maintains the list of rules for each artifact, each group, and the list of global rules. Each rule in the list consists of a name and configuration for the rule implementation.
When a rule is executed, it is provided with the content of the current version of the artifact (if one exists) and the new version of the artifact being added. The rule implementation returns either passes or fails depending on whether the artifact passes the rule. If not, Apicurio Registry reports the reason why in an HTTP error response. Some rules might not use the previous version of the content. For example, compatibility rules use previous versions, but syntax or semantic validity rules do not.
2.1.4. Content rule configuration 링크 복사링크가 클립보드에 복사되었습니다!
Administrators can configure Apicurio Registry global rules, group-specific rules, and artifact-specific rules. Developers can configure group-specific and artifact-specific rules only.
Apicurio Registry applies the rules configured for the specific artifact. If no rules are configured at that level, Apicurio Registry applies the group-specific rules. If no rules are configured at the group level, then Apicurio Registry applies the globally configured rules. If no global rules are configured, then no rules are applied.
Configure group and artifact specific rules
You can configure group-specific and artifact-specific rules using the Apicurio Registry web console or REST API. For details, see the following:
Configure global rules
Administrators can configure global rules in several ways:
-
Use the
admin/rulesoperations in the REST API - Use the Apicurio Registry web console
- Set default global rules using Apicurio Registry application properties
Configure default global rules
Administrators can configure Apicurio Registry at the application level to enable or disable global rules. You can configure default global rules at installation time without post-install configuration using the following application property format:
apicurio.rules.global.<ruleName>
apicurio.rules.global.<ruleName>
The following rule names are currently supported:
-
compatibility -
validity -
integrity
The value of the application property must be a valid configuration option that is specific to the rule being configured.
You can configure these application properties as Java system properties or include them in the Quarkus application.properties file. For more details, see the Quarkus documentation.
Chapter 3. Configuring Apicurio Registry security options 링크 복사링크가 클립보드에 복사되었습니다!
This chapter explains how to set configuration options for Apicurio Registry security. For example, this includes authentication in Red Hat build of Keycloak or Microsoft Azure Active Directory and role-based authorization in Apicurio Registry.
- Section 3.1, “Configuring Apicurio Registry authentication and authorization with Red Hat build of Keycloak”
- Section 3.2, “Configuring Apicurio Registry authentication and authorization with Microsoft Azure Active Directory”
- Section 3.3, “Apicurio Registry authentication and authorization configuration options”
For a list of all available configuration options, see Chapter 13, Apicurio Registry configuration reference.
This section explains how to manually configure authentication and authorization options for Apicurio Registry and Red Hat build of Keycloak.
Alternatively, for details on how to configure these settings automatically, see Section 3.1, “Configuring Apicurio Registry authentication and authorization with Red Hat build of Keycloak”.
The Apicurio Registry web console and core REST API support authentication in Red Hat build of Keycloak based on OAuth and OpenID Connect (OIDC). The same Red Hat build of Keycloak realm and users are federated across the Apicurio Registry web console and core REST API using OpenID Connect so that you only require one set of credentials.
Apicurio Registry provides role-based authorization for default admin, write, and read-only user roles. Apicurio Registry provides content-based authorization at the schema or API level, where only the creator of the registry artifact can update or delete it. Apicurio Registry authentication and authorization settings are disabled by default.
Prerequisites
- Red Hat build of Keycloak is installed and running. For more details, see the Red Hat build of Keycloak user documentation.
- Apicurio Registry is installed and running.
Procedure
-
In the Red Hat build of Keycloak Admin Console, create a Red Hat build of Keycloak realm for Apicurio Registry. By default, Apicurio Registry expects a realm name of
registry. For details on creating realms, see the the Red Hat build of Keycloak user documentation. Create a Red Hat build of Keycloak client for the Apicurio Registry API. By default, Apicurio Registry expects the following settings:
-
Client ID:
registry-api -
Client Protocol:
openid-connect Access Type:
bearer-onlyYou can use the defaults for the other client settings.
NoteIf you are using Red Hat build of Keycloak service accounts, the client Access Type must be
confidentialinstead ofbearer-only.
-
Client ID:
Create a Red Hat build of Keycloak client for the Apicurio Registry web console. By default, Apicurio Registry expects the following settings:
-
Client ID:
apicurio-registry -
Client Protocol:
openid-connect -
Access Type:
public -
Valid Redirect URLs:
http://my-registry-url:8080/* Web Origins:
+You can use the defaults for the other client settings.
-
Client ID:
In your Apicurio Registry deployment on OpenShift, set the following Apicurio Registry environment variables to configure authentication using Red Hat build of Keycloak:
Expand Table 3.1. Configuration for Apicurio Registry authentication with Red Hat build of Keycloak Environment variable Description Type Default QUARKUS_OIDC_TENANT_ENABLEDEnables authentication for Apicurio Registry. When set to
true, the environment variables that follow are required for authentication using Red Hat build of Keycloak.String
falseQUARKUS_OIDC_AUTH_SERVER_URLThe URL of the Red Hat build of Keycloak authentication server. For example,
http://localhost:8080.String
-
QUARKUS_OIDC_CLIENT_IDThe client ID for the Apicurio Registry REST API.
String
registry-apiAPICURIO_UI_AUTH_OIDC_CLIENT-IDThe client ID for the Apicurio Registry web console.
String
apicurio-registryTipFor an example of setting environment variables on OpenShift, see Section 4.1.1, “Configuring Apicurio Registry health checks on OpenShift”.
Set the following option to
trueto enable Apicurio Registry user roles in Red Hat build of Keycloak:Expand Table 3.2. Configuration for Apicurio Registry role-based authorization Environment variable Java system property Type Default value APICURIO_AUTH_ROLE-BASED-AUTHORIZATIONapicurio.auth.role-based-authorizationBoolean
falseWhen Apicurio Registry user roles are enabled, you must assign Apicurio Registry users to at least one of the following default user roles in your Red Hat build of Keycloak realm:
Expand Table 3.3. Default user roles for registry authentication and authorization Role Read artifacts Write artifacts Global rules Summary sr-adminYes
Yes
Yes
Full access to all create, read, update, and delete operations.
sr-developerYes
Yes
No
Access to create, read, update, and delete operations, except configuring global rules. This role can configure artifact-specific rules.
sr-readonlyYes
No
No
Access to read and search operations only. This role cannot configure any rules.
Set the following to
trueto enable owner-only authorization for updates to schema and API artifacts in Apicurio Registry:Expand Table 3.4. Configuration for owner-only authorization Environment variable Java system property Type Default value APICURIO_AUTH_OWNER-ONLY-AUTHORIZATION_LIMIT-GROUP-ACCESSapicurio.auth.owner-only-authorization.limit-group-accessBoolean
false
This section explains how to manually configure authentication and authorization options for Apicurio Registry and Microsoft Azure Active Directory (Azure AD).
The Apicurio Registry web console and core REST API support authentication in Azure AD based on OpenID Connect (OIDC) and the OAuth Authorization Code Flow. Apicurio Registry provides role-based authorization for default admin, write, and read-only user roles. Apicurio Registry authentication and authorization settings are disabled by default.
To secure Apicurio Registry with Azure AD, you require a valid directory in Azure AD with specific configuration. This involves registering the Apicurio Registry application in the Azure AD portal with recommended settings and configuring environment variables in Apicurio Registry.
Prerequisites
- Azure AD is installed and running. For more details, see the Microsoft Azure AD user documentation.
- Apicurio Registry is installed and running.
Procedure
- Log in to the Azure AD portal using your email address or GitHub account.
In the navigation menu, select Manage > App registrations > New registration, and complete the following settings:
-
Name: Enter your application name. For example:
apicurio-registry-example - Supported account types: Click Accounts in any organizational directory.
Redirect URI: Select Single-page application from the list, and enter your Apicurio Registry web console application host. For example:
https://test-registry.com/ui/ImportantYou must register your Apicurio Registry application host as a Redirect URI. When logging in, users are redirected from Apicurio Registry to Azure AD for authentication, and you want to send them back to your application afterwards. Azure AD does not allow any redirect URLs that are not registered.
-
Name: Enter your application name. For example:
- Click Register. You can view your app registration details by selecting Manage > App registrations > apicurio-registry-example.
Select Manage > Authentication and ensure that the application is configured with your redirect URLs and tokens as follows:
-
Redirect URIs: For example:
https://test-registry.com/ui/ - Implicit grant and hybrid flows: Click ID tokens (used for implicit and hybrid flows)
-
Redirect URIs: For example:
-
Select Azure AD > Admin > App registrations > Your app > Application (client) ID. For example:
123456a7-b8c9-012d-e3f4-5fg67h8i901 -
Select Azure AD > Admin > App registrations > Your app > Directory (tenant) ID. For example:
https://login.microsoftonline.com/1a2bc34d-567e-89f1-g0hi-1j2kl3m4no56/v2.0 In Apicurio Registry, configure the following environment variables with your Azure AD settings:
Expand Table 3.5. Configuration for Azure AD settings in Apicurio Registry Environment variable Description Setting QUARKUS_OIDC_CLIENT-IDThe client application ID for the Apicurio Registry REST API
Your Azure AD Application (client) ID obtained in step 5. For example:
123456a7-b8c9-012d-e3f4-5fg67h8i901APICURIO_UI_AUTH_OIDC_CLIENT-IDThe client application ID for the Apicurio Registry web console.
Your Azure AD Application (client) ID obtained in step 5. For example:
123456a7-b8c9-012d-e3f4-5fg67h8i901QUARKUS_OIDC_AUTH-SERVER-URLThe URL for authentication in Azure AD.
Your Azure AD Application (tenant) ID obtained in step 6. For example:
https://login.microsoftonline.com/1a2bc34d-567e-89f1-g0hi-1j2kl3m4no56/v2.0.In Apicurio Registry, configure the following environment variables for Apicurio Registry-specific settings:
Expand Table 3.6. Configuration for Apicurio Registry-specific settings Environment variable Description Setting QUARKUS_OIDC_TENANT-ENABLEDEnables authentication for Apicurio Registry.
trueQUARKUS_HTTP_CORS_ORIGINSThe host for your Apicurio Registry deployment for cross-origin resource sharing (CORS).
For example:
https://test-registry.comAPICURIO_UI_AUTH_OIDC_REDIRECT-URIThe host for your Apicurio Registry web console.
For example:
https://test-registry.com/uiAPICURIO_AUTH_ROLE-BASED-AUTHORIZATIONEnables role-based authorization in Apicurio Registry.
trueQUARKUS_OIDC_ROLES_ROLE-CLAIM-PATHThe name of the claim in which Azure AD stores roles.
rolesNoteWhen you enable roles in Apicurio Registry, you must also create the same roles in Azure AD as application roles. The default roles expected by Apicurio Registry are
sr-admin,sr-developer, andsr-readonly.- In Apicurio Registry UI, configure the following environment variables:
| Environment variable | Description | Setting |
|---|---|---|
|
|
| |
|
| Which token to use. Azure AD has non-standard access tokens, so we need to use id tokens. |
|
3.3. Apicurio Registry authentication and authorization configuration options 링크 복사링크가 클립보드에 복사되었습니다!
Apicurio Registry provides authentication options for OpenID Connect with Red Hat build of Keycloak and HTTP basic authentication.
Apicurio Registry provides authorization options for role-based and content-based approaches:
- Role-based authorization for default admin, write, and read-only user roles.
- Content-based authorization for schema or API artifacts, where only the owner of the artifacts or artifact group can update or delete artifacts.
All authentication and authorization options in Apicurio Registry are disabled by default. Before enabling any of these options, you must first set the QUARKUS_OIDC_TENANT_ENABLED option to true.
This chapter provides details on the following configuration options:
- Apicurio Registry authentication by using OpenID Connect with Red Hat build of Keycloak
- Apicurio Registry authentication by using HTTP basic
- Apicurio Registry role-based authorization
- Apicurio Registry owner-only authorization
- Apicurio Registry authenticated read access
- Apicurio Registry anonymous read-only access
Apicurio Registry authentication by using OpenID Connect with Red Hat build of Keycloak
You can set the following environment variables to configure authentication for the Apicurio Registry web console and API with Red Hat build of Keycloak:
| Environment variable | Description | Type | Default |
|---|---|---|---|
|
|
Enables authentication for Apicurio Registry. When set to | String |
|
|
|
The URL of the Red Hat build of Keycloak authentication server. For example, | String | - |
|
| The client ID for the Apicurio Registry REST API. | String |
|
|
| The client ID for the Apicurio Registry web console. | String |
|
|
| Specifies the file path to the TLS trust store used by Quarkus for securing OpenID Connect (OIDC) communications. The trust store can be populated with the trusted certificates needed to establish secure TLS connections with the OIDC provider. | String | - |
|
| The password required to access the TLS trust store file. | String | - |
|
| Enables or disables role-based authorization. | Boolean | False |
Apicurio Registry authentication by using HTTP basic
By default, Apicurio Registry supports authentication by using OpenID Connect. Users or API clients must obtain an access token to make authenticated calls to the Apicurio Registry REST API. However, because some tools do not support OpenID Connect, you can also configure Apicurio Registry to support HTTP basic authentication by setting the following configuration options to true:
| Environment variable | Java system property | Type | Default value |
|---|---|---|---|
|
|
| Boolean |
|
|
|
| Boolean |
|
Apicurio Registry HTTP basic client credentials cache expiry
You can also configure the HTTP basic client credentials cache expiry time. By default, when using HTTP basic authentication, Apicurio Registry caches JWT tokens, and does not issue a new token when there is no need. You can configure the cache expiry time for JWT tokens, which is set to 10 mins by default.
When using Red Hat build of Keycloak, it is best to set this configuration to your Red Hat build of Keycloak JWT expiry time minus one minute. For example, if you have the expiry time set to 5 mins in Red Hat build of Keycloak, you should set the following configuration option to 4 mins:
| Environment variable | Java system property | Type | Default value |
|---|---|---|---|
|
|
| Integer |
|
Apicurio Registry role-based authorization
You can set the following options to true to enable role-based authorization in Apicurio Registry:
| Environment variable | Java system property | Type | Default value |
|---|---|---|---|
|
|
| Boolean |
|
|
|
| Boolean |
|
You can then configure role-based authorization to use roles included in the user’s authentication token (for example, granted when authenticating by using Red Hat build of Keycloak), or to use role mappings managed internally by Apicurio Registry.
Use roles assigned in Red Hat build of Keycloak
To enable using roles assigned by Red Hat build of Keycloak, set the following environment variables:
| Environment variable | Description | Type | Default |
|---|---|---|---|
|
|
When set to | String |
|
|
| The name of the role that indicates a user is an admin. | String |
|
|
| The name of the role that indicates a user is a developer. | String |
|
|
| The name of the role that indicates a user has read-only access. | String |
|
When Apicurio Registry is configured to use roles from Red Hat build of Keycloak, you must assign Apicurio Registry users to at least one of the following user roles in Red Hat build of Keycloak. However, you can configure different user role names by using the environment variables in Table 3.11, “Configuration for Apicurio Registry role-based authorization by using Red Hat build of Keycloak”.
| Role name | Read artifacts | Write artifacts | Global rules | Description |
|---|---|---|---|---|
|
| Yes | Yes | Yes | Full access to all create, read, update, and delete operations. |
|
| Yes | Yes | No | Access to create, read, update, and delete operations, except configuring global rules and import/export. This role can configure artifact-specific rules only. |
|
| Yes | No | No | Access to read and search operations only. This role cannot configure any rules. |
Manage roles directly in Apicurio Registry
To enable using roles managed internally by Apicurio Registry, set the following environment variable:
| Environment variable | Description | Type | Default |
|---|---|---|---|
|
|
When set to | String |
|
When using internally managed role mappings, users can be assigned a role by using the /admin/roleMappings endpoint in the Apicurio Registry REST API. For more details, see Apicurio Registry REST API documentation.
Users can be granted exactly one role: ADMIN, DEVELOPER, or READ_ONLY. Only users with admin privileges can grant access to other users.
Apicurio Registry admin-override configuration
Because there are no default admin users in Apicurio Registry, it is usually helpful to configure another way for users to be identified as admins. You can configure this admin-override feature by using the following environment variables:
| Environment variable | Description | Type | Default |
|---|---|---|---|
|
| Enables the admin-override feature. | String |
|
|
|
Where to look for admin-override information. Only | String |
|
|
|
The type of information used to determine if a user is an admin. Values depend on the value of the FROM variable, for example, | String |
|
|
| The name of the role that indicates a user is an admin. | String |
|
|
| The name of a JWT token claim to use for determining admin-override. | String |
|
|
| The value that the JWT token claim indicated by the CLAIM variable must be for the user to be granted admin-override. | String |
|
For example, you can use this admin-override feature to assign the sr-admin role to a single user in Red Hat build of Keycloak, which grants that user the admin role. That user can then use the /admin/roleMappings REST API (or associated UI) to grant roles to additional users (including additional admins).
Apicurio Registry owner-only authorization
You can set the following options to true to enable owner-only authorization for updates to artifacts or artifact groups in Apicurio Registry:
| Environment variable | Java system property | Type | Default value |
|---|---|---|---|
|
|
| Boolean |
|
|
|
| Boolean |
|
|
|
| Boolean |
|
When owner-only authorization is enabled, only the user who created an artifact can modify or delete that artifact.
When owner-only authorization and group owner-only authorization are both enabled, only the user who created an artifact group has write access to that artifact group, for example, to add or remove artifacts in that group.
Apicurio Registry authenticated read access
When the authenticated read access option is enabled, Apicurio Registry grants at least read-only access to requests from any authenticated user in the same organization, regardless of their user role.
To enable authenticated read access, you must first enable role-based authorization, and then ensure that the following options are set to true:
| Environment variable | Java system property | Type | Default value |
|---|---|---|---|
|
|
| Boolean |
|
|
|
| Boolean |
|
For more details, see the section called “Apicurio Registry role-based authorization”.
Apicurio Registry anonymous read-only access
In addition to the two main types of authorization (role-based and owner-based authorization), Apicurio Registry supports an anonymous read-only access option.
To allow anonymous users, such as REST API calls with no authentication credentials, to make read-only calls to the REST API, set the following options to true:
| Environment variable | Java system property | Type | Default value |
|---|---|---|---|
|
|
| Boolean |
|
|
|
| Boolean |
|
Chapter 4. Configuring your Apicurio Registry deployment 링크 복사링크가 클립보드에 복사되었습니다!
This chapter explains how to set important configuration options for your Apicurio Registry deployment. This includes features such as the Apicurio Registry web console, logging, and health checks:
For a list of all available configuration options, see Chapter 13, Apicurio Registry configuration reference.
4.1. Configuring the Apicurio Registry web console 링크 복사링크가 클립보드에 복사되었습니다!
You can set optional environment variables to configure the Apicurio Registry web console specifically for your deployment environment or to customize its behavior.
Prerequisites
- You have already installed Apicurio Registry.
Configuring the web console deployment environment
When you access the Apicurio Registry web console in your browser, some initial configuration settings are loaded. The following configuration settings are required:
- URL for core Apicurio Registry server REST API v3
Typically the Apicurio Registry operator will automatically configure the UI component with the REST API v3 URL. However, you can override this value by configuring the appropriate environment variable in the UI component deployment configuration.
Procedure
Configure the following environment variables to override the default URL:
-
REGISTRY_API_URL: Specifies the URL for the core Apicurio Registry server REST API v3. For example,https://registry-api.my-domain.com/apis/registry/v3
Configuring the web console in read-only mode
You can configure the Apicurio Registry web console in read-only mode as an optional feature. This mode disables all features in the Apicurio Registry web console that allow users to make changes to registered artifacts. For example, this includes the following:
- Creating a group
- Creating an artifact
- Uploading a new artifact version
- Updating artifact metadata
- Deleting an artifact
Procedure
Configure the following environment variable:
-
REGISTRY_FEATURE_READ_ONLY: Set totrueto enable read-only mode. Defaults tofalse.
4.1.1. Configuring Apicurio Registry health checks on OpenShift 링크 복사링크가 클립보드에 복사되었습니다!
You can configure optional environment variables for liveness and readiness probes to monitor the health of the Apicurio Registry server on OpenShift:
- Liveness probes test if the application can make progress. If the application cannot make progress, OpenShift automatically restarts the failing Pod.
- Readiness probes test if the application is ready to process requests. If the application is not ready, it can become overwhelmed by requests, and OpenShift stops sending requests for the time that the probe fails. If other Pods are OK, they continue to receive requests.
The default values of the liveness and readiness environment variables are designed for most cases and should only be changed if required by your environment. Any changes to the defaults depend on your hardware, network, and amount of data stored. These values should be kept as low as possible to avoid unnecessary overhead.
Prerequisites
- You must have an OpenShift cluster with cluster administrator access.
- You must have already installed Apicurio Registry on OpenShift.
- You must have already installed and configured your chosen Apicurio Registry storage in either AMQ Streams or PostgreSQL.
Procedure
- In the OpenShift Container Platform web console, log in using an account with cluster administrator privileges.
- Click Installed Operators > Apicurio Registry.
- On the ApicurioRegistry tab, click the Operator custom resource for your deployment, for example, example-apicurioregistry.
-
In the main overview page, find the Deployment Name section and the corresponding
DeploymentConfigname for your Apicurio Registry deployment, for example, example-apicurioregistry. -
In the left navigation menu, click Workloads > Deployment Configs, and select your
DeploymentConfigname. Click the Environment tab, and enter your environment variables in the Single values env section, for example:
-
NAME:
LIVENESS_STATUS_RESET -
VALUE:
350
-
NAME:
Click Save at the bottom.
Alternatively, you can perform these steps using the OpenShift
occommand. For more details, see the OpenShift CLI documentation.
4.2. Environment variables for Apicurio Registry health checks 링크 복사링크가 클립보드에 복사되었습니다!
This section describes the available environment variables for Apicurio Registry health checks on OpenShift. These include liveness and readiness probes to monitor the health of the Apicurio Registry server on OpenShift. For an example procedure, see Section 4.1.1, “Configuring Apicurio Registry health checks on OpenShift”.
The following environment variables are provided for reference only. The default values are designed for most cases and should only be changed if required by your environment. Any changes to the defaults depend on your hardware, network, and amount of data stored. These values should be kept as low as possible to avoid unnecessary overhead.
Liveness environment variables
| Name | Description | Type | Default |
|---|---|---|---|
|
| Number of liveness issues or errors that can occur before the liveness probe fails. | Integer |
|
|
| Period in which the threshold number of errors must occur. For example, if this value is 60 and the threshold is 1, the check fails after two errors occur in 1 minute | Seconds |
|
|
| Number of seconds that must elapse without any more errors for the liveness probe to reset to OK status. | Seconds |
|
|
| Comma-separated list of ignored liveness exceptions. | String |
|
Because OpenShift automatically restarts a Pod that fails a liveness check, the liveness settings, unlike readiness settings, do not directly affect behavior of Apicurio Registry on OpenShift.
Readiness environment variables
| Name | Description | Type | Default |
|---|---|---|---|
|
| Number of readiness issues or errors that can occur before the readiness probe fails. | Integer |
|
|
| Period in which the threshold number of errors must occur. For example, if this value is 60 and the threshold is 1, the check fails after two errors occur in 1 minute. | Seconds |
|
|
| Number of seconds that must elapse without any more errors for the liveness probe to reset to OK status. In this case, this means how long the Pod stays not ready, until it returns to normal operation. | Seconds |
|
|
| Readiness tracks the timeout of two operations:
If these operations take more time than the configured timeout, this is counted as a readiness issue or error. This value controls the timeouts for both operations. | Seconds |
|
Chapter 5. Managing Apicurio Registry content using the web console 링크 복사링크가 클립보드에 복사되었습니다!
You can manage schema and API artifacts stored in Apicurio Registry by using the Apicurio Registry web console. This includes uploading and browsing Apicurio Registry content, configuring optional rules for content, and generating client sdk code:
- Section 4.1, “Configuring the Apicurio Registry web console”
- Section 5.1, “Viewing artifacts using the Apicurio Registry web console”
- Section 5.2, “Adding artifacts using the Apicurio Registry web console”
- Section 5.3, “Configuring content rules using the Apicurio Registry web console”
- Section 5.4, “Changing an artifact owner using the Apicurio Registry web console”
- Section 5.5, “Configuring Apicurio Registry settings using the web console”
- Section 5.6, “Exporting and importing data using the Apicurio Registry web console”
5.1. Viewing artifacts using the Apicurio Registry web console 링크 복사링크가 클립보드에 복사되었습니다!
You can use the Apicurio Registry web console to browse the schema and API artifacts stored in Apicurio Registry. This section shows a simple example of viewing Apicurio Registry groups, artifacts, versions, and rules.
Prerequisites
- Apicurio Registry is installed and running in your environment.
You are logged in to the Apicurio Registry web console:
http://MY_REGISTRY_UI_URL/- Artifacts have been added to Apicurio Registry using the web console, command line, Maven plug-in, or a client application.
Procedure
On the Explore tab, browse the list of artifacts stored in Apicurio Registry, or enter a search string to find an artifact. You can select from the list to search by specific criteria such as name, group, labels, or global ID.
Figure 5.1. Artifacts in Apicurio Registry web console
Click an artifact to view the following details:
- Overview: Displays artifact metadata such as artifact ID, name, description, labels, and so on. Also displays rules for validity and compatibility that you can configure for artifact content.
- Versions: Displays a list of all artifact versions. This will be empty unless you chose to upload a first version when you created the artifact.
Branches: Displays a list of branches for the artifact. This will display at least the
latestbranch, but might display other generated branches depending on your configuration.Figure 5.2. Artifact details in Apicurio Registry web console
Click the Versions tab to view a list of all artifact versions. Then click one of the versions in the list, or choose View Version from the Action menu for a version in the list. You will then see the following artifact version details:
- Overview: Displays artifact version metadata such as version name, description, global ID, content ID, labels, and so on. Also displays any comments created for the artifact version.
- Documentation (OpenAPI and AsyncAPI only): Displays automatically-generated REST API documentation.
- Content: Displays a read-only view of the full artifact version content. For JSON content, you can click JSON or YAML to display your preferred format.
References: Displays a read-only view of all artifacts referenced by this artifact version. You can also click View artifacts that reference this artifact version.
Figure 5.3. Artifact version details in Apicurio Registry web console
-
To save the artifact contents to a local file, for example,
my-openapi.jsonormy-protobuf-schema.proto, and click Download.
5.2. Adding artifacts using the Apicurio Registry web console 링크 복사링크가 클립보드에 복사되었습니다!
You can use the Apicurio Registry web console to upload schema and API artifacts to Apicurio Registry. This section shows simple examples of creating Apicurio Registry artifacts and adding new artifact versions.
Prerequisites
- Apicurio Registry is installed and running in your environment.
You are logged in to the Apicurio Registry web console:
http://MY_REGISTRY_UI_URL/
Procedure
On the Explore tab, click Create artifact, and complete the Create artifact wizard:
NoteYou can create a placeholder artifact without content, but you must specify the artifact type, as Apicurio Registry cannot automatically detect the content type. Creating a placeholder allows you create rules first and add content later.
Specify the Artifact Coordinates and click Next:
-
Group ID & Artifact ID: Use the default empty settings to automatically generate an artifact ID and add the artifact to the
defaultartifact group. Alternatively, you can enter an optional artifact group or artifact ID. - Type: Use the default Auto-Detect setting to automatically detect the artifact type (not allowed if creating an empty artifact), or select the artifact type from the list, for example, Avro Schema or OpenAPI. You must manually select the Kafka Connect Schema artifact type, which cannot be automatically detected.
-
Group ID & Artifact ID: Use the default empty settings to automatically generate an artifact ID and add the artifact to the
Specify the Artifact Metadata and click Next:
- Name: Enter an optional friendly name for the new artifact.
- Description: Enter an optional description for the new artifact.
- Labels: Optionally add one or more label (name/value pair) for the new artifact.
Specify the Version Content and click Next:
- Version Number: Optionally add a version string if creating a first version.
Content: Specify the content using either of the following options:
-
From file: Click Browse, and select a file, or drag and drop a file. For example,
my-openapi.jsonormy-schema.proto. Alternatively, you can enter the file contents in the text box. -
From URL: Enter a valid and accessible URL, and click Fetch. For example:
https://petstore3.swagger.io/api/v3/openapi.json.
-
From file: Click Browse, and select a file, or drag and drop a file. For example,
Specify the Version Metadata:
- Name: Enter an optional friendly name for the first artifact version.
- Description: Enter an optional description for the first artifact version.
- Labels: Optionally add one or more label (name/value pair) for the first artifact version.
Click Create and view the artifact details:
- Overview: Displays artifact metadata such as artifact ID, name, description, labels, and so on. Also displays rules for validity and compatibility that you can configure for artifact content.
- Versions: Displays a list of all artifact versions. This will be empty unless you chose to upload a first version when you created the artifact.
Branches: Displays a list of branches for the artifact. This will display at least the
latestbranch, but might display other generated branches depending on your configuration.The following example shows an example Apache Avro artifact:
Figure 5.4. Artifact details in Apicurio Registry web console
On the Overview tab, click the Edit pencil icon to edit artifact metadata such as name or description.
You can also add zero or more labels (name + value) for categorizing and searching purposes. To add labels, perform the following steps:
- Click Add label.
- Enter the key name and the value (optional).
- Repeat the first two steps to add multiple properties.
- Click Save.
-
To save the artifact contents to a local file, for example,
my-protobuf-schema.protoormy-openapi.json, click Download at the end of the page. To add a new artifact version, switch to the Versions tab and then click Create version in the toolbar. From there, provide the following information:
- Version Number: Optionally add a version string for the new version.
Content: Specify the content using either of the following options:
-
From file: Click Browse, and select a file, or drag and drop a file. For example,
my-openapi.jsonormy-schema.proto. Alternatively, you can enter the file contents in the text box. -
From URL: Enter a valid and accessible URL, and click Fetch. For example:
https://petstore3.swagger.io/api/v3/openapi.json.
-
From file: Click Browse, and select a file, or drag and drop a file. For example,
- Now you can click the Create button to create the new version.
To delete an artifact, click Delete in the page header.
WarningDeleting an artifact deletes the artifact and all of its versions, and cannot be undone.
5.3. Configuring content rules using the Apicurio Registry web console 링크 복사링크가 클립보드에 복사되었습니다!
You can use the Apicurio Registry web console to configure optional rules to prevent invalid or incompatible content from being added to Apicurio Registry. All configured artifact-specific, group-specific, or global rules must pass before a new artifact version can be uploaded to Apicurio Registry. Configured artifact-specific rules override any configured group-specific rules, which in turn override any global rules. This section shows a simple example of configuring global, group-specific, and artifact-specific rules.
Prerequisites
- Apicurio Registry is installed and running in your environment.
You are logged in to the Apicurio Registry web console:
http://MY_REGISTRY_UI_URL/- Artifacts have been added to Apicurio Registry using the web console, command line, Maven plug-in, or a Java client application.
- When role-based authorization is enabled, you have administrator access for global rules configuration.
Procedure (group-specific rules)
- On the Explore tab, browse the list of groups in Apicurio Registry by selecting Groups from the "Search for" menu.
- Click a group to view its details and content rules.
In Group-specific rules, click Enable to configure a validity, compatibility, or integrity rule for all artifact content in the group, and select the appropriate rule configuration from the list. For example, for Validity rule, select Full.
Figure 5.5. Group-specific rules in Apicurio Registry web console
Procedure (artifact-specific rules)
- On the Explore tab, browse the list of artifacts in Apicurio Registry by selecting Artifacts from the "Search for" menu.
- Click an artifact from the list to view its details and content rules.
In Artifact-specific rules, click Enable to configure a validity, compatibility, or integrity rule for artifact content, and select the appropriate rule configuration from the list. For example, for Validity rule, select Full.
Figure 5.6. Artifact content rules in Apicurio Registry web console
Procedure (global rules)
- To access global rules, click the Global rules tab.
Click Enable to configure global validity, compatibility, or integrity rules for all artifact content, and select the appropriate rule configuration from the list.
Figure 5.7. Artifact content rules in Apicurio Registry web console
To disable an artifact-specific, group-specific, or global rule, click the trash icon next to the rule. If you do this, and the rule is configured at a higher level (e.g. Global), then the higher level rule configuration will once again be applied.
5.4. Changing an artifact owner using the Apicurio Registry web console 링크 복사링크가 클립보드에 복사되었습니다!
As an administrator or as an owner of a schema or API artifact, you can use the Apicurio Registry web console to change the artifact owner to another user account.
For example, this feature is useful if the Artifact owner-only authorization option is set for the Apicurio Registry on the Settings tab so that only owners or administrators can modify artifacts. You might need to change owner if the owner user leaves the organization or the owner account is deleted. Or if you simply need to transition modification authorization to a new user.
The Artifact owner-only authorization setting and the artifact Owner field are displayed only if authentication was enabled when the Apicurio Registry was deployed. For more details, see
Installing and deploying Red Hat build of Apicurio Registry on OpenShift.
Prerequisites
- The Apicurio Registry is deployed and the artifact is created.
You are logged in to the Apicurio Registry web console as the artifact’s current owner or as an administrator:
http://MY_REGISTRY_UI_URL/
Procedure
- On the Explore tab, browse the list of artifacts stored in Apicurio Registry, or enter a search string to find the artifact. You can select from the list to search by criteria such as name, group, labels, or global ID.
- Click the artifact that you want to reassign.
- In the Overview section, click the pencil icon next to the Owner field.
- In the New owner field, select or enter an account name.
- Click Change owner.
5.5. Configuring Apicurio Registry settings using the web console 링크 복사링크가 클립보드에 복사되었습니다!
As an administrator, you can use the Apicurio Registry web console to configure dynamic settings for Apicurio Registry at runtime. You can manage configuration options for features such as authentication, authorization, and API compatibility.
Authentication and authorization settings are only displayed in the web console if authentication was already enabled when the Apicurio Registry was deployed. For more details, see Chapter 4, Configuring your Apicurio Registry deployment.
Prerequisites
- The Apicurio Registry is already deployed.
You are logged in to the Apicurio Registry web console with administrator access:
http://MY_REGISTRY_UI_URL/
Procedure
- In the Apicurio Registry web console, click the Settings tab.
Select the settings that you want to configure for Apicurio Registry:
Expand Table 5.1. Authentication settings Setting Description HTTP basic authentication
Displayed only when authentication is already enabled (during deployment). When selected, Apicurio Registry users can authenticate using HTTP basic authentication, in addition to OAuth. Not selected by default.
Expand Table 5.2. Authorization settings Setting Description Anonymous read access
Displayed only when authentication is already enabled. When selected, Apicurio Registry grants read-only access to requests from anonymous users without any credentials. This setting is useful if you want to use Apicurio Registry to publish schemas or APIs externally. Not selected by default.
Artifact owner-only authorization
Displayed only when authentication is already enabled. When selected, only the user who created an artifact can modify that artifact. Not selected by default.
Artifact group owner-only authorization
Displayed only when authentication is already enabled and Artifact owner-only authorization is also enabled. When selected, only the user who created an artifact group has write access to that artifact group, for example, to add or remove artifacts in that group. Not selected by default.
Authenticated read access
Displayed only when authentication is already enabled. When selected, Apicurio Registry grants at least read-only access to requests from any authenticated user regardless of their user role. Not selected by default.
Expand Table 5.3. Compatibility settings Setting Description Canonical hash mode (compatibility API)
When selected, the Schema Registry compatibility API uses the canonical hash instead of the regular hash of the content.
Legacy ID mode (compatibility API)
When selected, the Confluent Schema Registry compatibility API uses
globalIdinstead ofcontentIdas an artifact identifier.Maximum number of Subjects returned (compatibility API)
Determines the maximum number of Subjects that will be returned by the Confluent Schema Registry compatibility API (for the
/subjectsendpoint).Expand Table 5.4. Web console settings Setting Description Download link expiry
The number of seconds that a generated link to a
.zipdownload file is active before expiring for security reasons, for example, when exporting artifact data from Apicurio Registry. Defaults to 30 seconds.Expand Table 5.5. Semantic versioning settings Setting Description Automatically create semver branches
When enabled, automatically create or update branches for major ('A.x') and minor ('A.B.x') artifact versions.
Ensure all version numbers are 'semver' compatible
When enabled, validate that all artifact versions conform to Semantic Versioning 2 format (https://semver.org).
Expand Table 5.6. Additional properties Setting Description Delete artifact
When selected, users are permitted to delete artifacts in Apicurio Registry by using the Core Registry API. Not selected by default.
Delete artifact version
When selected, users are permitted to delete artifact versions in Apicurio Registry by using the Core Registry API. Not selected by default.
Delete group
When selected, users are permitted to delete groups in Apicurio Registry by using the Core Registry API. Not selected by default.
Storage read-only mode
When selected, Registry will return an error for operations that write to the storage (this property excepted). Not enabled by default.
5.6. Exporting and importing data using the Apicurio Registry web console 링크 복사링크가 클립보드에 복사되었습니다!
As an administrator, you can use the Apicurio Registry web console to export data from one Apicurio Registry instance, and import this data into another Apicurio Registry instance. You can use this feature to easily migrate data between different instances.
The following example shows how to export and import existing data in a .zip file from one Apicurio Registry instance to another instance. All the artifact data contained in the Apicurio Registry instance is exported in the .zip file.
Prerequisites
Apicurio Registry instances have been created as follows:
- The source instance that you are exporting from contains at least one schema or API artifact
- The target instance that you are importing into is empty to preserve unique IDs
You are logged into the Apicurio Registry web console with administrator access:
http://MY_REGISTRY_UI_URL/
Procedure
- In the web console for the source Apicurio Registry instance, view the Explore tab.
-
Click the additional actions icon (three vertical dots) next to Create artifact in the toolbar, and select Export all (as .ZIP) to export the data for this Apicurio Registry instance to a
.zipdownload file. - In the web console for the target Apicurio Registry instance, view the Explore tab.
- Click the additional actions icon (three vertical dots) next to Create artifact in the toolbar, and select Import from .ZIP.
-
Drag and drop or browse to the
.zipdownload file that you exported earlier. - Click Import and wait for the data to be imported.
Chapter 6. Managing Apicurio Registry content using the REST API 링크 복사링크가 클립보드에 복사되었습니다!
Client applications can use Apicurio Registry REST API operations to manage schema and API artifacts in Apicurio Registry, for example, in a CI/CD pipeline deployed in production. The Core Registry API v3 provides operations for artifacts, versions, metadata, and rules stored in Apicurio Registry. For detailed information, see the Apicurio Registry REST API documentation.
This chapter shows examples of how to use the Core Registry API v3 to perform the following tasks:
- Section 6.1, “Managing schema and API artifacts using Apicurio Registry REST API commands”
- Section 6.2, “Managing schema and API artifact versions using Apicurio Registry REST API commands”
- Section 6.3, “Managing schema and API artifact references using Apicurio Registry REST API commands”
- Section 6.4, “Exporting and importing registry data using Apicurio Registry REST API commands”
Prerequisites
6.1. Managing schema and API artifacts using Apicurio Registry REST API commands 링크 복사링크가 클립보드에 복사되었습니다!
This section shows a simple curl-based example of using the Core Registry API v3 to add and retrieve a simple schema artifact in Apicurio Registry.
Prerequisites
- Apicurio Registry is installed and running in your environment.
Procedure
Add an artifact to Apicurio Registry using the
/groups/{groupId}/artifactsoperation. The following examplecurlcommand adds a simple schema artifact for a share price application:Copy to Clipboard Copied! Toggle word wrap Toggle overflow -
This example adds an Apache Avro schema artifact with an artifact ID of
share-price. If you do not specify a unique artifact ID, Apicurio Registry generates one automatically as a UUID. -
MY-REGISTRY-URLis the host name on which Apicurio Registry is deployed. For example:http://localhost:8080. -
This example specifies a group ID of
my-groupin the API path. If you do not specify a unique group ID, you must specify../groups/defaultin the API path.
-
This example adds an Apache Avro schema artifact with an artifact ID of
Verify that the response includes the expected JSON body to confirm that the artifact was added. For example:
{"artifact":{"owner":"","createdOn":"2024-09-26T17:24:21Z","modifiedBy":"","modifiedOn":"2024-09-26T17:24:21Z","artifactType":"AVRO","groupId":"my-group","artifactId":"share-price"},"version":{"version":"1","owner":"","createdOn":"2024-09-26T17:24:21Z","artifactType":"AVRO","globalId":2,"state":"ENABLED","groupId":"my-group","contentId":2,"artifactId":"share-price"}}{"artifact":{"owner":"","createdOn":"2024-09-26T17:24:21Z","modifiedBy":"","modifiedOn":"2024-09-26T17:24:21Z","artifactType":"AVRO","groupId":"my-group","artifactId":"share-price"},"version":{"version":"1","owner":"","createdOn":"2024-09-26T17:24:21Z","artifactType":"AVRO","globalId":2,"state":"ENABLED","groupId":"my-group","contentId":2,"artifactId":"share-price"}}Copy to Clipboard Copied! Toggle word wrap Toggle overflow -
No version was specified when adding the artifact, so the default version
1is created automatically. -
This was the second artifact added to Apicurio Registry, so the global ID and content ID have a value of
2.
-
No version was specified when adding the artifact, so the default version
Retrieve the artifact version content from Apicurio Registry using its artifact ID in the API path. In this example, the specified ID is
share-price:curl -H "Authorization: Bearer $ACCESS_TOKEN" \ MY-REGISTRY-URL/apis/registry/v3/groups/my-group/artifacts/share-price/versions/1/content
$ curl -H "Authorization: Bearer $ACCESS_TOKEN" \ MY-REGISTRY-URL/apis/registry/v3/groups/my-group/artifacts/share-price/versions/1/content {"type":"record","name":"price","namespace":"com.example", "fields":[{"name":"symbol","type":"string"},{"name":"price","type":"string"}]}Copy to Clipboard Copied! Toggle word wrap Toggle overflow
6.2. Managing schema and API artifact versions using Apicurio Registry REST API commands 링크 복사링크가 클립보드에 복사되었습니다!
If you do not specify an artifact version number when adding schema and API artifacts using the Core Registry API v3, Apicurio Registry generates a version number automatically. The default version when creating a new artifact is 1.
Apicurio Registry also supports custom versioning where you can specify a version number when creating the artifact or artifact version. Specifying a custom version value overrides the default version normally assigned when creating an artifact or artifact version. You can then use this version value when executing REST API operations that require a version number.
This section shows a simple curl-based example of using the Core Registry API v3 to add and retrieve a custom Apache Avro schema version in Apicurio Registry. You can specify custom version numbers to create artifacts, or to add artifact versions.
Prerequisites
- Apicurio Registry is installed and running in your environment.
Procedure
Add an artifact version in the registry using the
/groups/{groupId}/artifactsoperation. The following examplecurlcommand adds a simple artifact for a share price application:Copy to Clipboard Copied! Toggle word wrap Toggle overflow -
This example adds an Avro schema artifact with an artifact ID of
my-share-priceand version of1.1.1. If you do not specify a version, Apicurio Registry automatically generates a default version of1. -
MY-REGISTRY-URLis the host name on which Apicurio Registry is deployed. For example:http://localhost:8080. -
This example specifies a group ID of
my-groupin the API path. If you do not specify a unique group ID, you must specify../groups/defaultin the API path.
-
This example adds an Avro schema artifact with an artifact ID of
Verify that the response includes the expected JSON body to confirm that the custom artifact version was added. For example:
{"artifact":{"owner":"","createdOn":"2024-09-26T17:06:21Z","modifiedBy":"","modifiedOn":"2024-09-26T17:06:21Z","artifactType":"AVRO","groupId":"my-group","artifactId":"my-share-price"},"version":{"version":"1.1.1","owner":"","createdOn":"2024-09-26T17:06:21Z","artifactType":"AVRO","globalId":4,"state":"ENABLED","groupId":"my-group","contentId":4,"artifactId":"my-share-price"}}{"artifact":{"owner":"","createdOn":"2024-09-26T17:06:21Z","modifiedBy":"","modifiedOn":"2024-09-26T17:06:21Z","artifactType":"AVRO","groupId":"my-group","artifactId":"my-share-price"},"version":{"version":"1.1.1","owner":"","createdOn":"2024-09-26T17:06:21Z","artifactType":"AVRO","globalId":4,"state":"ENABLED","groupId":"my-group","contentId":4,"artifactId":"my-share-price"}}Copy to Clipboard Copied! Toggle word wrap Toggle overflow -
A custom version of
1.1.1was specified when adding the artifact. -
This was the fourth artifact added to the registry, so the global ID and content ID have a value of
4.
-
A custom version of
Retrieve the artifact content from the registry using its artifact ID and version in the API path. In this example, the specified ID is
my-share-priceand the version is1.1.1:curl -H "Authorization: Bearer $ACCESS_TOKEN" \ MY-REGISTRY-URL/apis/registry/v3/groups/my-group/artifacts/my-share-price/versions/1.1.1/content$ curl -H "Authorization: Bearer $ACCESS_TOKEN" \ MY-REGISTRY-URL/apis/registry/v3/groups/my-group/artifacts/my-share-price/versions/1.1.1/content {"type":"record","name":"price","namespace":"com.example", "fields":[{"name":"symbol","type":"string"},{"name":"price","type":"string"}]}Copy to Clipboard Copied! Toggle word wrap Toggle overflow
6.3. Managing schema and API artifact references using Apicurio Registry REST API commands 링크 복사링크가 클립보드에 복사되었습니다!
Some Apicurio Registry artifact types can include artifact references from one artifact file to another. You can create efficiencies by defining reusable schema or API artifacts, and then referencing them from multiple locations in artifact references.
The following artifact types support artifact references:
- Apache Avro
- Google Protobuf
- JSON Schema
- OpenAPI
- AsyncAPI
This section shows a simple curl-based example of using the Core Registry API v3 to add and retrieve an artifact reference to a simple Avro schema artifact in Apicurio Registry.
This example first creates a schema artifact named ItemId:
ItemId schema
This example then creates a schema artifact named Item, which includes a reference to the nested ItemId artifact.
Item schema with nested ItemId schema
Prerequisites
- Apicurio Registry is installed and running in your environment.
Procedure
Add the
ItemIdschema artifact that you want to create the nested artifact reference to using the/groups/{groupId}/artifactsoperation:curl -X POST MY-REGISTRY-URL/apis/registry/v3/groups/my-group/artifacts \ -H "Content-Type: application/json" \ -H "Authorization: Bearer $ACCESS_TOKEN" \ --data '{"artifactId":"ItemId","artifactType":"AVRO","firstVersion":{"version":"1.0.0","content":{"content":"{\"namespace\":\"com.example.common\",\"name\":\"ItemId\",\"type\":\"record\",\"fields\":[{\"name\":\"id\",\"type\":\"int\"}]}","contentType":"application/json"}}}'$ curl -X POST MY-REGISTRY-URL/apis/registry/v3/groups/my-group/artifacts \ -H "Content-Type: application/json" \ -H "Authorization: Bearer $ACCESS_TOKEN" \ --data '{"artifactId":"ItemId","artifactType":"AVRO","firstVersion":{"version":"1.0.0","content":{"content":"{\"namespace\":\"com.example.common\",\"name\":\"ItemId\",\"type\":\"record\",\"fields\":[{\"name\":\"id\",\"type\":\"int\"}]}","contentType":"application/json"}}}'Copy to Clipboard Copied! Toggle word wrap Toggle overflow -
This example adds an Avro schema artifact with an artifact ID of
ItemId. If you do not specify a unique artifact ID, Apicurio Registry generates one automatically as a UUID. -
MY-REGISTRY-URLis the host name on which Apicurio Registry is deployed. For example:http://localhost:8080. -
This example specifies a group ID of
my-groupin the API path. If you do not specify a unique group ID, you must specify../groups/defaultin the API path.
-
This example adds an Avro schema artifact with an artifact ID of
Verify that the response includes the expected JSON body to confirm that the artifact was added. For example:
{"artifact":{"owner":"","createdOn":"2024-09-26T16:27:38Z","modifiedBy":"","modifiedOn":"2024-09-26T16:27:38Z","artifactType":"AVRO","groupId":"my-group","artifactId":"ItemId"},"version":{"version":"1.0.0","owner":"","createdOn":"2024-09-26T16:27:38Z","artifactType":"AVRO","globalId":2,"state":"ENABLED","groupId":"my-group","contentId":2,"artifactId":"ItemId"}}{"artifact":{"owner":"","createdOn":"2024-09-26T16:27:38Z","modifiedBy":"","modifiedOn":"2024-09-26T16:27:38Z","artifactType":"AVRO","groupId":"my-group","artifactId":"ItemId"},"version":{"version":"1.0.0","owner":"","createdOn":"2024-09-26T16:27:38Z","artifactType":"AVRO","globalId":2,"state":"ENABLED","groupId":"my-group","contentId":2,"artifactId":"ItemId"}}Copy to Clipboard Copied! Toggle word wrap Toggle overflow Add the
Itemschema artifact that includes the artifact reference to theItemIdschema using the/groups/{groupId}/artifactsoperation:Copy to Clipboard Copied! Toggle word wrap Toggle overflow Verify that the response includes the expected JSON body to confirm that the artifact was created with the reference. For example:
{"artifact":{"owner":"","createdOn":"2024-09-26T16:28:45Z","modifiedBy":"","modifiedOn":"2024-09-26T16:28:45Z","artifactType":"AVRO","groupId":"my-group","artifactId":"Item"},"version":{"version":"1.0.0","owner":"","createdOn":"2024-09-26T16:28:45Z","artifactType":"AVRO","globalId":3,"state":"ENABLED","groupId":"my-group","contentId":3,"artifactId":"Item"}}{"artifact":{"owner":"","createdOn":"2024-09-26T16:28:45Z","modifiedBy":"","modifiedOn":"2024-09-26T16:28:45Z","artifactType":"AVRO","groupId":"my-group","artifactId":"Item"},"version":{"version":"1.0.0","owner":"","createdOn":"2024-09-26T16:28:45Z","artifactType":"AVRO","globalId":3,"state":"ENABLED","groupId":"my-group","contentId":3,"artifactId":"Item"}}Copy to Clipboard Copied! Toggle word wrap Toggle overflow Retrieve the artifact reference from Apicurio Registry by specifying the coordinates of the artifact that includes the reference:
curl -H "Authorization: Bearer $ACCESS_TOKEN" MY-REGISTRY-URL/apis/registry/v3/groups/my-group/artifacts/Item/versions/1.0.0/references
$ curl -H "Authorization: Bearer $ACCESS_TOKEN" MY-REGISTRY-URL/apis/registry/v3/groups/my-group/artifacts/Item/versions/1.0.0/referencesCopy to Clipboard Copied! Toggle word wrap Toggle overflow Verify that the response includes the expected JSON body for this artifact reference. For example:
[{"groupId":"my-group","artifactId":"ItemId","version":"1.0.0","name":"com.example.common.ItemId"}][{"groupId":"my-group","artifactId":"ItemId","version":"1.0.0","name":"com.example.common.ItemId"}]Copy to Clipboard Copied! Toggle word wrap Toggle overflow
Dereference
There are some situations where having an artifact’s content with the referenced content inlined might be helpful. For those situations, the Core Registry API v3 supports the references parameter in certain operations.
This support is currently implemented for Avro, JSON Schema, Protobuf, OpenAPI and AsyncAPI when the parameter is present in a particular API operation. The parameter is not supported in other schema types.
Retrieve the dereferenced (inlined) schema content:
curl -H "Authorization: Bearer $ACCESS_TOKEN" MY-REGISTRY-URL/apis/registry/v3/groups/my-group/artifacts/Item/versions/1.0.0/content?references=DEREFERENCE
$ curl -H "Authorization: Bearer $ACCESS_TOKEN" MY-REGISTRY-URL/apis/registry/v3/groups/my-group/artifacts/Item/versions/1.0.0/content?references=DEREFERENCECopy to Clipboard Copied! Toggle word wrap Toggle overflow Verify that the response includes the expected JSON body for this artifact content with the references inlined. For example:
{"type":"record","name":"Item","namespace":"com.example.common","fields":[{"name":"itemId","type":{"type":"record","name":"ItemId","fields":[{"name":"id","type":"int"}]}}]}{"type":"record","name":"Item","namespace":"com.example.common","fields":[{"name":"itemId","type":{"type":"record","name":"ItemId","fields":[{"name":"id","type":"int"}]}}]}Copy to Clipboard Copied! Toggle word wrap Toggle overflow
This support is currently implemented only for Avro, Protobuf, OpenAPI, AsyncAPI, and JSON Schema artifacts when the dereference parameter is specified in the API operation. This parameter is not supported for any other artifact types.
For Protobuf artifacts, dereferencing content is supported only when all the schemas belong to the same package.
Circular dependencies are allowed by some artifact types (e.g. JSON Schema) but are not supported by Apicurio Registry.
6.4. Exporting and importing registry data using Apicurio Registry REST API commands 링크 복사링크가 클립보드에 복사되었습니다!
As an administrator, you can use the Core Registry API v3 to export data from one Apicurio Registry instance and import into another Apicurio Registry instance, so you can migrate data between different instances.
This section shows a simple curl-based example of using the Core Registry API v3 to export and import existing data in .zip format from one Apicurio Registry instance to another. All the artifact data contained in the Apicurio Registry instance is exported in the .zip file.
Prerequisites
- Apicurio Registry is installed and running in your environment.
Apicurio Registry instances have been created:
- The source instance that you want to export data from contains at least one schema or API artifact.
- The target instance that you want to import data into is empty to preserve unique IDs.
Procedure
Export the Apicurio Registry data from your existing source Apicurio Registry instance:
curl MY-REGISTRY-URL/apis/registry/v3/admin/export \ -H "Authorization: Bearer $ACCESS_TOKEN" \ --output my-registry-data.zip
$ curl MY-REGISTRY-URL/apis/registry/v3/admin/export \ -H "Authorization: Bearer $ACCESS_TOKEN" \ --output my-registry-data.zipCopy to Clipboard Copied! Toggle word wrap Toggle overflow MY-REGISTRY-URLis the host name on which the source Apicurio Registry is deployed. For example:http://my-source-registry:8080.Import the registry data into your target Apicurio Registry instance:
curl -X POST "MY-REGISTRY-URL/apis/registry/v3/admin/import" \ -H "Content-Type: application/zip" -H "Authorization: Bearer $ACCESS_TOKEN" \ --data-binary @my-registry-data.zip
$ curl -X POST "MY-REGISTRY-URL/apis/registry/v3/admin/import" \ -H "Content-Type: application/zip" -H "Authorization: Bearer $ACCESS_TOKEN" \ --data-binary @my-registry-data.zipCopy to Clipboard Copied! Toggle word wrap Toggle overflow MY-REGISTRY-URLis the host name on which the target Apicurio Registry is deployed. For example:http://my-target-registry:8080.
Chapter 7. Managing Apicurio Registry content using the Maven plug-in 링크 복사링크가 클립보드에 복사되었습니다!
When developing client applications, you can use the Apicurio Registry Maven plug-in to manage schema and API artifacts stored in Apicurio Registry:
- Section 7.1, “Adding schema and API artifacts using the Maven plug-in”
- Section 7.2, “Downloading schema and API artifacts using the Maven plug-in”
- Section 7.3, “Testing schema and API artifacts using the Maven plug-in”
- Section 7.4, “Adding artifact references manually using the Apicurio Registry Maven plug-in”
- Section 7.5, “Adding artifact references automatically using the Apicurio Registry Maven plug-in”
Prerequisites
- Apicurio Registry is installed and running in your environment.
- Apache Maven is installed and configured in your environment.
7.1. Adding schema and API artifacts using the Maven plug-in 링크 복사링크가 클립보드에 복사되었습니다!
The most common use case for the Maven plug-in is adding artifacts during a build of your client application. You can accomplish this by using the register execution goal.
Prerequisites
- You have created a Maven project for your client application. For more details, see the Apache Maven documentation.
Procedure
Update your Maven
pom.xmlfile to use theapicurio-registry-maven-pluginto register an artifact. The following example shows registering Apache Avro and GraphQL schemas:Copy to Clipboard Copied! Toggle word wrap Toggle overflow - 1
- Specify
registeras the execution goal to upload the schema artifact to Apicurio Registry. - 2
- Specify the Apicurio Registry URL with the
../apis/registry/v3endpoint. - 3
- If authentication is required, you can specify your authentication server and client credentials.
- 4
- Specify the Apicurio Registry artifact group ID. You can specify the
defaultgroup if you do not want to use a unique group ID. - 5
- You can register multiple artifacts using the specified group ID, artifact ID, and location.
-
Build your Maven project, for example, by using the
mvn packagecommand.
7.2. Downloading schema and API artifacts using the Maven plug-in 링크 복사링크가 클립보드에 복사되었습니다!
You can use the Maven plug-in to download artifacts from Apicurio Registry. This is often useful, for example, when generating code from a registered schema.
Prerequisites
- You have created a Maven project for your client application. For more details, see the Apache Maven documentation.
Procedure
Update your Maven
pom.xmlfile to use theapicurio-registry-maven-pluginto download an artifact. The following example shows downloading Apache Avro and GraphQL schemas.Copy to Clipboard Copied! Toggle word wrap Toggle overflow - 1
- Specify
downloadas the execution goal. - 2
- Specify the Apicurio Registry URL with the
../apis/registry/v3endpoint. - 3
- If authentication is required, you can specify your authentication server and client credentials.
- 4
- Specify the Apicurio Registry artifact group ID. You can specify the
defaultgroup if you do not want to use a unique group. - 5
- You can download multiple artifacts to a specified directory using the artifact ID.
-
Build your Maven project, for example, by using the
mvn packagecommand.
7.3. Testing schema and API artifacts using the Maven plug-in 링크 복사링크가 클립보드에 복사되었습니다!
You might want to verify that an artifact can be registered without actually making any changes. This is often useful when rules are configured in Apicurio Registry. Testing the artifact results in a failure if the artifact content violates any of the configured rules.
When testing artifacts using the Maven plug-in, even if the artifact passes the test, no content is added to Apicurio Registry.
Prerequisites
- You have created a Maven project for your client application. For more details, see the Apache Maven documentation.
Procedure
Update your Maven
pom.xmlfile to use theapicurio-registry-maven-pluginto test an artifact. The following example shows testing an Apache Avro schema:Copy to Clipboard Copied! Toggle word wrap Toggle overflow - 1
- Specify
test-updateas the execution goal to test the schema artifact. - 2
- Specify the Apicurio Registry URL with the
../apis/registry/v3endpoint. - 3
- If authentication is required, you can specify your authentication server and client credentials.
- 4
- Specify the Apicurio Registry artifact group ID. You can specify the
defaultgroup if you do not want to use a unique group. - 5
- You can test multiple artifacts from a specified directory using the artifact ID.
-
Build your Maven project, for example, by using the
mvn packagecommand.
7.4. Adding artifact references manually using the Apicurio Registry Maven plug-in 링크 복사링크가 클립보드에 복사되었습니다!
Some Apicurio Registry artifact types can include artifact references from one artifact file to another. You can create efficiencies by defining reusable schema or API artifacts, and then referencing them from multiple locations in artifact references.
The following artifact types support artifact references:
- Apache Avro
- Google Protobuf
- JSON Schema
- OpenAPI
- AsyncAPI
This section shows a simple example of using the Apicurio Registry Maven plug-in to manually register an artifact reference to a simple Avro schema artifact stored in Apicurio Registry. This example assumes that the following Exchange schema artifact has already been created in Apicurio Registry:
Exchange schema
This example then creates a TradeKey schema artifact, which includes a reference to the nested Exchange schema artifact:
TradeKey schema with nested reference to Exchange schema
Prerequisites
- You have created a Maven project for your client application. For more details, see the Apache Maven documentation.
-
The referenced
Exchangeschema artifact is already created in Apicurio Registry.
Procedure
Update your Maven
pom.xmlfile to use theapicurio-registry-maven-pluginto register theTradeKeyschema, which includes a nested reference to theExchangeschema as follows:Copy to Clipboard Copied! Toggle word wrap Toggle overflow - 1
- Specify
registeras the execution goal to upload the schema artifacts to Apicurio Registry. - 2
- Specify the Apicurio Registry URL by using the
../apis/registry/v3endpoint. - 3
- If authentication is required, you can specify your authentication server and client credentials.
- 4
- Specify the Apicurio Registry artifact group ID. You can specify the
defaultgroup if you do not want to use a unique group ID. - 5
- Specify the Apicurio Registry artifact reference using its group ID, artifact ID, version, type, and location. You can register multiple artifact references in this way.
-
Build your Maven project, for example, by using the
mvn packagecommand.
7.5. Adding artifact references automatically using the Apicurio Registry Maven plug-in 링크 복사링크가 클립보드에 복사되었습니다!
Some Apicurio Registry artifact types can include artifact references from one artifact file to another. You can create efficiencies by defining reusable schema or API artifacts, and then referencing them from multiple locations in artifact references.
The following artifact types support artifact references:
- Apache Avro
- Google Protobuf
- JSON Schema
- OpenAPI
- AsyncAPI
You can specify a single artifact and configure the Apicurio Registry Maven plugin to automatically detect all references to artifacts located in the same directory, and to automatically register those references. This is a Technology Preview feature.
Technology Preview features are not supported with RedHat production service level agreements (SLAs) and might not be functionally complete. RedHat does not recommend using them in production. These features provide early access to upcoming product features, enabling customers to test functionality and provide feedback during the development process.
For more information about the support scope of RedHat Technology Preview features, see Technology Preview Features Support Scope.
This section shows a simple example of using the Maven plug-in to register an Avro schema and automatically detect and register an artifact reference to a simple schema artifact. This example assumes that the parent TradeKey artifact and the nested Exchange schema artifact are both available in the same directory:
TradeKey schema with nested reference to Exchange schema
Exchange schema
Prerequisites
- You have created a Maven project for your client application. For more details, see the Apache Maven documentation.
-
The
TradeKeyschema artifact and the nestedExchangeschema artifact files are both located in the same directory.
Procedure
Update your Maven
pom.xmlfile to use theapicurio-registry-maven-pluginto register theTradeKeyschema, which includes a nested reference to theExchangeschema as follows:Copy to Clipboard Copied! Toggle word wrap Toggle overflow - 1
- Specify
registeras the execution goal to upload the schema artifacts to Apicurio Registry. - 2
- Specify the Apicurio Registry URL by using the
../apis/registry/v3endpoint. - 3
- If authentication is required, you can specify your authentication server and client credentials.
- 4
- Specify the parent artifact group ID that contains the references. You can specify the
defaultgroup if you do not want to use a unique group ID. - 5
- Specify the location of the parent artifact file. All referenced artifacts must also be located in the same directory.
- 6
- Set the
<autoRefs>option to true to automatically detect and register all references to artifacts in the same directory. You can register multiple artifact references in this way.
-
Build your Maven project, for example, by using the
mvn packagecommand.
Chapter 8. Managing Apicurio Registry content using a SDK 링크 복사링크가 클립보드에 복사되었습니다!
You can write a Apicurio Registry client application (in Java, Typescript, Python, or Golang) and use it to manage artifacts stored in Apicurio Registry:
8.1. Apicurio Registry SDK 링크 복사링크가 클립보드에 복사되었습니다!
You can manage artifacts stored in Apicurio Registry by using one of the provided SDKs. You can perform any desired operation supported by the REST API, including create, read, update, or delete of artifacts. You can even use the Apicurio Registry SDKs to perform administrator functions, such as managing global rules or importing and exporting Apicurio Registry data.
You can use any of the following SDKs provided as part of Apicurio Registry:
- Java
- Typescript
- Python
- Golang
8.1.1. Java 링크 복사링크가 클립보드에 복사되었습니다!
You can access the Apicurio Registry Java SDK by adding the correct dependency to your Apache Maven project. For more details, see Section 8.2, “Writing Apicurio Registry SDK applications”.
The Apicurio Registry client is implemented by using the HTTP client provided by the JDK, which you can customize as needed. For example, you can add custom headers or enable configuration options for Transport Layer Security (TLS) authentication. For more details, see Section 8.3, “Apicurio Registry Java SDK configuration”.
8.1.2. Typescript 링크 복사링크가 클립보드에 복사되었습니다!
You can access the Apicurio Registry Typescript SDK by adding the correct dependency to your application’s package.json file (assumes a node.js application):
https://www.npmjs.com/package/@apicurio/apicurio-registry-sdk
8.1.3. Python 링크 복사링크가 클립보드에 복사되었습니다!
You can access the Apicurio Registry Python SDK by adding the correct dependency to your python project (assumes you are using pypi):
8.1.4. Golang 링크 복사링크가 클립보드에 복사되었습니다!
You can access the Apicurio Registry Golang SDK by adding the correct dependency to your project:
https://github.com/Apicurio/apicurio-registry/tree/main/go-sdk
8.2. Writing Apicurio Registry SDK applications 링크 복사링크가 클립보드에 복사되었습니다!
You can write a client application to manage artifacts stored in Apicurio Registry by using one of the Apicurio Registry SDKs.
8.2.1. Using the Apicurio Registry Java SDK 링크 복사링크가 클립보드에 복사되었습니다!
Prerequisites
- Apicurio Registry is installed and running in your environment.
- You have created a Maven project for your Java client application. For more details, see Apache Maven.
Procedure
Add the following dependency to your Maven project:
<dependency> <groupId>io.apicurio</groupId> <artifactId>apicurio-registry-java-sdk</artifactId> <version>${apicurio-registry.version}</version> </dependency><dependency> <groupId>io.apicurio</groupId> <artifactId>apicurio-registry-java-sdk</artifactId> <version>${apicurio-registry.version}</version> </dependency>Copy to Clipboard Copied! Toggle word wrap Toggle overflow Create the Apicurio Registry client as follows:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - 1
- If you specify an example Apicurio Registry URL of
https://my-registry.my-domain.com, the client will automatically append/apis/registry/v3. - 2
- Create a new Vertx object (needed by the VertxRequestAdapter)
- 3
- For more options when creating a Apicurio Registry client, see the Java client configuration in the next section.
- 4
- When you are done with the client, close the Vertx object to free its resources.
When the client is created, you can use all of the operations available in the Apicurio Registry REST API in the client. For more details, see the Apicurio Registry REST API documentation.
8.3. Apicurio Registry Java SDK configuration 링크 복사링크가 클립보드에 복사되었습니다!
The Apicurio Registry Java client includes the following configuration options, based on the client factory:
| Option | Description | Arguments |
|---|---|---|
| Plain client | Basic REST client used to interact with a running Apicurio Registry. |
|
| Client with custom configuration | Apicurio Registry client using the configuration provided by the user. |
|
| Client with custom configuration and authentication | Apicurio Registry client that accepts a map containing custom configuration. For example, this is useful to add custom headers to the calls. You must also provide an authentication server to authenticate the requests. |
|
Custom header configuration
To configure custom headers, you must add the apicurio.registry.request.headers prefix to the configs map key. For example, a configs map key of apicurio.registry.request.headers.Authorization with a value of Basic: YWxhZGRpbjpvcGVuc2VzYW1 sets the Authorization header with the same value.
TLS configuration options
You can configure Transport Layer Security (TLS) authentication for the Apicurio Registry Java client using the following properties:
-
apicurio.registry.request.ssl.truststore.location -
apicurio.registry.request.ssl.truststore.password -
apicurio.registry.request.ssl.truststore.type -
apicurio.registry.request.ssl.keystore.location -
apicurio.registry.request.ssl.keystore.password -
apicurio.registry.request.ssl.keystore.type -
apicurio.registry.request.ssl.key.password
Chapter 9. Validating Kafka messages using serializers/deserializers in Java clients 링크 복사링크가 클립보드에 복사되었습니다!
Apicurio Registry provides client serializers/deserializers (SerDes) for Kafka producer and consumer applications written in Java. Kafka producer applications use serializers to encode messages that conform to a specific event schema. Kafka consumer applications use deserializers to validate that messages have been serialized using the correct schema, based on a specific schema ID. This ensures consistent schema use and helps to prevent data errors at runtime.
This chapter explains how to use Kafka client SerDes in your producer and consumer client applications:
- Section 9.1, “Kafka client applications and Apicurio Registry”
- Section 9.2, “Strategies to look up a schema in Apicurio Registry”
- Section 9.3, “Registering a schema in Apicurio Registry”
- Section 9.4, “Using a schema from a Kafka consumer client”
- Section 9.5, “Using a schema from a Kafka producer client”
- Section 9.6, “Using a schema from a Kafka Streams application”
Prerequisites
- You have read Chapter 1, Introduction to Apicurio Registry.
- You have installed Apicurio Registry.
- You have created Kafka producer and consumer client applications.
9.1. Kafka client applications and Apicurio Registry 링크 복사링크가 클립보드에 복사되었습니다!
Apicurio Registry decouples schema management from client application configuration. You can enable a Java client application to use a schema from Apicurio Registry by specifying its URL in your client code.
You can store the schemas in Apicurio Registry to serialize and deserialize messages, which are referenced from your client applications to ensure that the messages that they send and receive are compatible with those schemas. Kafka client applications can push or pull their schemas from Apicurio Registry at runtime.
Schemas can evolve, so you can define rules in Apicurio Registry, for example, to ensure that schema changes are valid and do not break previous versions used by applications. Apicurio Registry checks for compatibility by comparing a modified schema with previous schema versions.
Apicurio Registry schema technologies
Apicurio Registry provides schema registry support for schema technologies such as:
- Avro
- Protobuf
- JSON Schema
These schema technologies can be used by client applications through the Kafka client serializer/deserializer (SerDes) services provided by Apicurio Registry. The maturity and usage of the SerDes classes provided by Apicurio Registry might vary. The sections that follow provide more details about each schema type.
Producer schema configuration
A producer client application uses a serializer to put the messages that it sends to a specific broker topic into the correct data format.
To enable a producer to use Apicurio Registry for serialization:
- Define and register your schema with Apicurio Registry (if it does not already exist).
Configure your producer client code with the following:
- URL of Apicurio Registry
- Apicurio Registry serializer to use with messages
- Strategy to map the Kafka message to a schema artifact in Apicurio Registry
- Strategy to look up or register the schema used for serialization in Apicurio Registry
After registering your schema, when you start Kafka and Apicurio Registry, you can access the schema to format messages sent to the Kafka broker topic by the producer. Alternatively, depending on configuration, the producer can automatically register the schema on first use.
If a schema already exists, you can create a new version using the registry REST API based on compatibility rules defined in Apicurio Registry. Versions are used for compatibility checking as a schema evolves. A group ID, artifact ID, and version represents a unique tuple that identifies a schema.
Consumer schema configuration
A consumer client application uses a deserializer to get the messages that it consumes from a specific broker topic into the correct data format.
To enable a consumer to use Apicurio Registry for deserialization:
- Define and register your schema with Apicurio Registry (if it does not already exist)
Configure the consumer client code with the following:
- URL of Apicurio Registry
- Apicurio Registry deserializer to use with the messages
- Input data stream for deserialization
Retrieve schemas using a content ID
By default, the schema is retrieved from Apicurio Registry by the deserializer using a content ID (which is an ID unique to the content of an artifact version, but not unique to the version itself), which is specified in the message being consumed. The schema content ID can be located in the message headers or in the message payload, depending on the configuration of the producer application. By default, the content ID will be located in the message body.
When locating the content ID in the message payload, the format of the data begins with a magic byte, used as a signal to consumers, followed by the content ID, and the message data as normal. For example:
...
# ...
[MAGIC_BYTE]
[CONTENT_ID]
[MESSAGE DATA]
Then when you start Kafka and Apicurio Registry, you can access the schema to format messages received from the Kafka broker topic.
Retrieve schemas using a global ID
Alternatively, you can configure to retrieve schemas from Apicurio Registry based on the global ID, which is the unique ID of the artifact version. The same options are available to you when using global ID instead of contentID. You can either send the global ID in the message headers or the message body (default).
When locating the global ID in the message payload, the format of the data begins with a magic byte, used as a signal to consumers, followed by the global ID, and the message data as normal. For example:
...
# ...
[MAGIC_BYTE]
[GLOBAL_ID]
[MESSAGE DATA]
9.2. Strategies to look up a schema in Apicurio Registry 링크 복사링크가 클립보드에 복사되었습니다!
The Kafka client serializer uses lookup strategies to determine the artifact ID and global ID under which the message schema is registered in Apicurio Registry. For a given topic and message, you can use different implementations of the ArtifactReferenceResolverStrategy Java interface to return a reference to an artifact in the registry.
The classes for each strategy are in the io.apicurio.registry.serde.strategy package. Specific strategy classes for Avro SerDes are in the io.apicurio.registry.serde.avro.strategy package. The default strategy is the TopicIdStrategy, which looks for Apicurio Registry artifacts with the same name as the Kafka topic receiving messages.
Example
public ArtifactReference artifactReference(String topic, boolean isKey, T schema) {
return ArtifactReference.builder()
.groupId(null)
.artifactId(String.format("%s-%s", topic, isKey ? "key" : "value"))
.build();
public ArtifactReference artifactReference(String topic, boolean isKey, T schema) {
return ArtifactReference.builder()
.groupId(null)
.artifactId(String.format("%s-%s", topic, isKey ? "key" : "value"))
.build();
-
The
topicparameter is the name of the Kafka topic receiving the message. -
The
isKeyparameter istruewhen the message key is serialized, andfalsewhen the message value is serialized. -
The
schemaparameter is the schema of the message serialized or deserialized. -
The
ArtifactReferencereturned contains the artifact ID under which the schema is registered.
Which lookup strategy you use depends on how and where you store your schema. For example, you might use a strategy that uses a record ID if you have different Kafka topics with the same Avro message type.
Artifact resolver strategy
The artifact resolver strategy provides a way to map the Kafka topic and message information to an artifact in Apicurio Registry. The common convention for the mapping is to combine the Kafka topic name with the key or value, depending on whether the serializer is used for the Kafka message key or value.
However, you can use alternative conventions for the mapping by using a strategy provided by Apicurio Registry, or by creating a custom Java class that implements io.apicurio.registry.serde.strategy.ArtifactReferenceResolverStrategy.
Strategies to return a reference to an artifact
Apicurio Registry provides the following strategies to return a reference to an artifact based on an implementation of ArtifactReferenceResolverStrategy:
RecordIdStrategy- Avro-specific strategy that uses the full name of the schema.
TopicRecordIdStrategy- Avro-specific strategy that uses the topic name and the full name of the schema.
TopicIdStrategy-
Default strategy that uses the topic name and
keyorvaluesuffix. SimpleTopicIdStrategy- Simple strategy that only uses the topic name.
DefaultSchemaResolver interface
The default schema resolver locates and identifies the specific version of the schema registered under the artifact reference provided by the artifact resolver strategy. Every version of every artifact has a single globally unique identifier that can be used to retrieve the content of that artifact. This global ID is included in every Kafka message so that a deserializer can properly fetch the schema from Apicurio Registry.
The default schema resolver can look up an existing artifact version, or it can register one if not found, depending on which strategy is used. You can also provide your own strategy by creating a custom Java class that implements io.apicurio.registry.resolver.SchemaResolver. However, it is recommended to use the DefaultSchemaResolver and specify configuration properties instead.
Configuration for registry lookup options
When using the DefaultSchemaResolver, you can configure its behavior using application properties. The following table shows some commonly used examples:
| Property | Type | Description | Default |
|---|---|---|---|
|
|
| Specify whether the serializer tries to find the latest artifact in the registry for the corresponding group ID and artifact ID. |
|
|
|
| Instructs the serializer to write the specified ID to Kafka and instructs the deserializer to use this ID to find the schema. | None |
|
|
| Specify whether the serializer tries to create an artifact in the registry. The JSON Schema serializer does not support this. |
|
|
|
| Specify how long to cache the global ID in milliseconds. If not configured, the global ID is fetched every time. | None |
9.3. Registering a schema in Apicurio Registry 링크 복사링크가 클립보드에 복사되었습니다!
After you have defined a schema in the appropriate format, such as Apache Avro, you can add the schema to Apicurio Registry.
You can add the schema using the following approaches:
- Apicurio Registry web console
- curl command using the Apicurio Registry REST API
- Maven plug-in supplied with Apicurio Registry
- Schema configuration added to your client code
Client applications cannot use Apicurio Registry until you have registered your schemas.
Apicurio Registry web console
When Apicurio Registry is installed, you can connect to the web console from the ui endpoint:
http://MY-REGISTRY-URL/ui
From the console, you can add, view and configure schemas. You can also create the rules that prevent invalid content being added to the registry.
Curl command example
Maven plug-in example
- 1
- Specify
registeras the execution goal to upload the schema artifact to the registry. - 2
- Specify the Apicurio Registry URL with the
../apis/registry/v3endpoint. - 3
- Specify the Apicurio Registry artifact group ID.
- 4
- You can upload multiple artifacts using the specified group ID, artifact ID, and location.
9.4. Using a schema from a Kafka consumer client 링크 복사링크가 클립보드에 복사되었습니다!
This procedure describes how to configure a Kafka consumer client written in Java to use a schema from Apicurio Registry.
Prerequisites
- Apicurio Registry is installed
- The schema is registered with Apicurio Registry
Procedure
Configure the client with the URL of Apicurio Registry. For example:
String registryUrl = "https://registry.example.com/apis/registry/v3"; Properties props = new Properties(); props.putIfAbsent(SerdeConfig.REGISTRY_URL, registryUrl);
String registryUrl = "https://registry.example.com/apis/registry/v3"; Properties props = new Properties(); props.putIfAbsent(SerdeConfig.REGISTRY_URL, registryUrl);Copy to Clipboard Copied! Toggle word wrap Toggle overflow Configure the client with the Apicurio Registry deserializer. For example:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
9.5. Using a schema from a Kafka producer client 링크 복사링크가 클립보드에 복사되었습니다!
This procedure describes how to configure a Kafka producer client written in Java to use a schema from Apicurio Registry.
Prerequisites
- Apicurio Registry is installed
- The schema is registered with Apicurio Registry
Procedure
Configure the client with the URL of Apicurio Registry. For example:
String registryUrl = "https://registry.example.com/apis/registry/v3"; Properties props = new Properties(); props.putIfAbsent(SerdeConfig.REGISTRY_URL, registryUrl);
String registryUrl = "https://registry.example.com/apis/registry/v3"; Properties props = new Properties(); props.putIfAbsent(SerdeConfig.REGISTRY_URL, registryUrl);Copy to Clipboard Copied! Toggle word wrap Toggle overflow Configure the client with the serializer, and the strategy to look up the schema in Apicurio Registry. For example:
props.put(CommonClientConfigs.BOOTSTRAP_SERVERS_CONFIG, "my-cluster-kafka-bootstrap:9092"); props.put(ProducerConfig.KEY_SERIALIZER_CLASS_CONFIG, AvroKafkaSerializer.class.getName()); props.put(ProducerConfig.VALUE_SERIALIZER_CLASS_CONFIG, AvroKafkaSerializer.class.getName()); props.put(SerdeConfig.FIND_LATEST_ARTIFACT, Boolean.TRUE);
props.put(CommonClientConfigs.BOOTSTRAP_SERVERS_CONFIG, "my-cluster-kafka-bootstrap:9092"); props.put(ProducerConfig.KEY_SERIALIZER_CLASS_CONFIG, AvroKafkaSerializer.class.getName());1 props.put(ProducerConfig.VALUE_SERIALIZER_CLASS_CONFIG, AvroKafkaSerializer.class.getName());2 props.put(SerdeConfig.FIND_LATEST_ARTIFACT, Boolean.TRUE);3 Copy to Clipboard Copied! Toggle word wrap Toggle overflow
9.6. Using a schema from a Kafka Streams application 링크 복사링크가 클립보드에 복사되었습니다!
This procedure describes how to configure a Kafka Streams client written in Java to use an Apache Avro schema from Apicurio Registry.
Prerequisites
- Apicurio Registry is installed
- The schema is registered with Apicurio Registry
Procedure
Create and configure a Java client with the Apicurio Registry URL:
String registryUrl = "https://registry.example.com/apis/registry/v3"; RegistryService client = RegistryClient.cached(registryUrl);
String registryUrl = "https://registry.example.com/apis/registry/v3"; RegistryService client = RegistryClient.cached(registryUrl);Copy to Clipboard Copied! Toggle word wrap Toggle overflow Configure the serializer and deserializer:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Create the Kafka Streams client:
KStream<String, LogInput> input = builder.stream( INPUT_TOPIC, Consumed.with(Serdes.String(), logSerde) );KStream<String, LogInput> input = builder.stream( INPUT_TOPIC, Consumed.with(Serdes.String(), logSerde) );Copy to Clipboard Copied! Toggle word wrap Toggle overflow
Chapter 10. Configuring Kafka serializers/deserializers in Java clients 링크 복사링크가 클립보드에 복사되었습니다!
This chapter provides detailed information on how to configure Kafka serializers/deserializers (SerDes) in your producer and consumer Java client applications:
- Section 10.1, “Apicurio Registry serializer/deserializer configuration in client applications”
- Section 10.2, “Apicurio Registry serializer/deserializer configuration properties”
- Section 10.3, “How to configure different client serializer/deserializer types”
- Section 10.3.1, “Configure Avro SerDes with Apicurio Registry”
- Section 10.3.2, “Configure JSON Schema SerDes with Apicurio Registry”
- Section 10.3.3, “Configure Protobuf SerDes with Apicurio Registry”
Prerequisites
10.1. Apicurio Registry serializer/deserializer configuration in client applications 링크 복사링크가 클립보드에 복사되었습니다!
You can configure specific client serializer/deserializer (SerDes) services and schema lookup strategies directly in a client application using the example constants shown in this section.
The following sections show examples of commonly used SerDes constants and configuration options.
Configuration for SerDes services
public class SerdeConfig {
public static final String REGISTRY_URL = "apicurio.registry.url";
public static final String ID_HANDLER = "apicurio.registry.id-handler";
public class SerdeConfig {
public static final String REGISTRY_URL = "apicurio.registry.url";
public static final String ID_HANDLER = "apicurio.registry.id-handler";
- The required URL of Apicurio Registry.
-
Extends ID handling to support other ID formats and make them compatible with Apicurio Registry SerDes services. For example, you may change it from the default ID format
Integerthat’s also compatible with Confluent’s ID format toLong.
Configuration for SerDes lookup strategies
public class SerdeConfig {
public static final String ARTIFACT_RESOLVER_STRATEGY = "apicurio.registry.artifact-resolver-strategy";
public static final String SCHEMA_RESOLVER = "apicurio.registry.schema-resolver";
...
public class SerdeConfig {
public static final String ARTIFACT_RESOLVER_STRATEGY = "apicurio.registry.artifact-resolver-strategy";
public static final String SCHEMA_RESOLVER = "apicurio.registry.schema-resolver";
...
- 1 1
- Java class that implements the artifact resolver strategy and maps between the Kafka SerDes and artifact ID. Defaults to the topic ID strategy. This is only used by the serializer class.
- 2 2
- Java class that implements the schema resolver. Defaults to
DefaultSchemaResolver. This is used by the serializer and deserializer classes.
Configuration for Kafka converters
public class SerdeBasedConverter<S, T> extends SchemaResolverConfigurer<S, T> implements Converter, Closeable {
public static final String REGISTRY_CONVERTER_SERIALIZER_PARAM = "apicurio.registry.converter.serializer";
public static final String REGISTRY_CONVERTER_DESERIALIZER_PARAM = "apicurio.registry.converter.deserializer";
public class SerdeBasedConverter<S, T> extends SchemaResolverConfigurer<S, T> implements Converter, Closeable {
public static final String REGISTRY_CONVERTER_SERIALIZER_PARAM = "apicurio.registry.converter.serializer";
public static final String REGISTRY_CONVERTER_DESERIALIZER_PARAM = "apicurio.registry.converter.deserializer";
- The required serializer to use with the Apicurio Registry Kafka converter.
- The required deserializer to use with the Apicurio Registry Kafka converter.
Configuration for different schema types
For details on how to configure SerDes for different schema technologies, see the following:
10.2. Apicurio Registry serializer/deserializer configuration properties 링크 복사링크가 클립보드에 복사되었습니다!
This section provides reference information on Java configuration properties for Apicurio Registry Kafka serializers/deserializers (SerDes).
SchemaResolver interface
Apicurio Registry SerDes are based on the SchemaResolver interface, which abstracts access to the registry and applies the same lookup logic for the SerDes classes of all supported formats.
| Constant | Property | Description | Type | Default |
|---|---|---|---|---|
|
|
|
Used by serializers and deserializers. Fully-qualified Java classname that implements | String |
|
The DefaultSchemaResolver is recommended and provides useful features for most use cases. For some advanced use cases, you might use a custom implementation of SchemaResolver.
DefaultSchemaResolver class
You can use the DefaultSchemaResolver to configure features such as:
- Access to the registry API
- How to look up artifacts in the registry
- How to write and read artifact information to and from Kafka
- Fall-back options for deserializers
Configuration for registry API access options
The DefaultSchemaResolver provides the following properties to configure access to the core registry API:
| Constant | Property | Description | Type | Default |
|---|---|---|---|---|
|
|
| Used by serializers and deserializers. URL to access the registry API. |
| None |
|
|
| Used by serializers and deserializers. URL of the token endpoint. |
| None |
|
|
| Used by serializers and deserializers. Client ID to access the authentication service. Required when accessing a secure registry using the OAuth client credentials flow. |
| None |
|
|
| Used by serializers and deserializers. Client secret to access the authentication service. Required when accessing a secure registry using the OAuth client credentials flow. |
| None |
|
|
| Used by serializers and deserializers. Username to access the registry. Required when accessing a secure registry using HTTP basic authentication. |
| None |
|
|
| Used by serializers and deserializers. Password to access the registry. Required when accessing a secure registry using HTTP basic authentication. |
| None |
Configuration for registry lookup options
The DefaultSchemaResolver uses the following properties to configure how to look up artifacts in Apicurio Registry.
| Constant | Property | Description | Type | Default |
|---|---|---|---|---|
|
|
|
Used by serializers only. Fully-qualified Java classname that implements |
|
|
|
|
|
Used by serializers only. Sets the |
| None |
|
|
|
Used by serializers only. Sets the |
| None |
|
|
|
Used by serializers only. Sets the artifact version used for querying or creating an artifact. Overrides the version returned by the |
| None |
|
|
| Used by serializers only. Specifies whether the serializer tries to find the latest artifact in the registry for the corresponding group ID and artifact ID. |
|
|
|
|
| Used by serializers only. Specifies whether the serializer tries to create an artifact in the registry. The JSON Schema serializer does not support this feature. |
|
|
|
|
| Used to indicate the serdes to dereference the schema. This is used in two different situation, once the schema is registered, instructs the serdes to ask the server for the schema dereferenced. It is also used to instruct the serializer to dereference the schema before registering it Registry, but this is only supported for Avro. |
|
|
|
|
|
Used by serializers only. Configures the behavior of the client when there is a conflict creating an artifact because the artifact already exists. Available values are |
|
|
|
|
| Used by serializers and deserializers. Specifies how long to cache artifacts before auto-eviction (milliseconds). If set to zero, artifacts are fetched every time. |
|
|
|
|
| Used by serializers and deserializers. If a schema can not be be retrieved from the Registry, it may retry a number of times. This configuration option controls the delay between the retry attempts (milliseconds). |
|
|
|
|
| Used by serializers and deserializers. If a schema can not be be retrieved from the Registry, it may retry a number of times. This configuration option controls the number of retry attempts. |
|
|
|
|
|
Used by serializers and deserializers. Configures to use the specified |
|
|
Configuration to read/write registry artifacts in Kafka
The DefaultSchemaResolver uses the following properties to configure how artifact information is written to and read from Kafka.
| Constant | Property | Description | Type | Default |
|---|---|---|---|---|
|
|
| Used by serializers and deserializers. Configures to read/write the artifact identifier to Kafka message headers instead of in the message payload. |
|
|
|
|
|
Used by serializers and deserializers. Fully-qualified Java classname that implements |
|
|
|
|
|
Used by serializers and deserializers. Fully-qualified Java classname of a class that implements |
|
|
Configuration for deserializer fall-back options
The DefaultSchemaResolver uses the following property to configure a fall-back provider for all deserializers.
| Constant | Property | Description | Type | Default |
|---|---|---|---|---|
|
|
|
Only used by deserializers. Sets a custom implementation of |
|
|
The DefaultFallbackArtifactProvider uses the following properties to configure deserializer fall-back options:
| Constant | Property | Description | Type | Default |
|---|---|---|---|---|
|
|
|
Used by deserializers only. Sets the |
| None |
|
|
|
Used by deserializers only. Sets the |
| None |
|
|
| Used by deserializers only. Sets the version used as fallback for resolving the artifact used for deserialization. |
| None |
Additional resources
- For more details, see the SerdeConfig Java class.
-
You can configure application properties as Java system properties or include them in the Quarkus
application.propertiesfile. For more details, see the Quarkus documentation.
10.3. How to configure different client serializer/deserializer types 링크 복사링크가 클립보드에 복사되었습니다!
When using schemas in your Kafka client applications, you must choose which specific schema type to use, depending on your use case. Apicurio Registry provides SerDe Java classes for Apache Avro, JSON Schema, and Google Protobuf. The following sections explain how to configure Kafka applications to use each type.
You can also use Kafka to implement custom serializer and deserializer classes, and leverage Apicurio Registry functionality using the Apicurio Registry REST Java client.
Kafka application configuration for serializers/deserializers
Using the SerDe classes provided by Apicurio Registry in your Kafka application involves setting the correct configuration properties. The following simple Avro examples show how to configure a serializer in a Kafka producer application and how to configure a deserializer in a Kafka consumer application.
Example serializer configuration in a Kafka producer
Example deserializer configuration in a Kafka consumer
10.3.1. Configure Avro SerDes with Apicurio Registry 링크 복사링크가 클립보드에 복사되었습니다!
This topic explains how to use the Kafka client serializer and deserializer (SerDes) classes for Apache Avro.
Apicurio Registry provides the following Kafka client SerDes classes for Avro:
-
io.apicurio.registry.serde.avro.AvroKafkaSerializer -
io.apicurio.registry.serde.avro.AvroKafkaDeserializer
Configure the Avro serializer
You can configure the Avro serializer class with the following:
- Apicurio Registry URL
- Artifact resolver strategy
- ID location
- ID encoding
- Avro datum provider
- Avro encoding
ID location
The serializer passes the unique ID of the schema as part of the Kafka message so that consumers can use the correct schema for deserialization. The ID can be in the message payload or in the message headers. The default location is the message payload. To send the ID in the message headers, set the following configuration property:
props.putIfAbsent(SerdeConfig.ENABLE_HEADERS, "true")
props.putIfAbsent(SerdeConfig.ENABLE_HEADERS, "true")
The property name is apicurio.registry.headers.enabled.
ID encoding
You can customize how the schema ID is encoded when passing it in the Kafka message body. Set the apicurio.registry.id-handler configuration property to a class that implements the io.apicurio.registry.serde.IdHandler interface. Apicurio Registry provides the following implementations:
-
io.apicurio.registry.serde.Default4ByteIdHandler: Stores the ID as an 4-byte long -
io.apicurio.registry.serde.Legacy8ByteIdHandler: Stores the ID as an 8-byte integer
Apicurio Registry represents the schema ID as a long, but for legacy reasons, or for compatibility with other registries or SerDe classes, you might want to use 4 bytes when sending the ID.
Avro datum provider
Avro provides different datum writers and readers to write and read data. Apicurio Registry supports three different types:
- Generic
- Specific
- Reflect
The Apicurio Registry AvroDatumProvider is the abstraction of which type is used, where DefaultAvroDatumProvider is used by default.
You can set the following configuration options:
-
apicurio.registry.avro-datum-provider: Specifies a fully-qualified Java class name of theAvroDatumProviderimplementation, for exampleio.apicurio.registry.serde.avro.ReflectAvroDatumProvider -
apicurio.registry.use-specific-avro-reader: Set totrueto use a specific type when usingDefaultAvroDatumProvider
Avro encoding
When using Avro to serialize data, you can use the Avro binary encoding format to ensure the data is encoded in as efficient a format as possible. Avro also supports encoding the data as JSON, which makes it easier to inspect the payload of each message, for example, for logging or debugging.
You can set the Avro encoding by configuring the apicurio.registry.avro.encoding property with a value of JSON or BINARY. The default is BINARY.
Configure the Avro deserializer
You must configure the Avro deserializer class to match the following configuration settings of the serializer:
- Apicurio Registry URL
- ID encoding
- Avro datum provider
- Avro encoding
See the serializer section for these configuration options. The property names and values are the same.
The following options are not required when configuring the deserializer:
- Artifact resolver strategy
- ID location
The deserializer class can determine the values for these options from the message. The strategy is not required because the serializer is responsible for sending the ID as part of the message.
The ID location is determined by checking for the magic byte at the start of the message payload. If that byte is found, the ID is read from the message payload using the configured handler. If the magic byte is not found, the ID is read from the message headers.
Avro SerDes and artifact references
When working with Avro messages and a schema with nested records, a new artifact is registered per nested record. For example, the following TradeKey schema includes a nested Exchange schema:
TradeKey schema with nested Exchange schema
Exchange schema
When using these schemas with Avro SerDes, two artifacts are created in Apicurio Registry, one for the TradeKey schema and one for the Exchange schema. Whenever a message using the TradeKey schema is serialized or deserialized, both schemas are retrieved, allowing you to split your definitions into different files.
10.3.2. Configure JSON Schema SerDes with Apicurio Registry 링크 복사링크가 클립보드에 복사되었습니다!
This topic explains how to use the Kafka client serializer and deserializer (SerDes) classes for JSON Schema.
Apicurio Registry provides the following Kafka client SerDes classes for JSON Schema:
-
io.apicurio.registry.serde.jsonschema.JsonSchemaKafkaSerializer -
io.apicurio.registry.serde.jsonschema.JsonSchemaKafkaDeserializer
Unlike Apache Avro, JSON Schema is not a serialization technology, but is instead a validation technology. As a result, configuration options for JSON Schema are quite different. For example, there is no encoding option, because data is always encoded as JSON.
Configure the JSON Schema serializer
You can configure the JSON Schema serializer class as follows:
- Apicurio Registry URL
- Artifact resolver strategy
- Schema validation
The only non-standard configuration property is JSON Schema validation, which is enabled by default. You can disable this by setting apicurio.registry.serde.validation-enabled to "false". For example:
props.putIfAbsent(SerdeConfig.VALIDATION_ENABLED, Boolean.FALSE)
props.putIfAbsent(SerdeConfig.VALIDATION_ENABLED, Boolean.FALSE)
Configure the JSON Schema deserializer
You can configure the JSON Schema deserializer class as follows:
- Apicurio Registry URL
- Schema validation
- Class for deserializing data
You must provide the location of Apicurio Registry so that the schema can be loaded. The other configuration is optional.
Deserializer validation only works if the serializer passes the global ID in the Kafka message, which will only happen when validation is enabled in the serializer.
JSON Schema SerDes and artifact references
The JSON Schema SerDes cannot discover the schema from the message payload, so the schema artifact must be registered beforehand, and this also applies artifact references.
Depending on the content of the schema, if the $ref value is a URL, the SerDes try to resolve the referenced schema using that URL, and then validation works as usual, validating the data against the main schema, and validating the nested value against the nested schema. Support for referencing artifacts in Apicurio Registry has also been implemented.
For example, the following citizen.json schema references the city.json schema:
citizen.json schema with reference to city.json schema
city.json schema
In this example, a given citizen has a city. In Apicurio Registry, a citizen artifact with a reference to the city artifact is created using the name city.json. In the SerDes, when the citizen schema is fetched, the city schema is also fetched because it is referenced from the citizen schema. When serializing/deserializing data, the reference name is used to resolve the nested schema, allowing validation against the citizen schema and the nested city schema.
10.3.3. Configure Protobuf SerDes with Apicurio Registry 링크 복사링크가 클립보드에 복사되었습니다!
This topic explains how to use the Kafka client serializer and deserializer (SerDes) classes for Google Protobuf.
Apicurio Registry provides the following Kafka client SerDes classes for Protobuf:
-
io.apicurio.registry.serde.protobuf.ProtobufKafkaSerializer -
io.apicurio.registry.serde.protobuf.ProtobufKafkaDeserializer
Configure the Protobuf serializer
You can configure the Protobuf serializer class as follows:
- Apicurio Registry URL
- Artifact resolver strategy
- ID location
- ID encoding
- Schema validation
For details on these configuration options, see the following sections:
Configure the Protobuf deserializer
You must configure the Protobuf deserializer class to match the following configuration settings in the serializer:
- Apicurio Registry URL
- ID encoding
The configuration property names and values are the same as for the serializer.
The following options are not required when configuring the deserializer:
- Artifact resolver strategy
- ID location
The deserializer class can determine the values for these options from the message. The strategy is not required because the serializer is responsible for sending the ID as part of the message.
The ID location is determined by checking for the magic byte at the start of the message payload. If that byte is found, the ID is read from the message payload using the configured handler. If the magic byte is not found, the ID is read from the message headers.
The Protobuf deserializer does not deserialize to your exact Protobuf Message implementation, but rather to a DynamicMessage instance. There is no appropriate API to do otherwise.
Protobuf SerDes and artifact references
When a complex Protobuf message with an import statement is used, the imported Protobuf messages are stored in Apicurio Registry as separate artifacts. Then when Apicurio Registry gets the main schema to check a Protobuf message, the referenced schemes are also retrieved so the full message schema can be checked and serialized.
For example, the following table_info.proto schema file includes the imported mode.proto schema file:
table_info.proto file with imported mode.proto file
mode.proto file
In this example, two Protobuf artifacts are stored in Apicurio Registry, one for TableInfo and one for Mode. However, because Mode is part of TableInfo, whenever TableInfo is fetched to check a message in the SerDes, Mode is also returned as an artifact referenced by TableInfo.
Chapter 11. Apicurio Registry artifact reference 링크 복사링크가 클립보드에 복사되었습니다!
This chapter provides reference information on the supported artifact types, states, and metadata that are stored in Apicurio Registry.
11.1. Apicurio Registry artifact types 링크 복사링크가 클립보드에 복사되었습니다!
You can store and manage a wide range of schema and API artifact types in Apicurio Registry.
| Type | Description | Supported versions |
|---|---|---|
|
| AsyncAPI specification |
|
|
| Apache Avro schema |
|
|
| GraphQL schema | * |
|
| JSON Schema |
|
|
| Apache Kafka Connect schema |
|
|
| OpenAPI specification |
|
|
| Google protocol buffers schema |
|
|
| Web Services Definition Language | |
|
| Extensible Markup Language | |
|
| XML Schema Definition |
11.2. Apicurio Registry artifact version states 링크 복사링크가 클립보드에 복사되었습니다!
The valid artifact version states in Apicurio Registry are ENABLED, DISABLED, and DEPRECATED.
| State | Description |
|---|---|
|
| Basic state, all the operations are available. |
|
| The artifact version metadata is viewable and searchable using the Apicurio Registry web console, but its content cannot be fetched by any client. |
|
| The artifact version is fully usable but a header is added to the REST API response whenever the artifact version content is fetched. |
11.3. Apicurio Registry group metadata 링크 복사링크가 클립보드에 복사되었습니다!
When a group is created in Apicurio Registry, a set of metadata properties is created and stored. This metadata consists of system-generated or user-generated properties that are read-only, and editable properties that you can update after the group is created.
| Property | Type | Description |
|---|---|---|
|
| string | The name of the user who created the group. |
|
| date |
The date and time when the group was created, for example, |
|
| string | The name of the user who modified the group. |
|
| date |
The date and time at which the group was modified, for example, |
| Property | Type | Description |
|---|---|---|
|
| string |
Unique identifier of the artifact group in Apicurio Registry, for example, |
| Property | Type | Description |
|---|---|---|
|
| string |
Optional meaningful description of the group, for example, |
|
| map |
Optional list of user-defined name-value pairs associated with the group. The name and value must be strings, for example, |
Updating group metadata
- You can use the Apicurio Registry REST API or web console to update the set of editable metadata properties.
-
You can update the
stateproperty only by using the Apicurio Registry REST API.
11.4. Apicurio Registry artifact metadata 링크 복사링크가 클립보드에 복사되었습니다!
When an artifact is added to Apicurio Registry, a set of metadata properties is created and stored. This metadata consists of system-generated or user-generated properties that are read-only, and editable properties that you can update after the artifact is created.
| Property | Type | Description |
|---|---|---|
|
| date |
The date and time when the artifact was created, for example, |
|
| integer |
Globally unique identifier of an artifact version in Apicurio Registry. For example, a global ID of |
|
| string | The name of the user who modified the artifact. |
|
| date |
The date and time at which the artifact was modified, for example, |
| Property | Type | Description |
|---|---|---|
|
| string |
Unique identifier of an artifact group in Apicurio Registry, for example, |
|
| string |
Unique identifier of an artifact in Apicurio Registry. You can provide an artifact ID or use the UUID generated by Apicurio Registry, for example, |
|
| ArtifactType |
The supported artifact type, for example, |
| Property | Type | Description |
|---|---|---|
|
| string |
Optional human-readable name of the artifact, for example, |
|
| string |
Optional meaningful description of the artifact, for example, |
|
| map |
Optional list of user-defined name-value pairs associated with the artifact. The name and value must be strings, for example, |
|
| string | The name of the user who owns the artifact. |
Updating artifact metadata
- You can use the Apicurio Registry REST API or web console to update the set of editable metadata properties.
11.5. Apicurio Registry artifact version metadata 링크 복사링크가 클립보드에 복사되었습니다!
When an artifact version is added to a Apicurio Registry artifact, a set of metadata properties is created and stored along with the artifact version content. This metadata consists of system-generated or user-generated properties that are read-only, and editable properties that you can update after the artifact version is created.
| Property | Type | Description |
|---|---|---|
|
| string | The name of the user who created the artifact version. |
|
| date |
The date and time when the artifact version was created, for example, |
|
| string | The user who modified the artifact version. |
|
| date |
The date and time at which the artifact version was modified, for example, |
|
| integer |
Unique identifier of artifact version content in Apicurio Registry. The same content ID can be shared by multiple artifact versions when artifact versions have identical content. For example, a content ID of |
|
| integer |
Globally unique identifier of an artifact version in Apicurio Registry. For example, a global ID of |
| Property | Type | Description |
|---|---|---|
|
| string |
Unique identifier of an artifact group in Apicurio Registry, for example, |
|
| string | Unique identifier of an artifact in Apicurio Registry. |
|
| integer |
The version string of the artifact version. If not provided, the system will generate a new sequential version. You can provide a version when using the Apicurio Registry REST API, SDKs, or Maven plug-in, for example, |
| Property | Type | Description |
|---|---|---|
|
| string |
Optional human-readable name of the artifact version, for example, |
|
| string |
Optional meaningful description of the artifact version, for example, |
|
| map |
Optional list of user-defined name-value pairs associated with the artifact version. The name and value must be strings, for example, |
|
| ArtifactState |
The state of the artifact version: |
Updating artifact version metadata
- You can use the Apicurio Registry REST API or web console to update the set of editable metadata properties.
-
You can update the
stateproperty only by using the Apicurio Registry REST API.
Chapter 12. Apicurio Registry content rule reference 링크 복사링크가 클립보드에 복사되었습니다!
This chapter provides reference information on the supported content rule types, their level of support for artifact types, and order of precedence of artifact-specific and global rules.
12.1. Apicurio Registry content rule types 링크 복사링크가 클립보드에 복사되었습니다!
You can specify VALIDITY, COMPATIBILITY, and INTEGRITY rule types to govern content evolution in Apicurio Registry. Theses rule types apply to both global rules and artifact-specific rules.
| Type | Description |
|---|---|
|
| Validate content before adding it to Apicurio Registry. The possible configuration values for this rule are as follows:
|
|
|
Enforce a compatibility level when updating artifacts (for example, select
|
|
| Enforce artifact reference integrity when creating or updating artifacts. Enable and configure this rule to ensure that any artifact references provided are correct. The possible configuration values for this rule are as follows:
|
12.2. Apicurio Registry content rule maturity 링크 복사링크가 클립보드에 복사되었습니다!
Not all content rules are fully implemented for every artifact type supported by Apicurio Registry. The following table shows the current maturity level for each rule and artifact type:
| Artifact type | Validity rule | Compatibility rule | Integrity rule |
|---|---|---|---|
| Avro | Full | Full | Full |
| Protobuf | Full | Full | Full |
| JSON Schema | Full | Full | Mapping detection not supported |
| OpenAPI | Full | Full | Full |
| AsyncAPI | Syntax Only | None | Full |
| GraphQL | Syntax Only | None | Mapping detection not supported |
| Kafka Connect | Syntax Only | None | Mapping detection not supported |
| WSDL | Full | None | Mapping detection not supported |
| XML | Full | None | Mapping detection not supported |
| XSD | Full | None | Mapping detection not supported |
12.3. Apicurio Registry content rule precedence 링크 복사링크가 클립보드에 복사되었습니다!
When you add or update an artifact, Apicurio Registry applies rules to check the validity, compatibility, or integrity of the artifact content. Configured artifact-specific rules override the equivalent configured global rules, as shown in the following table.
| Artifact-specific rule | Global rule | Rule applied to this artifact | Global rule available for other artifacts? |
|---|---|---|---|
| Enabled | Enabled | Artifact-specific | Yes |
| Disabled | Enabled | Global | Yes |
| Disabled | Disabled | None | No |
| Enabled, set to None | Enabled | None | Yes |
| Disabled | Enabled, set to None | None | No |
Chapter 13. Apicurio Registry configuration reference 링크 복사링크가 클립보드에 복사되었습니다!
This chapter provides reference information on the configuration options that are available for Apicurio Registry.
Additional resources
- For details on migrating a 2.x Apicurio Registry deployment to 3.x see Section 13.2, “Apicurio Registry version 2 to version 3 configuration changes”
-
For details on setting configuration options by using the Core Registry API, see the
/admin/config/propertiesendpoint in the Apicurio Registry REST API documentation. User Guide.
13.1. Apicurio Registry configuration options 링크 복사링크가 클립보드에 복사되었습니다!
The following Apicurio Registry configuration options are available for each component category:
13.1.1. api 링크 복사링크가 클립보드에 복사되었습니다!
| Name | Type | Default | Available from | Description |
|---|---|---|---|---|
|
|
|
|
| Include stack trace in errors responses |
|
|
|
|
| API base href (URI) |
|
|
|
| Disable APIs |
13.1.2. auth 링크 복사링크가 클립보드에 복사되었습니다!
| Name | Type | Default | Available from | Description |
|---|---|---|---|---|
|
|
|
|
| Auth admin override claim |
|
|
|
|
| Auth admin override claim value |
|
|
|
|
| Auth admin override enabled |
|
|
|
|
| Auth admin override from |
|
|
|
|
| Auth admin override role |
|
|
|
|
| Auth admin override type |
|
|
|
|
| Auth admin override user name |
|
|
|
|
| Anonymous read access |
|
|
|
|
| Authenticated read access |
|
|
|
|
| Artifact owner-only authorization |
|
|
|
|
| Artifact group owner-only authorization |
|
|
|
|
| Enable role based authorization |
|
|
|
|
| Auth roles source |
|
|
|
| Header authorization name | |
|
|
|
|
| Auth roles admin |
|
|
|
|
| Auth roles developer |
|
|
|
|
| Auth roles readonly |
|
|
|
|
| Prefix used for application audit logging. |
|
|
|
|
| Default client credentials token expiration time in minutes. |
|
|
|
|
| Client credentials token expiration offset from JWT expiration, in seconds. |
|
|
|
|
| Enable basic auth client credentials |
|
|
|
| Client credentials scope. | |
|
|
|
|
| Enable basic auth |
|
|
|
| Client identifier used by the server for authentication. | |
|
|
|
| Client secret used by the server for authentication. | |
|
|
|
|
| Enable auth |
|
|
|
| Authentication server token endpoint. |
13.1.3. cache 링크 복사링크가 클립보드에 복사되었습니다!
| Name | Type | Default | Available from | Description |
|---|---|---|---|---|
|
|
|
|
| Registry cache enabled |
13.1.4. ccompat 링크 복사링크가 클립보드에 복사되었습니다!
| Name | Type | Default | Available from | Description |
|---|---|---|---|---|
|
|
|
|
| Enable group support via concatenation in subject (compatibility API) |
|
|
|
|
| Separator to use when group concatenation is enabled (compatibility API) |
|
|
|
|
| Legacy ID mode (compatibility API) |
|
|
|
|
| Maximum number of Subjects returned (compatibility API) |
|
|
|
|
| Canonical hash mode (compatibility API) |
13.1.5. download 링크 복사링크가 클립보드에 복사되었습니다!
| Name | Type | Default | Available from | Description |
|---|---|---|---|---|
|
|
|
|
| Download link expiry |
13.1.6. gitops 링크 복사링크가 클립보드에 복사되었습니다!
| Name | Type | Default | Available from | Description |
|---|---|---|---|---|
|
|
|
| Identifier of this Registry instance. Only data that references this identifier will be loaded. | |
|
|
|
|
| Name of the branch in the remote git repository containing data to be loaded. |
|
|
|
| URI of the remote git repository containing data to be loaded. | |
|
|
|
|
| Path to GitOps working directory, which is used to store the local git repository. |
13.1.7. health 링크 복사링크가 클립보드에 복사되었습니다!
| Name | Type | Default | Available from | Description |
|---|---|---|---|---|
|
|
|
| Ignored liveness errors | |
|
|
|
|
| Counter reset window duration of persistence liveness check |
|
|
|
|
| Error threshold of persistence liveness check |
|
|
|
|
| Disable logging of persistence liveness check |
|
|
|
|
| Status reset window duration of persistence liveness check |
|
|
|
|
| Error threshold of persistence readiness check |
|
|
|
|
| Timeout of persistence readiness check |
|
|
|
|
| Status reset window duration of persistence readiness check |
|
|
|
|
| Counter reset window duration of response liveness check |
|
|
|
|
| Counter reset window duration of persistence readiness check |
|
|
|
|
| Disable logging of response liveness check |
|
|
|
|
| Error threshold of response liveness check |
|
|
|
|
| Status reset window duration of response liveness check |
|
|
|
|
| Counter reset window duration of response readiness check |
|
|
|
|
| Error threshold of response readiness check |
|
|
|
|
| Timeout of response readiness check |
|
|
|
|
| Status reset window duration of response readiness check |
|
|
|
|
| Storage metrics cache check period |
13.1.8. import 링크 복사링크가 클립보드에 복사되었습니다!
| Name | Type | Default | Available from | Description |
|---|---|---|---|---|
|
|
|
|
| When set to true, content IDs from the import file will be used (otherwise new IDs will be generated). Defaults to 'true'. |
|
|
|
|
| When set to true, global IDs from the import file will be used (otherwise new IDs will be generated). Defaults to 'true'. |
|
|
|
|
| When set to true, importing data will only work when the registry is empty. Defaults to 'true'. |
|
|
|
| The import URL | |
|
|
|
| Temporary work directory to use when importing data. |
13.1.9. limits 링크 복사링크가 클립보드에 복사되었습니다!
| Name | Type | Default | Available from | Description |
|---|---|---|---|---|
|
|
|
|
| Max artifact labels |
|
|
|
|
| Max artifact properties |
|
|
|
|
| Max artifacts |
|
|
|
|
| Max artifact description length |
|
|
|
|
| Max artifact label size |
|
|
|
|
| Max artifact name length |
|
|
|
|
| Max artifact property key size |
|
|
|
|
| Max artifact property value size |
|
|
|
|
| Max artifact requests per second |
|
|
|
|
| Max schema size (bytes) |
|
|
|
|
| Max total schemas |
|
|
|
|
| Max versions per artifacts |
|
|
|
|
| Storage metrics cache max size. |
13.1.10. redirects 링크 복사링크가 클립보드에 복사되었습니다!
| Name | Type | Default | Available from | Description |
|---|---|---|---|---|
|
|
|
| Registry redirects | |
|
|
|
| Enable redirects | |
|
|
|
| Override the hostname used for generating externally-accessible URLs. The host and port overrides are useful when deploying Registry with HTTPS passthrough Ingress or Route. In cases like these, the request URL (and port) that is then re-used for redirection does not belong to actual external URL used by the client, because the request is proxied. The redirection then fails because the target URL is not reachable. | |
|
|
|
| Override the port used for generating externally-accessible URLs. |
13.1.11. rest 링크 복사링크가 클립보드에 복사되었습니다!
| Name | Type | Default | Available from | Description |
|---|---|---|---|---|
|
|
|
|
| Max size of the artifact allowed to be downloaded from URL |
|
|
|
|
| Skip SSL validation when downloading artifacts from URL |
|
|
|
|
| Enables artifact version deletion |
|
|
|
|
| Enables artifact deletion |
|
|
|
|
| Enables group deletion |
|
|
|
|
| Enables artifact version mutability |
|
|
|
|
| Max size of the labels (in bytes) per item from within search results |
13.1.12. semver 링크 복사링크가 클립보드에 복사되었습니다!
| Name | Type | Default | Available from | Description |
|---|---|---|---|---|
|
|
|
|
| If true, invalid versions will be coerced to Semantic Versioning 2 format (https://semver.org) if possible. |
|
|
|
|
| Automatically create or update branches for major ('A.x') and minor ('A.B.x') artifact versions. |
|
|
|
|
| Validate that all artifact versions conform to Semantic Versioning 2 format (https://semver.org). |
13.1.13. storage 링크 복사링크가 클립보드에 복사되었습니다!
| Name | Type | Default | Available from | Description |
|---|---|---|---|---|
|
|
|
|
| Gitops blue datasource db kind |
|
|
|
|
| Gitops blue datasource pool initial size |
|
|
|
|
| Gitops blue datasource pool max size |
|
|
|
|
| Gitops blue datasource pool minimum size |
|
|
|
|
| Gitops blue datasource jdbc url |
|
|
|
|
| Gitops blue datasource password |
|
|
|
|
| Gitops blue datasource username |
|
|
|
|
| Gitops green datasource db kind |
|
|
|
|
| Gitops green datasource pool initial size |
|
|
|
|
| Gitops green datasource pool max size |
|
|
|
|
| Gitops green datasource pool minimum size |
|
|
|
|
| Gitops green datasource jdbc url |
|
|
|
|
| Gitops green datasource password |
|
|
|
|
| Gitops green datasource username |
|
|
|
| Storage event topic | |
|
|
| Kafka sql storage bootstrap servers | ||
|
|
|
| Kafka sql storage prefix for consumer group name | |
|
|
|
| Kafka sql storage consumer poll timeout | |
|
|
|
| Kafka sql storage coordinator response timeout | |
|
|
| Kafka sql storage security protocol | ||
|
|
| Kafka sql storage sasl client identifier | ||
|
|
| Kafka sql storage sasl client secret | ||
|
|
|
| Kafka sql storage sasl enabled | |
|
|
| Kafka sql storage sasl login callback handler | ||
|
|
| Kafka sql storage sasl mechanism | ||
|
|
| Kafka sql storage sasl token endpoint | ||
|
|
| Kafka sql storage ssl truststore location | ||
|
|
| Kafka sql storage ssl truststore type | ||
|
|
|
|
| Kafka sql journal topic snapshot every |
|
|
|
|
| Kafka sql storage topic name |
|
|
| Kafka sql storage ssl key password | ||
|
|
| Kafka sql storage ssl keystore location | ||
|
|
| Kafka sql storage ssl keystore password | ||
|
|
| Kafka sql storage ssl keystore type | ||
|
|
| Kafka sql storage ssl truststore password | ||
|
|
|
| Kafka sql storage topic name | |
|
|
|
| Kafka sql storage topic auto create | |
|
|
|
|
| Database schema name (only needed when running two instances of Registry against the same database, in multiple schemas) |
|
|
|
|
| SQL init |
|
|
|
| Application storage variant, for example, sql, kafkasql, or gitops | |
|
|
|
|
| Enable Registry storage read-only mode |
|
|
|
|
| Kafka sql snapshots store location |
|
|
|
|
| Application datasource database type |
|
|
|
|
| Skip artifact versions with DISABLED state when retrieving latest artifact version |
13.1.14. system 링크 복사링크가 클립보드에 복사되었습니다!
| Name | Type | Default | Available from | Description |
|---|---|---|---|---|
|
|
|
| ||
|
|
|
| ||
|
|
|
| ||
|
|
|
|
13.1.15. ui 링크 복사링크가 클립보드에 복사되었습니다!
| Name | Type | Default | Available from | Description |
|---|---|---|---|---|
|
|
|
|
| The OIDC clientId |
|
|
|
|
| The OIDC logout URL |
|
|
|
|
| The OIDC redirectUri |
|
|
|
|
| UI auth OIDC scope value |
|
|
|
|
| Context path of the UI |
|
|
|
|
| URL of the Documentation component |
|
|
|
|
| Enabled to show breadcrumbs in the UI |
|
|
|
|
| Enabled to set the UI to read-only mode |
|
|
|
|
| Enabled to show the Settings tab in the UI |
|
|
|
|
| Navigation prefix for all UI paths |
13.1.16. unknown 링크 복사링크가 클립보드에 복사되었습니다!
| Name | Type | Default | Available from | Description |
|---|---|---|---|---|
|
|
|
| ||
|
|
|
| ||
|
|
|
| ||
|
|
|
| ||
|
|
|
| ||
|
|
|
| ||
|
|
|
| ||
|
|
|
| ||
|
|
|
| ||
|
|
|
| ||
|
|
|
| ||
|
|
|
| ||
|
|
|
| ||
|
|
|
| ||
|
|
|
| ||
|
|
|
| ||
|
|
|
| ||
|
|
|
| ||
|
|
|
| ||
|
|
|
| ||
|
|
|
| ||
|
|
|
| ||
|
|
|
| ||
|
|
|
| ||
|
|
|
| ||
|
|
|
| ||
|
|
|
| ||
|
|
|
| ||
|
|
|
| ||
|
|
|
| ||
|
|
|
| ||
|
|
|
| ||
|
|
|
| ||
|
|
|
| ||
|
|
|
| ||
|
|
|
| ||
|
|
|
|
13.2. Apicurio Registry version 2 to version 3 configuration changes 링크 복사링크가 클립보드에 복사되었습니다!
Apicurio Registry v3 has simplified the configuration options, removing duplicates and improving consistency. For most options, the only change is ssrenaming of the prefix from registry to apicurio, for example, changing registry.kafkasql.bootstrap.servers to apicurio.kafkasql.bootstrap.servers.
For each configuration property you can override the value by using the corresponding environment variable, for example, APICURIO_KAFKASQL_BOOTSTRAP_SERVERS.s
13.2.1. api 링크 복사링크가 클립보드에 복사되었습니다!
| Name | New Option |
|---|---|
|
|
|
|
|
|
13.2.2. auth 링크 복사링크가 클립보드에 복사되었습니다!
| Name | New Option |
|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
13.2.3. cache 링크 복사링크가 클립보드에 복사되었습니다!
| Name | New Option |
|---|---|
|
|
|
13.2.4. ccompat 링크 복사링크가 클립보드에 복사되었습니다!
| Name | New Option |
|---|---|
|
|
|
|
|
|
|
|
|
13.2.5. download 링크 복사링크가 클립보드에 복사되었습니다!
| Name | New Option |
|---|---|
|
|
|
13.2.6. events 링크 복사링크가 클립보드에 복사되었습니다!
| Name | New Option |
|---|---|
|
|
|
13.2.7. health 링크 복사링크가 클립보드에 복사되었습니다!
| Name | New Option |
|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
13.2.8. import 링크 복사링크가 클립보드에 복사되었습니다!
| Name | New Option |
|---|---|
|
|
|
13.2.9. kafka 링크 복사링크가 클립보드에 복사되었습니다!
| Name | New Option |
|---|---|
|
|
|
|
|
|
13.2.10. limits 링크 복사링크가 클립보드에 복사되었습니다!
| Name | New Option |
|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
13.2.11. redirects 링크 복사링크가 클립보드에 복사되었습니다!
| Name | New Option |
|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
13.2.12. rest 링크 복사링크가 클립보드에 복사되었습니다!
| Name | New Option |
|---|---|
|
|
|
|
|
|
|
|
|
13.2.13. store 링크 복사링크가 클립보드에 복사되었습니다!
| Name | New Option |
|---|---|
|
|
|
|
|
|
13.2.14. ui 링크 복사링크가 클립보드에 복사되었습니다!
| Name | New Option |
|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Appendix A. Using your subscription 링크 복사링크가 클립보드에 복사되었습니다!
Apicurio Registry is provided through a software subscription. To manage your subscriptions, access your account at the Red Hat Customer Portal.
Accessing your account
- Go to access.redhat.com.
- If you do not already have an account, create one.
- Log in to your account.
Activating a subscription
- Go to access.redhat.com.
- Navigate to My Subscriptions.
- Navigate to Activate a subscription and enter your 16-digit activation number.
Downloading ZIP and TAR files
To access ZIP or TAR files, use the customer portal to find the relevant files for download. If you are using RPM packages, this step is not required.
- Open a browser and log in to the Red Hat Customer Portal Product Downloads page at access.redhat.com/downloads.
- Locate the Red Hat Integration entries in the Integration and Automation category.
- Select the desired Apicurio Registry product. The Software Downloads page opens.
- Click the Download link for your component.
Revised on 2025-10-23 18:26:02 UTC