Reputation: 286
I created an asynchronous Spring REST service by calling an `@Async` method and returning a `CompletableFuture` as the response in my `@RestController`.
Is there any way to disable the timeout for these asynchronous requests? Because the `@Async` method I am calling always takes a different amount of time, from 1 to 15 minutes depending on the current workload of the service and the parameters I passed in the request.
Right now I set the timeout for asynchronous requests to 30 minutes just to be sure not to run into a timeout. Is there any way of disabling the timeout?
Upvotes: 0
Views: 1827
Reputation: 2017
You can use spring.mvc.async.request-timeout
to set the timeout. Not sure if there is a way to disable it maybe 0 can work. However even if your timeout is very long, you should consider to keep one to avoid blocking your application if the ask may never complete.
Upvotes: 1