[ 
https://issues.apache.org/jira/browse/SOLR-6625?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Gregory Chanan updated SOLR-6625:
---------------------------------
    Attachment: SOLR-6625.patch

Here's another version of the patch around what I described from the previous 
post.

Changes:
- Is more explicit about the when the callback fires, it's called 
preExecuteRequest now to indicate it's called before  HttpClient.execute
- Passes the solrRequest via the callback now, so an implementation can call 
getPreemptiveAuthentication or similar as implemented in SOLR-4470
- Callback can return an HttpContext to use.  HttpContext implementation in 
HttpSolrServer is borrowed from SOLR-4470.
HttpContext seems sufficient as a return value; I was originally thinking an 
extensible class.  But the only execute params that take an HttpUriRequest 
(from 
http://hc.apache.org/httpcomponents-client-ga/httpclient/apidocs/org/apache/http/client/HttpClient.html#execute%28org.apache.http.client.methods.HttpUriRequest,%20org.apache.http.client.ResponseHandler,%20org.apache.http.protocol.HttpContext%29)
 are the request, the response handler, and the context.  We can already modify 
the request via the callback, and solr has its own response handler 
functionality, so I'm not sure of a case where we'd need to modify HttpClient's 
responseHandler.
- Adds a test to BasicHttpSolrServerTests that exercises providing a context by 
adding some cookies.

> HttpClient callback in HttpSolrServer
> -------------------------------------
>
>                 Key: SOLR-6625
>                 URL: https://issues.apache.org/jira/browse/SOLR-6625
>             Project: Solr
>          Issue Type: Improvement
>          Components: SolrJ
>            Reporter: Gregory Chanan
>            Assignee: Gregory Chanan
>            Priority: Minor
>         Attachments: SOLR-6625.patch, SOLR-6625.patch
>
>
> Some of our setups use Solr in a SPNego/kerberos setup (we've done this by 
> adding our own filters to the web.xml).  We have an issue in that SPNego 
> requires a negotiation step, but some HttpSolrServer requests are not 
> repeatable, notably the PUT/POST requests.  So, what happens is, 
> HttpSolrServer sends the requests, the server responds with a negotiation 
> request, and the request fails because the request is not repeatable.  We've 
> modified our code to send a repeatable request beforehand in these cases.
> It would be nicer if HttpSolrServer provided a pre/post callback when it was 
> making an httpclient request.  This would allow administrators to make 
> changes to the request for authentication purposes, and would allow users to 
> make per-request changes to the httpclient calls (i.e. modify httpclient 
> requestconfig to modify the timeout on a per-request basis).



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to