Skip to content
This repository has been archived by the owner on Aug 22, 2019. It is now read-only.

Commit

Permalink
14607: SolrJ client - Ensure Solr's HTTP connections are persistent
Browse files Browse the repository at this point in the history
Provided means to disable "Connection: Keep-Alive" as requested.
  • Loading branch information
Kirk True committed Mar 20, 2013
1 parent 486cccc commit 2f65e1d
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
2 changes: 1 addition & 1 deletion pom.xml
Expand Up @@ -4,7 +4,7 @@
<groupId>com.mustardgrain.solr</groupId>
<artifactId>solrj-ex</artifactId>
<packaging>jar</packaging>
<version>1.0-alpha2</version>
<version>1.0-alpha3</version>
<name>SolrJ client based off of LBHttpSolrServer</name>
<dependencies>
<dependency>
Expand Down
10 changes: 10 additions & 0 deletions src/main/java/com/mustardgrain/solr/SolrClient.java
Expand Up @@ -337,6 +337,16 @@ public void process(HttpRequest request, HttpContext context) throws HttpExcepti
});
}

public void disableConnectonHeader() {
((AbstractHttpClient) httpClient).addRequestInterceptor(new HttpRequestInterceptor() {

@Override
public void process(HttpRequest request, HttpContext context) throws HttpException, IOException {
request.removeHeaders("Connection");
}
});
}

/**
* Tries to query a live server from the list provided in Req. Servers in
* the dead pool are skipped. If a request fails due to an IOException, the
Expand Down

0 comments on commit 2f65e1d

Please sign in to comment.