[
https://issues.apache.org/jira/browse/JENA-1528?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Nicolas Labrot updated JENA-1528:
---------------------------------
Comment: was deleted
(was: This commit meets my need. Thank you very much.
Let me allow to make a side remark, what is a bit misleading is that the
timeout can be set using 3 different ways:
- When building the http client
{{QueryEngineHTTP#QueryEngineHTTP(java.lang.String,
org.apache.jena.query.Query, org.apache.http.client.HttpClient)}}:
{code}
RequestConfig config = RequestConfig.custom()
.setConnectTimeout(connectTimeout)
.setConnectionRequestTimeout(connectionRequestTimeout)
.setSocketTimeout(connectionReadTimeout).build();
CloseableHttpClient httpClient =
HttpClients.custom().setDefaultRequestConfig(config).build();
{code}
But this method does not work because the context seems to be erased
({{org.apache.jena.sparql.engine.http.HttpQuery#exec}})
- Passing the HttpContent to
{{QueryEngineHTTP#QueryEngineHTTP(java.lang.String,
org.apache.jena.query.Query, org.apache.http.client.HttpClient,
org.apache.http.protocol.HttpContext)}}
{code}
RequestConfig config = RequestConfig.custom()
.setConnectTimeout(connectTimeout)
.setConnectionRequestTimeout(connectionRequestTimeout)
.setSocketTimeout(connectionReadTimeout).build();
HttpClientContext context = new HttpClientContext();
context.setRequestConfig(config);
{code}
- And then {{QueryEngineHTTP#setTimeout(long, java.util.concurrent.TimeUnit,
long, java.util.concurrent.TimeUnit)}}
{{HttpClient}} is a sharable resource. In order to handle this use, does it
make sense to you in
{{org.apache.jena.sparql.engine.http.QueryEngineHTTP#makeHttpQuery}}, to
retrieve the {{RequestConfig}} from the {{HttpClient/Configurable}} and
initialize the context with this default configuration?
)
> HttpQuery does not set the readTimeout
> --------------------------------------
>
> Key: JENA-1528
> URL: https://issues.apache.org/jira/browse/JENA-1528
> Project: Apache Jena
> Issue Type: Bug
> Components: ARQ
> Affects Versions: Jena 3.7.0
> Reporter: Nicolas Labrot
> Assignee: A. Soroka
> Priority: Minor
> Fix For: Jena 3.8.0
>
>
> {{org.apache.jena.sparql.engine.http.HttpQuery#contextualizeTimeoutSettings}}
> sets the connectTimeout but not the readTimeout
>
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)