1 year ago
#75529
Jake Baum
Queries to Salesforce using REST API intermittent timeout
I asked this question in the Salesforce Stack Overflow about a week ago and wanted to repost it hear but with a slightly different approach: https://salesforce.stackexchange.com/questions/366936/salesforce-rest-api-intermittent-timeouts
As a bit of background, I have a Spring Boot application that connects to a Salesforce environment and essentially uses it as a database. Thus the Spring Boot app makes calls to the Salesforce REST API in order to create/update objects, as well as query them.
The issue that I am running into is that when calling the query endpoint (/services/data/v34.0/query?q=
), roughly 5% of the time the request times out and I get this error in my application:
org.springframework.web.client.ResourceAccessException: I/O error on GET request for "https://X.my.salesforce.com/services/data/v34.0/query": Read timed out; nested exception is java.net.SocketTimeoutException: Read timed out
As stated, this request works most of the time but unfortunately it fails enough to cause great instability within the application.
The reason I am re-asking this question here is because I have some additional non-Salesforce related questions. It's worth noting that the app makes plenty of other outbound requests to other services which are always successful, or they don't time out at least.
Given this information:
- Can we be certain that this is an issue with our Salesforce environment or could this be a client side (Spring Boot) issue?
- Is there a way to confirm this? i.e. Get any more information about why the requests might be timing out.
I have tried setting the read timeout value for outbound requests in the RestTemplate
to very high values, but this just increases the length of time before a timeout happens. These query requests typically take less than a second to run when they do not timeout.
I have also done some profiling of the running JVM and can't see anything abnormal when these timeouts happen. There is still plenty of available memory and CPU resources, as well as available threads when this happens.
Please let me know if you require any more information about this, and thank you in advance for any help!
spring-boot
salesforce
timeout
0 Answers
Your Answer