Configuring HttpClient timeouts (like socketimeout) in flowable-rest app

Hi all,
I’m struggling trying to avoid IO Exception (due to timeout) in BPMN process using Http Task taking longer times to get data. I’m using flowable 6.2.0 and the flowable-rest.war.

  • Could you confirm that “Request timeout” property in Http-Tasks is not enough? (I suppose it’s not affecting socket timeout or so)

  • If so, how I can configure all HttpClient timeouts to ensure enough time to get data? I’m using the flowable-rest.war. Any way to avoid modifiying the WAR or struggling with the complex custom-flowable-xml-context.xml?

  • Can I update the HttpClient config via Script Tasks (Javascript or Groovy) or via Execution Listener?

  • If not so, any option in the engine.properties?

  • If not so, any way to only add minimum things to this custom-flowable-xml-context.xml to let others things as default? Any working custom-flowable-xml-context.xml?

If there’re other ideas to avod this timeouts will be appreacited.

Many thanks!!!

Hi Jespriu,

Could you confirm that “Request timeout” property in Http-Tasks is not enough? (I suppose it’s not affecting socket timeout or so)

Yes. The pull request to apply process model request timeout with higher priority than processEngine configuration request timeout is fixing process model httpRequest timeout precedence before engineConf by martin-grofcik · Pull Request #755 · flowable/flowable-engine · GitHub. (Thank you to point it out)
If you want to perform a request with your own class you can specify it in the process model.

If so, how I can configure all HttpClient timeouts to ensure enough time to get data?

Have a look on fixing process model httpRequest timeout precedence before engineConf by martin-grofcik · Pull Request #755 · flowable/flowable-engine · GitHub

Can I update the HttpClient config via Script Tasks (Javascript or Groovy) or via Execution Listener?

Yes, but I would not do so. As you can see in the test from the previous quote you can do that, but settings are applied on the whole engine and not only on the particular process instance.

In the case when timeOuts were too long I would prefer to make asynchronous calls to the remote service instead of sync. calls.

How to set timeouts:
use org.flowable.engine.ProcessEngineConfiguration#setHttpClientConfig.

Regards
Martin