[jira] [Commented] (SOLR-13683) SolrJ 8.1.1 Http2SolrClient should allow customizing HTTP headers

2019-08-23 Thread Niranjan Nanda (Jira)


[ 
https://issues.apache.org/jira/browse/SOLR-13683?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16914714#comment-16914714
 ] 

Niranjan Nanda commented on SOLR-13683:
---

I am not sure; but I do not think you guys have decoupled yourself completely 
from Jetty. For example {{*_HttpListenerFactory_*}} uses the Jetty APIs. If you 
really want to abstract users of your APIs completely from underneath HTTP 
libraries, you should define your own abstraction for everything - connection 
pool size (may be type too), timeouts - everything globally applicable to HTTP. 

The API {{*_Http2SolrClient_*}} is not very clear in intent. It allows setting 
max connection per host, connection timeout - which are HTTP related, but not 
setting HTTP headers. Why is so?

 

 

> 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
(v8.3.2#803003)

-
To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org
For additional commands, e-mail: dev-h...@lucene.apache.org



[jira] [Commented] (SOLR-13683) SolrJ 8.1.1 Http2SolrClient should allow customizing HTTP headers

2019-08-14 Thread Cao Manh Dat (JIRA)


[ 
https://issues.apache.org/jira/browse/SOLR-13683?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=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: dev-unsubscr...@lucene.apache.org
For additional commands, e-mail: dev-h...@lucene.apache.org



[jira] [Commented] (SOLR-13683) SolrJ 8.1.1 Http2SolrClient should allow customizing HTTP headers

2019-08-14 Thread Shalin Shekhar Mangar (JIRA)


[ 
https://issues.apache.org/jira/browse/SOLR-13683?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16907760#comment-16907760
 ] 

Shalin Shekhar Mangar commented on SOLR-13683:
--

bq. Our use case is indexing documents to Solr; hence, we do not use 
SolrRequest APIs. We use SolrClient.add(collectionName, 
Collection) API. Do you have any document which shows how to 
use SolrRequest API for indexing use cases?

You can use UpdateRequest class which has an add method that accepts a 
Collection instead of calling add on CloudHttp2SolrClient 
directly.

> 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: dev-unsubscr...@lucene.apache.org
For additional commands, e-mail: dev-h...@lucene.apache.org



[jira] [Commented] (SOLR-13683) SolrJ 8.1.1 Http2SolrClient should allow customizing HTTP headers

2019-08-08 Thread Niranjan Nanda (JIRA)


[ 
https://issues.apache.org/jira/browse/SOLR-13683?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16903143#comment-16903143
 ] 

Niranjan Nanda commented on SOLR-13683:
---

[~shalinmangar] About the builder method {{withHttpClient}} - is there a chance 
to enhance it in future release? If so, any timeline?

Regarding other suggestions,
 * We are planning to use {{CloudHttp2SolrClient}}. I believe this uses Jetty's 
http client APIs instead of Apache's.
 * Our use case is indexing documents to Solr; hence, we do not use 
{{SolrRequest}} APIs. We use {{SolrClient.add(collectionName, 
Collection)}} API. Do you have any document which shows how 
to use {{SolrRequest}} API for indexing use cases?

Regardless I think it's easier to set the custom headers as part of the 
underneath HTTP Client (Apache/Jetty) instead of setting it for every request.

> 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: dev-unsubscr...@lucene.apache.org
For additional commands, e-mail: dev-h...@lucene.apache.org



[jira] [Commented] (SOLR-13683) SolrJ 8.1.1 Http2SolrClient should allow customizing HTTP headers

2019-08-08 Thread Shalin Shekhar Mangar (JIRA)


[ 
https://issues.apache.org/jira/browse/SOLR-13683?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16902887#comment-16902887
 ] 

Shalin Shekhar Mangar commented on SOLR-13683:
--

bq. What is the purpose of this method? 
Http2SolrClient.Builder().withHttpClient(Http2SolrClient httpClient)? Ideally 
this should allow setting Jetty's HttpClient object instead of an instance of 
its own type.

This certainly seems like a mistake. It should just directly accept Jetty's 
HttpClient instead of {{httpClient = builder.http2SolrClient.httpClient;}} that 
it does today in the constructor.

bq. 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.

Actually none of solrj clients allow custom headers directly but you can use 
Apache HttpClient's RequestInterceptors to add custom headers on all requests. 
But if you just want to use basic auth then you can use 
SolrRequest.setBasicAuthCredentials() method to add the user and password. 
These will be base64 encoded and passed to the Authorization header 
automatically by Http2SolrClient.

> 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: dev-unsubscr...@lucene.apache.org
For additional commands, e-mail: dev-h...@lucene.apache.org



[jira] [Commented] (SOLR-13683) SolrJ 8.1.1 Http2SolrClient should allow customizing HTTP headers

2019-08-08 Thread Niranjan Nanda (JIRA)


[ 
https://issues.apache.org/jira/browse/SOLR-13683?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16902766#comment-16902766
 ] 

Niranjan Nanda commented on SOLR-13683:
---

What is the purpose of this method? 
{{Http2SolrClient.Builder().withHttpClient(Http2SolrClient httpClient)}}? 
Ideally this should allow setting Jetty's {{HttpClient}} object instead of an 
instance of its own type.

> 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: dev-unsubscr...@lucene.apache.org
For additional commands, e-mail: dev-h...@lucene.apache.org