I'm studying Spring Kafka, and I came across the @Retryable annotation, which supposedly implements retry logic asynchronously according to the annotation's comments. However, while examining the code at my level, I couldn't find any logic that creates asynchronous threads for processing.
So, my guess is, when they mention "asynchronous," are they referring to not handling exceptions and instead throwing error events to the retry topic?
Or is there some hidden asynchronous logic in the code that I couldn't find?
Thank you.
The classes I've looked into include RetryableTopic, RetryTopicConfigurer, DestinationTopicProcessor, and RetryableTopicAnnotationProcessor.
This is called "asynchronous" or "non-blocking" because that retry topic logic sends a record to some intermediate topic and forget. This topic is consumed in other consumer thread and records is delivered to the listener method. There is no need in threads in between because Apache Kafka broker is involved in the process and that is indeed done asynchronously.
See more info in docs: https://docs.spring.io/spring-kafka/reference/html/#retry-topic