Springboot @retryable not retrying

前端 未结 6 1228
再見小時候
再見小時候 2021-02-19 11:03

The following code is not retrying. What am I missing?

@EnableRetry
@SpringBootApplication
public class App implements CommandLineRunner
{
    .........
    ....         


        
6条回答
  •  伪装坚强ぢ
    2021-02-19 11:38

    For the @Retryable annotation on the method to be discovered it needs to be called correctly from an initialised context. Is the method invoked from a bean from the spring context or called by other means?

    If testing this is your runner using the SpringJunit4ClassRunner?

提交回复
热议问题