Github user afs commented on a diff in the pull request:

    https://github.com/apache/jena/pull/271#discussion_r130092145
  
    --- Diff: jena-arq/src/main/java/org/apache/jena/riot/RDFParserBuilder.java 
---
    @@ -504,8 +504,10 @@ private HttpClient buildHttpClient() {
                 Header header = new BasicHeader(k, v);
                 hdrs.add(header);
             });
    -        HttpClient hc = 
CachingHttpClientBuilder.create().setDefaultHeaders(hdrs).build();
    -        return hc;
    +        HttpClient hc = HttpOp.createPoolingHttpClientBuilder()
    --- End diff --
    
    A possibility though I like that HttpOp is neutral as to its usage - it is 
not RDF-specific and the default headers are none.  There are different headers 
for graph, datasets and result sets. Responsibility for the customization is in 
the RDFParser which here (this is the case of the app making detailed settings) 
captures those choices for a reusable parser process.
    
    Adding to the complexity of HttpOp.createPoolingHttpClient seems a slippery 
slope that goes against the builder pattern (IMO). It would be easier if there 
were an HttpComponents way to say "make a builder that would produce this 
HttpClient" capturing the internal settings details of an HttpClient.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

Reply via email to