Class SchemaFetchPendingException
java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
org.apache.kafka.common.KafkaException
org.apache.kafka.common.errors.ApiException
org.apache.kafka.common.errors.RetriableException
io.krabka.streams.schema.SchemaFetchPendingException
- All Implemented Interfaces:
Serializable
public final class SchemaFetchPendingException
extends org.apache.kafka.common.errors.RetriableException
Signals that a background writer-schema fetch has not completed.
SchemaCache.writerSchema(int) never blocks. When a deserializer meets a
schema ID that is not cached yet, the cache starts one asynchronous registry fetch
and throws this exception. It extends Kafka's RetriableException, so a
consumer or streams runtime retries the record; by then the fetch has usually
completed and deserialization succeeds.
Example
try {
var order = serde.deserializer().deserialize("orders", bytes);
} catch (SchemaFetchPendingException pending) {
// Schema id is being fetched in the background; retry the record shortly.
retryLater(pending.schemaId());
}
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionSchemaFetchPendingException(int schemaId) Creates the exception for one pending schema ID. -
Method Summary
Modifier and TypeMethodDescriptionintschemaId()Returns the schema ID whose writer schema is being fetched.Methods inherited from class org.apache.kafka.common.errors.ApiException
fillInStackTraceMethods inherited from class Throwable
addSuppressed, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
Constructor Details
-
SchemaFetchPendingException
public SchemaFetchPendingException(int schemaId) Creates the exception for one pending schema ID.- Parameters:
schemaId- the schema ID whose writer schema is being fetched
-
-
Method Details
-
schemaId
public int schemaId()Returns the schema ID whose writer schema is being fetched.- Returns:
- the pending schema ID
-