Document combining @Retryable with proxy-based features#37005
Open
jhan0121 wants to merge 1 commit into
Open
Conversation
Add a "Combining @retryable with Other Proxy-Based Features" section to the resilience reference documentation, covering interaction with @transactional, @Cacheable, and @async, as well as advice order customization between @retryable and @async via @EnableResilientMethods(order) and @EnableAsync(order). Also document the advice chain semantics in @retryable Javadoc, add cross-reference TIP blocks in the @async and @transactional reference sections, add a @Cacheable combination test to RetryInterceptorTests, and add RetryableTransactionTests in spring-tx for the @transactional combination. Closes spring-projectsgh-35584 Signed-off-by: jhan0121 <jhan0121@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Document the semantics of combining
@Retryablewith other proxy-based annotations (@Transactional,@Cacheable, and@Async), addressing the advice chain ordering that determines retry behavior.Changes
Tests
withCacheableAnnotation()toRetryInterceptorTestsverifying that retry is applied outside the cache interceptor (Retry OUTER -> Cache INNER).RetryableTransactionTestsinspring-txverifying that each retry attempt starts a fresh transaction (Retry OUTER -> TX INNER). Placed inspring-txto avoid a circular module dependency.Javadoc
@Retryabledocumenting the proxy interaction semantics and pointing toEnableResilientMethods#order()andEnableAsync#order()for customizing the order relative to@Async(the order relative to@Transactional/@Cacheableis fixed).Reference documentation
@Retryablewith Other Proxy-Based Features" section toresilience.adoc, covering the default advice chain order for each combination, and advice order customization between@Retryableand@Asyncvia@EnableResilientMethods(order)/@EnableAsync(order)(this customization does not apply to@Transactional/@Cacheable,whose shared
InfrastructureAdvisorAutoProxyCreatoralways runs first).@Transactionaland@Asyncreference sections pointing to the new combining section.Spring Boot compatibility
Verified with a dedicated validation repository (https://github.com/jhan0121/spring-resilience-boot-validation) that the advice chain order is consistent across all Spring Boot 4.x GA releases (4.0.0 through 4.1.0) under auto-configuration:
@Retryable+@Transactional@Retryable+@Cacheable@Retryable+@AsyncCloses gh-35584