You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-user@lucene.apache.org by Kissue Kissue <ki...@gmail.com> on 2012/06/15 19:22:44 UTC

StreamingUpdateSolrServer Connection Timeout Setting

Hi,

Does anybody know what the default connection timeout setting is for
StreamingUpdateSolrServer? Can i explicitly set one and how?

Thanks.

Re: StreamingUpdateSolrServer Connection Timeout Setting

Posted by Torsten Krah <tk...@fachschaft.imn.htwk-leipzig.de>.
You should also call the glue code ;-):

Protocol.registerProtocol("http", http);

regards

Torsten

Re: StreamingUpdateSolrServer Connection Timeout Setting

Posted by Torsten Krah <tk...@fachschaft.imn.htwk-leipzig.de>.
AddOn: You can even set a custom http factory for commons-http (which is
used by SolrStreamingUpdateServer) at all to influence socket options,
example is:

final Protocol http = new Protocol("http",
MycustomHttpSocketFactory.getSocketFactory(), 80);

and MycustomHttpSocketFactory.getSocketFactory is a factory which does
extend

org.apache.commons.httpclient.protocol.DefaultProtocolSocketFactory

and override / implement methods as needed (direct socket access).

Call this e.g. in a ServletListener in contextInitialized and you are
done.

regards

Torsten


Re: StreamingUpdateSolrServer Connection Timeout Setting

Posted by Torsten Krah <tk...@fachschaft.imn.htwk-leipzig.de>.
Am Freitag, den 15.06.2012, 18:22 +0100 schrieb Kissue Kissue:
> Hi,
> 
> Does anybody know what the default connection timeout setting is for
> StreamingUpdateSolrServer? Can i explicitly set one and how?
> 
> Thanks. 

Use a custom HttpClient to set one (only snippets, should be clear, if
not tell):

this.instance = new StreamingUpdateSolrServer(getUrl(), httpClient,
DOC_QUEUE_SIZE, WORKER_SIZE);

and use httpClient like this:

this.connectionManager = new MultiThreadedHttpConnectionManager();
final HttpClient httpClient = new HttpClient(this.connectionManager);
httpClient.getParams().setConnectionManagerTimeout(CONN_ACQUIRE_TIMEOUT);
httpClient.getParams().setSoTimeout(SO_TIMEOUT);

regards

Torsten

Re: StreamingUpdateSolrServer Connection Timeout Setting

Posted by Kissue Kissue <ki...@gmail.com>.
Thanks Sami. Has anybody had any need to explicitly set the connection
timeout? Just trying to understand how folks use it.

Thanks.

On Fri, Jun 15, 2012 at 7:01 PM, Sami Siren <ss...@gmail.com> wrote:

> The api doc for version 3.6.0 is available here:
>
> http://lucene.apache.org/solr/api/org/apache/solr/client/solrj/impl/StreamingUpdateSolrServer.html
>
> I think the default is coming from your OS if you are not setting it
> explicitly.
>
> --
>  Sami Siren
>
> On Fri, Jun 15, 2012 at 8:22 PM, Kissue Kissue <ki...@gmail.com>
> wrote:
> > Hi,
> >
> > Does anybody know what the default connection timeout setting is for
> > StreamingUpdateSolrServer? Can i explicitly set one and how?
> >
> > Thanks.
>

Re: StreamingUpdateSolrServer Connection Timeout Setting

Posted by Sami Siren <ss...@gmail.com>.
The api doc for version 3.6.0 is available here:
http://lucene.apache.org/solr/api/org/apache/solr/client/solrj/impl/StreamingUpdateSolrServer.html

I think the default is coming from your OS if you are not setting it explicitly.

--
 Sami Siren

On Fri, Jun 15, 2012 at 8:22 PM, Kissue Kissue <ki...@gmail.com> wrote:
> Hi,
>
> Does anybody know what the default connection timeout setting is for
> StreamingUpdateSolrServer? Can i explicitly set one and how?
>
> Thanks.