[
https://issues.apache.org/jira/browse/SOLR-13683?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16907782#comment-16907782
]
Cao Manh Dat commented on SOLR-13683:
-------------------------------------
This one
{code}
Http2SolrClient.Builder().withHttpClient(Http2SolrClient httpClient)
{code}
is used for sharing connections pool between multiple {{Http2SolrClient}}s.
The idea here to hiding the underlying {{HttpClient}} (what if we want to
switch to different client in the future?). More over it help us preventing
access to {{HttpClient}}. Even in Solr code base right now. Manually modifying
HttpClient to change {{connectionTimeout}} and {{socketTimeout}} without going
through provided methods by Http[2]SolrClient is common. This is not good and
sometime quite confusing for knowing exact params are used by underlying
HttpClient.
{quote}
Http2SolrClient does not allow configuring custom headers
{quote}
It does, if you want to set basic auth for a specific request uses
{{SolrRequest#setBasicAuthCredentials}}.
If you want to set basic auth for all requests sent by {{Http2SolrClient}} uses
{{PreemptiveBasicAuthClientBuilderFactory#setup()}}.
If {{PreemptiveBasicAuthClientBuilderFactory}} behaviour is not suitable for
you, you can always add your own custom headers by using
{{Http2SolrClient#addListenerFactory()}}.
> SolrJ 8.1.1 Http2SolrClient should allow customizing HTTP headers
> -----------------------------------------------------------------
>
> Key: SOLR-13683
> URL: https://issues.apache.org/jira/browse/SOLR-13683
> Project: Solr
> Issue Type: Improvement
> Security Level: Public(Default Security Level. Issues are Public)
> Components: clients - java
> Affects Versions: 8.1.1
> Reporter: Niranjan Nanda
> Priority: Minor
>
> Currently {{Http2SolrClient}} does not allow configuring custom headers. For
> example, how to pass Basic Auth headers? It should expose some builder APIs
> to pass such headers.
--
This message was sent by Atlassian JIRA
(v7.6.14#76016)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]