Hello my friend!
There are several approaches we can use to try to improve this process…
for example, if you use HttpClient, in your configuration bean we can increase the timeout time, as per my example below:
HttpClient client = HttpClient.newBuilder()
.connectTimeout(Duration.ofSeconds(60))
.build();
If your Camunda application is running spring, you can increase your server’s timeout time by configuring in application.properties:
server.servlet.session.timeout=60s
You can also increase your Connection Pool, for example:
spring.datasource.hikari.maximum-pool-size=50
spring.datasource.hikari.minimum-idle=10
spring.datasource.hikari.idle-timeout=30000
spring.datasource.hikari.connection-timeout=60000
Another thing you can do is increase the number of threads in the executor job:
camunda.bpm.job-execution.core-pool-size=50
camunda.bpm.job-execution.max-pool-size=100
camunda.bpm.job-execution.queue-capacity=10
camunda.bpm.job-execution.max-jobs-per-acquisition=10
And last but not least, it would be interesting to divide these requests into smaller numbers using batch processing… Spring Batch
is a great tool for this… and with it you can use the chunk()
method if not I’m wrong, and divide requests into batches of 100 for example.
After having the batch service ready, you create a controller
to call this service so as not to overload your server.
But these are just a few approaches we can take…
In addition to the ones I mentioned above, you can also talk to your infrastructure team to configure an auto-scale… load balancers, implement queues like Amazon SQS (excellent for those who maintain the entire infrastructure in AWS)…
Anyway, I hope I helped with some ideas.
William Robert Alves