Class SchemaResolverConfig
java.lang.Object
io.apicurio.registry.resolver.config.AbstractConfig
io.apicurio.registry.resolver.config.SchemaResolverConfig
Contains the
DefaultSchemaResolver configuration properties.-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringFully qualified Java classname of a class that implementsArtifactReferenceResolverStrategyand is responsible for mapping between the Record being resolved and an artifactId.static final StringUses the ArtifactReference available for each record.static final StringThe Client Id of the Auth Service.static final StringThe Scope of the Auth Service.static final StringThe Secret of the Auth Service.static final StringThe Password of the Auth Service.static final StringThe URL of the Token Endpoint.static final StringThe Username of the Auth Service.static final StringOptional, boolean to indicate whether serializer classes should attempt to create an artifact in the registry.static final booleanstatic final StringOptional, one of "IfExists" to indicate the behavior of the client when there is a conflict creating an artifact because the artifact already exists.static final Stringstatic final StringIftrue, enables background refresh of expired cache entries following the "stale-while-revalidate" pattern.static final booleanstatic final StringThe number of threads in the background refresh executor pool.static final longstatic final StringThe maximum time (in milliseconds) to wait for a background refresh operation to complete before timing out.static final longstatic final StringIftrue, will cache schema lookups that either have `latest` or no version specified.static final booleanstatic final StringUsed to indicate whether the schema resolver should canonicalize content when using content to lookup/search for an artifact version in the registry by content.static final booleanstatic final StringIndicates how long to cache artifacts before auto-eviction.static final longstatic final booleanstatic final StringUsed to indicate the serdes to dereference the schema.static final StringOnly applicable for serializers Optional, set explicitly the groupId used for querying/creating an artifact.static final StringOnly applicable for serializers Optional, set explicitly the artifactId used for querying/creating an artifact.static final StringOnly applicable for serializers Optional, set explicitly the version used for querying/creating an artifact.static final StringIftrue, will log exceptions instead of throwing them when an error occurs trying to refresh a schema in the cache.static final booleanstatic final StringOptional, boolean to indicate whether serializer classes should attempt to find the latest artifact in the registry for the corresponding groupId/artifactId.static final booleanstatic final StringThe HTTP adapter to use for registry client connections.static final Stringstatic final StringWhether to enable OpenTelemetry trace context propagation for HTTP requests to the Registry.static final booleanstatic final StringThe HTTP/HTTPS proxy host for registry connections.static final StringOptional password for proxy authentication.static final StringThe HTTP/HTTPS proxy port for registry connections.static final StringOptional username for proxy authentication.static final StringThe URL of the Apicurio Registry.static final StringThe API version implemented by the URL endpoint indicated by the 'apicurio.registry.url' property.static final StringIf a schema can not be be retrieved from the Registry, serdes may retry a number of times.static final longstatic final StringIf a schema can not be retrieved from the Registry, serdes may retry a number of times.static final longstatic final StringOnly applicable for serializers Optional, set explicitly the schema location in the classpath for the schema to be used for serializing the data.static final StringPEM certificate configuration for TLS/SSL trust.static final StringIf true, disables all SSL/TLS certificate verification.static final booleanstatic final StringThe location of the trust store file for TLS/SSL connections.static final StringThe password for the trust store file specified byTLS_TRUSTSTORE_LOCATION.static final StringThe type of trust store.static final Stringstatic final StringIf true, verifies that the hostname in the server certificate matches the server hostname.static final booleanstatic final StringIdentifier for the client application, sent as X-Registry-Client-Id header on schema fetch requests.static final StringInternal property key for storing a Vertx instance.Fields inherited from class io.apicurio.registry.resolver.config.AbstractConfig
originals -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanbooleanbooleanlongbooleanbooleanReturns the HTTP adapter type to use for registry client connections.longbooleanbooleanio.vertx.core.VertxgetVertx()Returns the Vertx instance if one was provided in the configuration.booleanbooleanReturns whether OpenTelemetry trace context propagation is enabled.booleanMethods inherited from class io.apicurio.registry.resolver.config.AbstractConfig
getBoolean, getBooleanOrFalse, getClass, getDurationNonNegativeMillis, getLongNonNegative, getObject, getString, getStringOneOf, originals
-
Field Details
-
ARTIFACT_RESOLVER_STRATEGY
Fully qualified Java classname of a class that implementsArtifactReferenceResolverStrategyand is responsible for mapping between the Record being resolved and an artifactId. For example there is a strategy to use the topic name as the schema's artifactId. Only used bySchemaResolver.resolveSchema(io.apicurio.registry.resolver.data.Record)- See Also:
-
ARTIFACT_RESOLVER_STRATEGY_DEFAULT
Uses the ArtifactReference available for each record. RequiresMetadata.artifactReference()to be set. Note this default artifact resolver strategy differs in behavior from the classic Kafka serdes ArtifactResolverStrategy -
AUTO_REGISTER_ARTIFACT
Optional, boolean to indicate whether serializer classes should attempt to create an artifact in the registry. Note: JsonSchema serializer does not support this feature yet.- See Also:
-
AUTO_REGISTER_ARTIFACT_DEFAULT
public static final boolean AUTO_REGISTER_ARTIFACT_DEFAULT- See Also:
-
AUTO_REGISTER_ARTIFACT_IF_EXISTS
Optional, one of "IfExists" to indicate the behavior of the client when there is a conflict creating an artifact because the artifact already exists.- See Also:
-
AUTO_REGISTER_ARTIFACT_IF_EXISTS_DEFAULT
- See Also:
-
FIND_LATEST_ARTIFACT
Optional, boolean to indicate whether serializer classes should attempt to find the latest artifact in the registry for the corresponding groupId/artifactId. GroupId and artifactId are configured either viaArtifactReferenceResolverStrategyor via config properties such asEXPLICIT_ARTIFACT_ID.- See Also:
-
FIND_LATEST_ARTIFACT_DEFAULT
public static final boolean FIND_LATEST_ARTIFACT_DEFAULT- See Also:
-
CACHE_LATEST
Iftrue, will cache schema lookups that either have `latest` or no version specified. Setting this to false will effectively disable caching for schema lookups that do not specify a version.- See Also:
-
CACHE_LATEST_DEFAULT
public static final boolean CACHE_LATEST_DEFAULT- See Also:
-
FAULT_TOLERANT_REFRESH
Iftrue, will log exceptions instead of throwing them when an error occurs trying to refresh a schema in the cache. This is useful for production situations where a stale schema is better than completely failing schema resolution. Note that this will not impact trying of retries, as retries are attempted before this flag is considered.- See Also:
-
FAULT_TOLERANT_REFRESH_DEFAULT
public static final boolean FAULT_TOLERANT_REFRESH_DEFAULT- See Also:
-
BACKGROUND_REFRESH_ENABLED
Iftrue, enables background refresh of expired cache entries following the "stale-while-revalidate" pattern. When an entry expires and a stale value exists, the cache will return the stale value immediately (non-blocking) and trigger an asynchronous refresh in the background. This prevents latency spikes in high-concurrency scenarios where multiple threads would otherwise block waiting for cache refresh. If no stale value exists (first fetch), falls back to synchronous refresh behavior. This option complementsFAULT_TOLERANT_REFRESH, which handles refresh failures rather than refresh latency.- See Also:
-
BACKGROUND_REFRESH_ENABLED_DEFAULT
public static final boolean BACKGROUND_REFRESH_ENABLED_DEFAULT- See Also:
-
BACKGROUND_REFRESH_EXECUTOR_THREADS
The number of threads in the background refresh executor pool. Only used whenBACKGROUND_REFRESH_ENABLEDis enabled. The executor uses a fixed thread pool with daemon threads to prevent blocking application shutdown. A value of 2-4 threads is typically sufficient for most workloads. Valid values are positive integers.- See Also:
-
BACKGROUND_REFRESH_EXECUTOR_THREADS_DEFAULT
public static final long BACKGROUND_REFRESH_EXECUTOR_THREADS_DEFAULT- See Also:
-
BACKGROUND_REFRESH_TIMEOUT_MS
The maximum time (in milliseconds) to wait for a background refresh operation to complete before timing out. Only used whenBACKGROUND_REFRESH_ENABLEDis enabled. If a background refresh exceeds this timeout, it will be interrupted and the stale value will continue to be served until the next refresh attempt. Valid values are positive integers.- See Also:
-
BACKGROUND_REFRESH_TIMEOUT_MS_DEFAULT
public static final long BACKGROUND_REFRESH_TIMEOUT_MS_DEFAULT- See Also:
-
EXPLICIT_ARTIFACT_GROUP_ID
Only applicable for serializers Optional, set explicitly the groupId used for querying/creating an artifact. Overrides the groupId returned by theArtifactReferenceResolverStrategy- See Also:
-
EXPLICIT_ARTIFACT_ID
Only applicable for serializers Optional, set explicitly the artifactId used for querying/creating an artifact. Overrides the artifactId returned by theArtifactReferenceResolverStrategy- See Also:
-
SCHEMA_LOCATION
Only applicable for serializers Optional, set explicitly the schema location in the classpath for the schema to be used for serializing the data.- See Also:
-
EXPLICIT_ARTIFACT_VERSION
Only applicable for serializers Optional, set explicitly the version used for querying/creating an artifact. Overrides the version returned by theArtifactReferenceResolverStrategy- See Also:
-
REGISTRY_URL
The URL of the Apicurio Registry. Required when using any Apicurio Registry serde class (serializer or deserializer).- See Also:
-
REGISTRY_URL_VERSION
The API version implemented by the URL endpoint indicated by the 'apicurio.registry.url' property. This is typically not required because the Registry Client will auto-detect the endpoint version based on the URL itself. However, in case the URL is non-standard or being rewritten by a proxy, or some other odd circumstance, set the property to the API version such as "2" or "3". Use the major version only.- See Also:
-
AUTH_TOKEN_ENDPOINT
The URL of the Token Endpoint.- See Also:
-
AUTH_CLIENT_ID
The Client Id of the Auth Service.- See Also:
-
AUTH_CLIENT_SECRET
The Secret of the Auth Service.- See Also:
-
AUTH_CLIENT_SCOPE
The Scope of the Auth Service.- See Also:
-
AUTH_USERNAME
The Username of the Auth Service.- See Also:
-
AUTH_PASSWORD
The Password of the Auth Service.- See Also:
-
CHECK_PERIOD_MS
Indicates how long to cache artifacts before auto-eviction. If not included, the artifact will be fetched every time.- See Also:
-
CHECK_PERIOD_MS_DEFAULT
public static final long CHECK_PERIOD_MS_DEFAULT- See Also:
-
RETRY_COUNT
If a schema can not be retrieved from the Registry, serdes may retry a number of times. This configuration option controls the number of retries before failing. Valid values are non-negative integers.- See Also:
-
RETRY_COUNT_DEFAULT
public static final long RETRY_COUNT_DEFAULT- See Also:
-
RETRY_BACKOFF_MS
If a schema can not be be retrieved from the Registry, serdes may retry a number of times. This configuration option controls the delay between the retry attempts, in milliseconds. Valid values are non-negative integers.- See Also:
-
RETRY_BACKOFF_MS_DEFAULT
public static final long RETRY_BACKOFF_MS_DEFAULT- See Also:
-
DEREFERENCE_SCHEMA
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.- See Also:
-
DEREFERENCE_DEFAULT
public static final boolean DEREFERENCE_DEFAULT- See Also:
-
CANONICALIZE
Used to indicate whether the schema resolver should canonicalize content when using content to lookup/search for an artifact version in the registry by content.- See Also:
-
CANONICALIZE_DEFAULT
public static final boolean CANONICALIZE_DEFAULT- See Also:
-
TLS_TRUSTSTORE_LOCATION
The location of the trust store file for TLS/SSL connections. Can be a file path or a resource on the classpath. Used when connecting to a registry over HTTPS with custom certificates.- See Also:
-
TLS_TRUSTSTORE_PASSWORD
The password for the trust store file specified byTLS_TRUSTSTORE_LOCATION. Required when using JKS or PKCS12 trust stores. Not required for PEM certificates.- See Also:
-
TLS_TRUSTSTORE_TYPE
The type of trust store. Valid values are "JKS", "PKCS12" (or "P12"), and "PEM". Defaults to "JKS".- See Also:
-
TLS_TRUSTSTORE_TYPE_DEFAULT
- See Also:
-
TLS_CERTIFICATES
PEM certificate configuration for TLS/SSL trust. This property accepts either:- Comma-separated list of PEM certificate file paths (e.g., "/path/to/cert1.pem,/path/to/cert2.pem")
- PEM certificate content as a string (one or more certificates with -----BEGIN CERTIFICATE----- markers)
TLS_TRUSTSTORE_LOCATIONwith a JKS file. When using this option, setTLS_TRUSTSTORE_TYPEto "PEM".The system automatically detects whether the value contains file paths or certificate content by checking for the presence of "-----BEGIN CERTIFICATE-----" markers.
- See Also:
-
TLS_TRUST_ALL
If true, disables all SSL/TLS certificate verification. This is insecure and should only be used in development/testing environments. Defaults to false.- See Also:
-
TLS_TRUST_ALL_DEFAULT
public static final boolean TLS_TRUST_ALL_DEFAULT- See Also:
-
TLS_VERIFY_HOST
If true, verifies that the hostname in the server certificate matches the server hostname. Defaults to true. Set to false only when necessary (e.g., when using IP addresses instead of hostnames).- See Also:
-
TLS_VERIFY_HOST_DEFAULT
public static final boolean TLS_VERIFY_HOST_DEFAULT- See Also:
-
PROXY_HOST
The HTTP/HTTPS proxy host for registry connections. Required when connecting through a proxy server. Can be a hostname or IP address.- See Also:
-
PROXY_PORT
The HTTP/HTTPS proxy port for registry connections. Required whenPROXY_HOSTis specified. Common proxy ports are 3128, 8080, or 8888.- See Also:
-
PROXY_USERNAME
Optional username for proxy authentication. Only required if the proxy server requires authentication.- See Also:
-
PROXY_PASSWORD
Optional password for proxy authentication. Only required if the proxy server requires authentication andPROXY_USERNAMEis specified.- See Also:
-
VERTX_INSTANCE
Internal property key for storing a Vertx instance. This is not typically set via string properties but rather programmatically when creating the configuration. When provided, this Vertx instance will be used for HTTP client connections instead of creating a new instance.Recommended: Provide your own managed Vertx instance to ensure proper lifecycle management and resource cleanup.
- See Also:
-
HTTP_ADAPTER
The HTTP adapter to use for registry client connections. Valid values are:- "AUTO" - Automatically detect and use the best available adapter (default). Prefers Vert.x if available, falls back to JDK if not.
- "VERTX" - Use the Vert.x HTTP adapter. Requires kiota-http-vertx dependency.
- "JDK" - Use the JDK 11+ HttpClient adapter. Requires kiota-http-jdk dependency. Provides a lighter-weight option with no additional dependencies beyond the JDK.
- See Also:
-
HTTP_ADAPTER_DEFAULT
- See Also:
-
OTEL_ENABLED
Whether to enable OpenTelemetry trace context propagation for HTTP requests to the Registry. When enabled, W3C trace context headers (traceparent,tracestate) will be injected into all outgoing requests.Requires the
opentelemetry-apilibrary to be on the classpath.- See Also:
-
OTEL_ENABLED_DEFAULT
public static final boolean OTEL_ENABLED_DEFAULT- See Also:
-
USAGE_TELEMETRY_CLIENT_ID
Identifier for the client application, sent as X-Registry-Client-Id header on schema fetch requests. When set, the registry server records usage telemetry for this client.- See Also:
-
-
Constructor Details
-
SchemaResolverConfig
public SchemaResolverConfig() -
SchemaResolverConfig
-
-
Method Details
-
getRegistryUrl
-
getRegistryUrlVersion
-
getTokenEndpoint
-
getAuthClientId
-
getAuthClientSecret
-
getAuthClientScope
-
getAuthUsername
-
getAuthPassword
-
getArtifactResolverStrategy
-
autoRegisterArtifact
public boolean autoRegisterArtifact() -
autoRegisterArtifactIfExists
-
getCacheLatest
public boolean getCacheLatest() -
getFaultTolerantRefresh
public boolean getFaultTolerantRefresh() -
getBackgroundRefresh
public boolean getBackgroundRefresh() -
getBackgroundRefreshExecutorThreads
public long getBackgroundRefreshExecutorThreads() -
getBackgroundRefreshTimeout
-
findLatest
public boolean findLatest() -
getCheckPeriod
-
getRetryCount
public long getRetryCount() -
getRetryBackoff
-
getExplicitArtifactGroupId
-
getExplicitArtifactId
-
getExplicitSchemaLocation
-
getExplicitArtifactVersion
-
resolveDereferenced
public boolean resolveDereferenced() -
isCanonicalize
public boolean isCanonicalize() -
getTlsTruststoreLocation
-
getTlsTruststorePassword
-
getTlsTruststoreType
-
getTlsCertificates
-
getTlsTrustAll
public boolean getTlsTrustAll() -
getTlsVerifyHost
public boolean getTlsVerifyHost() -
getProxyHost
-
getProxyPort
-
getProxyUsername
-
getProxyPassword
-
getVertx
public io.vertx.core.Vertx getVertx()Returns the Vertx instance if one was provided in the configuration.This allows callers to provide their own managed Vertx instance instead of relying on automatically created instances. This is the recommended approach for production environments to ensure proper lifecycle management.
- Returns:
- the configured Vertx instance, or null if not provided
-
getHttpAdapter
Returns the HTTP adapter type to use for registry client connections.- Returns:
- the HTTP adapter type string ("AUTO", "VERTX", or "JDK")
-
isOtelEnabled
public boolean isOtelEnabled()Returns whether OpenTelemetry trace context propagation is enabled.- Returns:
- true if OTel trace context propagation is enabled
-
getUsageTelemetryClientId
-
getDefaults
- Specified by:
getDefaultsin classAbstractConfig
-