0
It is possible to create an asynchronous method that can be tried again if some exception occurs with spring?
@Retryable
@Async
public void myMethod() throws Exception {
// Do some stuff
}
0
It is possible to create an asynchronous method that can be tried again if some exception occurs with spring?
@Retryable
@Async
public void myMethod() throws Exception {
// Do some stuff
}
Browser other questions tagged java spring async spring-boot
You are not signed in. Login or sign up in order to post.
Yes, what problem are you having? Usually use with
@Retryable
in a separate method and it is called by the method executed asynchronously.– Bruno César
I would like to make the asynchronous execution of a method and if the execution failed, a new attempt would be made, to achieve this I created two classes the first with the method annotated with <code>@Async</code> and the second with the <code>@Retryable</code> method and I only delegate the function from the first to the second class.
– Marcos Costa Pinto
You are trying to work with two processors at the same time. Have you thought about separating the invocation from the execution ?
– Tiarê
A possible solution I imagined was split into two classes: one with Async calling the other with Retryable
– Marcos Costa Pinto