Class SerdeConfig

java.lang.Object
io.apicurio.registry.serde.SerdeConfig

public class SerdeConfig extends Object
Contains all of the Serde configuration properties. These are all the property names used when configuring serde classes in Kafka apps via a Properties object. Serde classes can be used by creating them directly as well, in which case these property names are not relevant.
Author:
eric.wittmann@gmail.com, Fabian Martinez
  • Field Details

    • ARTIFACT_RESOLVER_STRATEGY

      public static final String ARTIFACT_RESOLVER_STRATEGY
      Fully qualified Java classname of a class that implements ArtifactResolverStrategy and is responsible for mapping between the Kafka serde information and an artifactId. For example there is a strategy to use the topic name as the schema's artifactId. Only used by the Serializer serde class.
      See Also:
    • ARTIFACT_RESOLVER_STRATEGY_DEFAULT

      public static final String ARTIFACT_RESOLVER_STRATEGY_DEFAULT
    • SCHEMA_RESOLVER

      public static final String SCHEMA_RESOLVER
      Fully qualified Java classname of a class that implements SchemaResolver. DefaultSchemaResolver is used by default. The SchemaResolver is used both by Serializer and Deserializer classes.
      See Also:
    • SCHEMA_RESOLVER_DEFAULT

      public static final String SCHEMA_RESOLVER_DEFAULT
    • IS_KEY

      public static final String IS_KEY
      Property used internally to mark that a component is being configured for a kafka message key.
      See Also:
    • AUTO_REGISTER_ARTIFACT

      public static final String 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

      public static final String 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

      public static final String AUTO_REGISTER_ARTIFACT_IF_EXISTS_DEFAULT
    • FIND_LATEST_ARTIFACT

      public static final String 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 via ArtifactResolverStrategy or via config properties such as EXPLICIT_ARTIFACT_ID.
      See Also:
    • FIND_LATEST_ARTIFACT_DEFAULT

      public static final boolean FIND_LATEST_ARTIFACT_DEFAULT
      See Also:
    • EXPLICIT_ARTIFACT_GROUP_ID

      public static final String EXPLICIT_ARTIFACT_GROUP_ID
      Only applicable for serializers Optional, set explicitly the groupId used for querying/creating an artifact. Overrides the groupId returned by the ArtifactResolverStrategy
      See Also:
    • EXPLICIT_ARTIFACT_ID

      public static final String EXPLICIT_ARTIFACT_ID
      Only applicable for serializers Optional, set explicitly the artifactId used for querying/creating an artifact. Overrides the artifactId returned by the ArtifactResolverStrategy
      See Also:
    • SCHEMA_LOCATION

      public static final String SCHEMA_LOCATION
      Only applicable for serializers Optional, set explicitly the schema used for serialization.
      See Also:
    • EXPLICIT_ARTIFACT_VERSION

      public static final String EXPLICIT_ARTIFACT_VERSION
      Only applicable for serializers Optional, set explicitly the version used for querying/creating an artifact. Overrides the version returned by the ArtifactResolverStrategy
      See Also:
    • REGISTRY_URL

      public static final String REGISTRY_URL
      The URL of the Apicurio Registry. Required when using any Apicurio Registry serde class (serializer or deserializer).
      See Also:
    • AUTH_TOKEN_ENDPOINT

      public static final String AUTH_TOKEN_ENDPOINT
      The URL of the Token Endpoint. Required when using any Apicurio Registry serde class (serializer or deserializer) against a secured Apicurio Registry and AUTH_SERVICE_URL is not specified.
      See Also:
    • AUTH_SERVICE_URL

      public static final String AUTH_SERVICE_URL
      The URL of the Auth Service. Required when using any Apicurio Registry serde class (serializer or deserializer) against a secured Apicurio Registry.
      See Also:
    • AUTH_SERVICE_URL_TOKEN_ENDPOINT

      public static final String AUTH_SERVICE_URL_TOKEN_ENDPOINT
      See Also:
    • AUTH_REALM

      public static final String AUTH_REALM
      The Realm of the Auth Service.
      See Also:
    • AUTH_CLIENT_ID

      public static final String AUTH_CLIENT_ID
      The Client Id of the Auth Service.
      See Also:
    • AUTH_CLIENT_SECRET

      public static final String AUTH_CLIENT_SECRET
      The Secret of the Auth Service.
      See Also:
    • AUTH_USERNAME

      public static final String AUTH_USERNAME
      The Username of the Auth Service.
      See Also:
    • AUTH_PASSWORD

      public static final String AUTH_PASSWORD
      The Password of the Auth Service.
      See Also:
    • ID_HANDLER

      public static final String ID_HANDLER
      Fully qualified Java classname of a class that implements IdHandler and is responsible for writing the schema's Global ID to the message payload. Only used when ENABLE_HEADERS is missing or 'false'.
      See Also:
    • ID_HANDLER_DEFAULT

      public static final String ID_HANDLER_DEFAULT
    • ENABLE_CONFLUENT_ID_HANDLER

      public static final String ENABLE_CONFLUENT_ID_HANDLER
      Shortcut for enabling the Legacy (Confluent compatible) implementation of IdHandler. Should not be used with "ID_HANDLER". The value should be 'true' or 'false'.
      See Also:
    • ENABLE_HEADERS

      public static final String ENABLE_HEADERS
      Boolean to indicate whether serde classes should pass Global Id information via message headers instead of in the message payload.
      See Also:
    • ENABLE_HEADERS_DEFAULT

      public static final boolean ENABLE_HEADERS_DEFAULT
      See Also:
    • HEADERS_HANDLER

      public static final String HEADERS_HANDLER
      Fully qualified Java classname of a class that implements HeadersHandler and is responsible for writing the schema's Global ID to the message headers. Only used when ENABLE_HEADERS is 'true'.
      See Also:
    • HEADERS_HANDLER_DEFAULT

      public static final String HEADERS_HANDLER_DEFAULT
    • CHECK_PERIOD_MS

      public static final String 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

      public static final String 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

      public static final String 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:
    • USE_ID

      public static final String USE_ID
      Configures the serdes to use the specified IdOption as the identifier for the artifacts. Instructs the serializer to write the specified id into the kafka records and instructs the deserializer to read and use the specified id from the kafka records (to find the schema).
      See Also:
    • USE_ID_DEFAULT

      public static final String USE_ID_DEFAULT
    • REQUEST_HEADERS_PREFIX

      public static final String REQUEST_HEADERS_PREFIX
      Config prefix that allows configuration of arbitrary HTTP client request headers used by the Registry REST Client in the serde class when communicating with the Registry. For example, this could be used to pass authentication information: apicurio.registry.request.headers.Authorization=BASIC Y2tlbnQ6a3J5cHQwbnIwY2tzIQ==
      See Also:
    • REQUEST_TRUSTSTORE_LOCATION

      public static final String REQUEST_TRUSTSTORE_LOCATION
      Location of a trust store to use when connecting to the registry via SSL.
      See Also:
    • REQUEST_TRUSTSTORE_TYPE

      public static final String REQUEST_TRUSTSTORE_TYPE
      Type of trust store to use when connecting to the registry via SSL.
      See Also:
    • REQUEST_TRUSTSTORE_PASSWORD

      public static final String REQUEST_TRUSTSTORE_PASSWORD
      Password of the trust store to use when connecting to the registry via SSL.
      See Also:
    • REQUEST_KEYSTORE_LOCATION

      public static final String REQUEST_KEYSTORE_LOCATION
      Location of a keystore to use when e.g. connecting to the registry via mTLS.
      See Also:
    • REQUEST_KEYSTORE_TYPE

      public static final String REQUEST_KEYSTORE_TYPE
      Type of keystore to use when e.g. connecting to the registry via mTLS.
      See Also:
    • REQUEST_KEYSTORE_PASSWORD

      public static final String REQUEST_KEYSTORE_PASSWORD
      Password of the keystore to use when e.g. connecting to the registry via mTLS.
      See Also:
    • REQUEST_KEY_PASSWORD

      public static final String REQUEST_KEY_PASSWORD
      Key password used when e.g. connecting to the registry via mTLS.
      See Also:
    • VALIDATION_ENABLED

      public static final String VALIDATION_ENABLED
      Boolean used to enable or disable validation. Not applicable to all serde classes. For example, the JSON Schema serde classes use this to enable or disable JSON Schema validation (unlike Avro, the JSON Schema schema is not required to serialize/deserialize the message payload).
      See Also:
    • VALIDATION_ENABLED_DEFAULT

      public static final boolean VALIDATION_ENABLED_DEFAULT
      See Also:
    • FALLBACK_ARTIFACT_GROUP_ID

      public static final String FALLBACK_ARTIFACT_GROUP_ID
      Only applicable for deserializers Optional, set explicitly the groupId used as fallback for resolving the artifact used for deserialization.
      See Also:
    • FALLBACK_ARTIFACT_ID

      public static final String FALLBACK_ARTIFACT_ID
      Only applicable for deserializers Optional, set explicitly the artifactId used as fallback for resolving the artifact used for deserialization.
      See Also:
    • FALLBACK_ARTIFACT_VERSION

      public static final String FALLBACK_ARTIFACT_VERSION
      Only applicable for deserializers Optional, set explicitly the version used as fallback for resolving the artifact used for deserialization.
      See Also:
    • FALLBACK_ARTIFACT_PROVIDER

      public static final String FALLBACK_ARTIFACT_PROVIDER
      Only applicable for deserializers Optional, allows to set a custom implementation of FallbackArtifactProvider , for resolving the artifact used for deserialization.
      See Also:
    • FALLBACK_ARTIFACT_PROVIDER_DEFAULT

      public static final String FALLBACK_ARTIFACT_PROVIDER_DEFAULT
    • DESERIALIZER_SPECIFIC_KEY_RETURN_CLASS

      public static final String DESERIALIZER_SPECIFIC_KEY_RETURN_CLASS
      Fully qualified Java classname of a class that will be used as the return type for the deserializer. Aplicable for keys deserialization. Forces the deserializer to return objects of this type, if not present the return type will be obtained from the message headers, if updated by the serializer. Supported by JsonSchema and Protobuf deserializers.
      See Also:
    • DESERIALIZER_SPECIFIC_VALUE_RETURN_CLASS

      public static final String DESERIALIZER_SPECIFIC_VALUE_RETURN_CLASS
      Fully qualified Java classname of a class that will be used as the return type for the deserializer. Aplicable for values deserialization. Forces the deserializer to return objects of this type, if not present the return type will be obtained from the message headers, if updated by the serializer. Supported by JsonSchema and Protobuf deserializers.
      See Also:
    • HEADER_KEY_GROUP_ID_OVERRIDE_NAME

      public static final String HEADER_KEY_GROUP_ID_OVERRIDE_NAME
      Used to override the Kafka message header name used to pass the groupId for the message key. Only applicable when ENABLE_HEADERS is enabled. Default value is SerdeHeaders.HEADER_KEY_GROUP_ID.
      See Also:
    • HEADER_VALUE_GROUP_ID_OVERRIDE_NAME

      public static final String HEADER_VALUE_GROUP_ID_OVERRIDE_NAME
      Used to override the Kafka message header name used to pass the groupId for the message value. Only applicable when ENABLE_HEADERS is enabled. Default value is SerdeHeaders.HEADER_VALUE_GROUP_ID.
      See Also:
    • HEADER_KEY_ARTIFACT_ID_OVERRIDE_NAME

      public static final String HEADER_KEY_ARTIFACT_ID_OVERRIDE_NAME
      Used to override the Kafka message header name used to pass the artifactId for the message key. Only applicable when ENABLE_HEADERS is enabled. Default value is SerdeHeaders.HEADER_KEY_ARTIFACT_ID.
      See Also:
    • HEADER_VALUE_ARTIFACT_ID_OVERRIDE_NAME

      public static final String HEADER_VALUE_ARTIFACT_ID_OVERRIDE_NAME
      Used to override the Kafka message header name used to pass the artifactId for the message value. Only applicable when ENABLE_HEADERS is enabled. Default value is SerdeHeaders.HEADER_VALUE_ARTIFACT_ID.
      See Also:
    • HEADER_KEY_VERSION_OVERRIDE_NAME

      public static final String HEADER_KEY_VERSION_OVERRIDE_NAME
      Used to override the Kafka message header name used to pass the version for the message key. Only applicable when ENABLE_HEADERS is enabled. Default value is SerdeHeaders.HEADER_KEY_VERSION.
      See Also:
    • HEADER_VALUE_VERSION_OVERRIDE_NAME

      public static final String HEADER_VALUE_VERSION_OVERRIDE_NAME
      Used to override the Kafka message header name used to pass the version for the message value. Only applicable when ENABLE_HEADERS is enabled. Default value is SerdeHeaders.HEADER_VALUE_VERSION.
      See Also:
    • HEADER_KEY_GLOBAL_ID_OVERRIDE_NAME

      public static final String HEADER_KEY_GLOBAL_ID_OVERRIDE_NAME
      Used to override the Kafka message header name used to pass the globalId for the message key. Only applicable when ENABLE_HEADERS is enabled. Default value is SerdeHeaders.HEADER_KEY_GLOBAL_ID.
      See Also:
    • HEADER_VALUE_GLOBAL_ID_OVERRIDE_NAME

      public static final String HEADER_VALUE_GLOBAL_ID_OVERRIDE_NAME
      Used to override the Kafka message header name used to pass the globalId for the message value. Only applicable when ENABLE_HEADERS is enabled. Default value is SerdeHeaders.HEADER_VALUE_GLOBAL_ID.
      See Also:
    • HEADER_KEY_CONTENT_ID_OVERRIDE_NAME

      public static final String HEADER_KEY_CONTENT_ID_OVERRIDE_NAME
      Used to override the Kafka message header name used to pass the contentId for the message key. Only applicable when ENABLE_HEADERS is enabled. Default value is SerdeHeaders.HEADER_KEY_CONTENT_ID.
      See Also:
    • HEADER_VALUE_CONTENT_ID_OVERRIDE_NAME

      public static final String HEADER_VALUE_CONTENT_ID_OVERRIDE_NAME
      Used to override the Kafka message header name used to pass the contentId for the message value. Only applicable when ENABLE_HEADERS is enabled. Default value is SerdeHeaders.HEADER_VALUE_CONTENT_ID.
      See Also:
    • HEADER_KEY_CONTENT_HASH_OVERRIDE_NAME

      public static final String HEADER_KEY_CONTENT_HASH_OVERRIDE_NAME
      Used to override the Kafka message header name used to pass the contentHash for the message key. Only applicable when ENABLE_HEADERS is enabled. Default value is SerdeHeaders.HEADER_KEY_CONTENT_HASH.
      See Also:
    • HEADER_VALUE_CONTENT_HASH_OVERRIDE_NAME

      public static final String HEADER_VALUE_CONTENT_HASH_OVERRIDE_NAME
      Used to override the Kafka message header name used to pass the contentHash for the message value. Only applicable when ENABLE_HEADERS is enabled. Default value is SerdeHeaders.HEADER_VALUE_CONTENT_HASH.
      See Also:
    • HEADER_KEY_MESSAGE_TYPE_OVERRIDE_NAME

      public static final String HEADER_KEY_MESSAGE_TYPE_OVERRIDE_NAME
      Used to override the Kafka message header name used to pass the message type for the message key. Only applicable when ENABLE_HEADERS is enabled. Only used by the JSON Schema serde classes. Default value is SerdeHeaders.HEADER_KEY_MESSAGE_TYPE.
      See Also:
    • HEADER_VALUE_MESSAGE_TYPE_OVERRIDE_NAME

      public static final String HEADER_VALUE_MESSAGE_TYPE_OVERRIDE_NAME
      Used to override the Kafka message header name used to pass the message type for the message value. Only applicable when ENABLE_HEADERS is enabled. Only used by the JSON Schema serde classes. Default value is SerdeHeaders.HEADER_VALUE_MESSAGE_TYPE.
      See Also:
  • Constructor Details

    • SerdeConfig

      public SerdeConfig()