Timeout for rest calls

Jmix version: 2.0.1
Jmix Studio plugin version: 2.1.3-231
I have a button that triggers a POST request to another service which is implemented using RestTemplate. This request takes about 3 minutes to process. While it processes I get a black strip where loading bar is, saying “Lost connection”. I think this is a timeout issue. Can someone help me on this?

Hello @nipunaw,

This behavior occurs because the main thread is blocked. You can create a request using Async Tasks. This way it will be executed asynchronously.

https://docs.jmix.io/jmix/flow-ui/async-tasks.html

Also check out the additional option with background task.
https://docs.jmix.io/jmix/flow-ui/background-tasks.html

Regards,
Nikita

Hello @shchienko ,
It is a flow with multiple tabs and the next tab’s data is created in this process. After the first rest call completes, it redirects to the next tab which includes data which is created from this rest call. So I need this to be completed before redirecting to next tab.