Class 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 Detail

      • 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:
        Constant Field Values
      • ARTIFACT_RESOLVER_STRATEGY_DEFAULT

        public static final String ARTIFACT_RESOLVER_STRATEGY_DEFAULT
      • 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:
        Constant Field Values
      • 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:
        Constant Field Values
      • AUTO_REGISTER_ARTIFACT_DEFAULT

        public static final boolean AUTO_REGISTER_ARTIFACT_DEFAULT
        See Also:
        Constant Field Values
      • 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:
        Constant Field Values
      • 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:
        Constant Field Values
      • FIND_LATEST_ARTIFACT_DEFAULT

        public static final boolean FIND_LATEST_ARTIFACT_DEFAULT
        See Also:
        Constant Field Values
      • 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:
        Constant Field Values
      • 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:
        Constant Field Values
      • 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:
        Constant Field Values
      • 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:
        Constant Field Values
      • 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:
        Constant Field Values
      • 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:
        Constant Field Values
      • 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:
        Constant Field Values
      • 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:
        Constant Field Values
      • 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:
        Constant Field Values
      • ENABLE_HEADERS_DEFAULT

        public static final boolean ENABLE_HEADERS_DEFAULT
        See Also:
        Constant Field Values
      • 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:
        Constant Field Values
      • 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:
        Constant Field Values
      • CHECK_PERIOD_MS_DEFAULT

        public static final long CHECK_PERIOD_MS_DEFAULT
        See Also:
        Constant Field Values
      • 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:
        Constant Field Values
      • 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:
        Constant Field Values
      • RETRY_BACKOFF_MS_DEFAULT

        public static final long RETRY_BACKOFF_MS_DEFAULT
        See Also:
        Constant Field Values
      • 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:
        Constant Field Values
      • 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:
        Constant Field Values
      • 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:
        Constant Field Values
      • 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:
        Constant Field Values
      • 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:
        Constant Field Values
      • 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:
        Constant Field Values
      • 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:
        Constant Field Values
      • 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:
        Constant Field Values
      • REQUEST_KEY_PASSWORD

        public static final String REQUEST_KEY_PASSWORD
        Key password used when e.g. connecting to the registry via mTLS.
        See Also:
        Constant Field Values
      • 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:
        Constant Field Values
      • VALIDATION_ENABLED_DEFAULT

        public static final boolean VALIDATION_ENABLED_DEFAULT
        See Also:
        Constant Field Values
      • 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:
        Constant Field Values
      • 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:
        Constant Field Values
      • 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:
        Constant Field Values
      • 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:
        Constant Field Values
      • 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:
        Constant Field Values
      • 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:
        Constant Field Values
    • Constructor Detail

      • SerdeConfig

        public SerdeConfig()