Kafka StreamConfig:
Properties properties = new Properties();
properties.put(StreamsConfig.DEFAULT_DESERIALIZATION_EXCEPTION_HANDLER_CLASS_CONFIG , LogAndContinueExceptionHandler.class);
...
For example i have custom deserializer implementation:
public class KeyDeserializer implements Deserializer<Key>
Is my assumption right - if any Runtime exception that will occur during deserialization in deserialize
method will be cached by default deserialization exception handler or only some kind of Kafka specific ones?
@Override
public Key deserialize(String s, byte[] bytes)
I have not found any explanation in docs. I must be sure that whatever happens during deserialization stream going to log and continue streaming.
Yes, you are correct. When Kafka Streams attempts to deserialize, any exception that occurs is handed over to the DeserializationExceptionHandler
, so it's up to the handler how to handle it.
The default config uses the LogAndFailExceptionHandler, which does just what the name implies. Kafka Streams also provides a LogAndContinueExceptionHandler, or you could provide your own implementation.